Commit Graph

218185 Commits

Author SHA1 Message Date
Rui Ueyama c5b9512958 ELF: Remove duplicate code.
We had duplicate code that were called before addMemberFile.
This patch makes them to be called at beginning of addMemberFile.

llvm-svn: 255845
2015-12-16 23:23:14 +00:00
Derek Schuff 8bb5f2927a [WebAssembly] Implement eliminateCallFramePseudo
Summary:
Implement eliminateCallFramePsuedo to handle ADJCALLSTACKUP/DOWN
pseudo-instructions. Add a test calling a vararg function which causes non-0
adjustments. This revealed an issue with RegisterCoalescer wherein it
eliminates a COPY from SP32 to a vreg but failes to update the live ranges
of EXPR_STACK, causing a machineinstr verifier failure (so this test
is commented out).

Also add a dynamic alloca test, which causes a callseq_end dag node with
a 0 (instead of undef) second argument to be generated. We currently fail to
select that, so adjust the ADJCALLSTACKUP tablegen code to handle it.

Differential Revision: http://reviews.llvm.org/D15587

llvm-svn: 255844
2015-12-16 23:21:30 +00:00
Rafael Espindola 433049f87b Update for llvm api change.
llvm-svn: 255843
2015-12-16 23:16:37 +00:00
Rafael Espindola 434e956181 Change linkInModule to take a std::unique_ptr.
Passing in a std::unique_ptr should help find errors when the module
is used after being linked into another module.

llvm-svn: 255842
2015-12-16 23:16:33 +00:00
Eric Christopher bfba572425 Fix funciton->function typo.
llvm-svn: 255841
2015-12-16 23:10:53 +00:00
Eric Christopher be5286629f Fix funciton->function typo.
llvm-svn: 255840
2015-12-16 23:10:46 +00:00
Rui Ueyama 8957574549 ELF: Remove SymbolTable::addELFFile.
addELFFile was called only from addFile, and what it did was actually
just adding a file to the symbol table. There seems to be no reason
to separate the two.

llvm-svn: 255839
2015-12-16 22:59:13 +00:00
Rafael Espindola fa1eedee3a Update for llvm API change.
llvm-svn: 255838
2015-12-16 22:59:09 +00:00
Rafael Espindola 3f210fc0c8 Drop an unnecessary use of writev.
It looks like the code this patch deletes is based on a misunderstanding of
what guarantees writev provides. In particular, writev with 1 iovec is
not "more atomic" than a write.

Testing on OS X shows that both write and writev from multiple processes
can be intermixed.

llvm-svn: 255837
2015-12-16 22:59:06 +00:00
Ahmed Bougacha 66834ec6e1 [AArch64] Simplify some TRI/TII getters. NFC.
We don't need static_casts when we use the right Subtarget.

llvm-svn: 255836
2015-12-16 22:54:06 +00:00
Pete Cooper 9092eca155 Fix negDelta32 relocatable fixups for arm64 in mach-o.
negDelta32 is only ever implicitly generated as the FDE->CIE reference.
We therefore don't emit a relocation for it in the object file in -r mode.

The value we write in to the FDE location therefore needs to point to the
final target address of the CIE, and not the inAtomAddress as it was currently
doing.

llvm-svn: 255835
2015-12-16 22:50:16 +00:00
NAKAMURA Takumi 6cd453b09d Move llvm/test/DebugInfo/live-debug-values.ll into X86, due to target triple.
llvm-svn: 255834
2015-12-16 22:44:10 +00:00
Rui Ueyama a71f3a71cc Do not omit * from auto.
We don't do that in other places in the same file.

llvm-svn: 255833
2015-12-16 22:36:10 +00:00
Rui Ueyama dd7d998919 ELF: Drop 'Sym' suffix from member function names for consistency.
Since the functions are members of SymbolTable class, it is obvious
that they are adding symbols.

llvm-svn: 255832
2015-12-16 22:31:14 +00:00
Rafael Espindola b94ab5ffbd Simplify memory management with std::unique_ptr.
llvm-svn: 255831
2015-12-16 22:28:34 +00:00
Rui Ueyama 533336a368 ELF: Factor out common code. NFC.
llvm-svn: 255830
2015-12-16 22:26:48 +00:00
Rui Ueyama f09040120f ELF: Separate error message generation from call of error() or warning().
Previously reportConflict returned only when the third argument is false.
Now it always returns a value.

llvm-svn: 255829
2015-12-16 22:26:45 +00:00
Ahmed Bougacha cecb6b0865 [CodeGen] Make MachineInstrBuilder::copyImplicitOps const. NFC.
This matches the other MIB methods, none of which modify the builder.
Without this, we can't chain copyImplicitOps.
Also reformat the few users, in PPCEarlyReturn.

llvm-svn: 255828
2015-12-16 22:15:30 +00:00
Evgeniy Stepanov 17d6086a13 Fix CFI tests in sanitizer-ld.
This test is not testing what it is supposed to test because of a
mixup with the CHECK lines.

llvm-svn: 255827
2015-12-16 22:03:39 +00:00
Pete Cooper e5fa5a3c29 Add more debugging output to MachO lld. NFC.
In debug builds there's now a dump method on Section and improved
printing of atoms.

llvm-svn: 255826
2015-12-16 22:03:21 +00:00
Nathan Slingerland 48dd080c77 [PGO] Handle and report overflow during profile merge for all types of data
Summary: Surface counter overflow when merging profile data. Merging still occurs on overflow but counts saturate to the maximum representable value. Overflow is reported to the user.

Reviewers: davidxl, dnovillo, silvas

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D15547

llvm-svn: 255825
2015-12-16 21:45:43 +00:00
Teresa Johnson 031bed291e Use LLVM style variable name (NFC)
Fixes variable name from r255779.

llvm-svn: 255824
2015-12-16 21:37:48 +00:00
Rui Ueyama 27161302a0 Merge two `if`s for MIPS. NFC.
llvm-svn: 255823
2015-12-16 21:35:39 +00:00
Pete Cooper 6e319c7b42 Fix DarwinLdDriverTest.cpp to pass real llvm options.
After r255819, parse() actually parses what you pass it.

This test was failing because it passed '--debug-only' which isn't in
release builds, but also 'foo' which isn't an option at all.

We now pass -enable-tbaa and -enable-misched which are real options.

llvm-svn: 255822
2015-12-16 21:24:46 +00:00
Manman Ren cbe4f9417d CXX_FAST_TLS calling convention: performance improvement for AArch64.
The access function has a short entry and a short exit, the initialization
block is only run the first time. To improve the performance, we want to
have a short frame at the entry and exit.

We explicitly handle most of the CSRs via copies. Only the CSRs that are not
handled via copies will be in CSR_SaveList.

Frame lowering and prologue/epilogue insertion will generate a short frame
in the entry and exit according to CSR_SaveList. The majority of the CSRs will
be handled by register allcoator. Register allocator will try to spill and
reload them in the initialization block.

We add CSRsViaCopy, it will be explicitly handled during lowering.

1> we first set FunctionLoweringInfo->SplitCSR if conditions are met (the target
   supports it for the given machine function and the function has only return
   exits). We also call TLI->initializeSplitCSR to perform initialization.
2> we call TLI->insertCopiesSplitCSR to insert copies from CSRsViaCopy to
   virtual registers at beginning of the entry block and copies from virtual
   registers to CSRsViaCopy at beginning of the exit blocks.
3> we also need to make sure the explicit copies will not be eliminated.

The target independent portion was committed as r255353.
rdar://problem/23557469

Differential Revision: http://reviews.llvm.org/D15341

llvm-svn: 255821
2015-12-16 21:04:19 +00:00
Krzysztof Parzyszek 9a5b052f7c [Hexagon] Update e_flags in the ELF definitions
llvm-svn: 255820
2015-12-16 20:57:07 +00:00
Pete Cooper 7bf3a85e2b Move parsing of LLVM options to parse() method.
We used to parse the LLVM options in Driver::link.  However, that is
after parse() where we load files.  By moving the LLVM option handling
earlier, we can add DEBUG() to code such as MachONormalizedFileToAtoms.cpp
and have it enabled correctly by '-mllvm --debug'.

llvm-svn: 255819
2015-12-16 20:53:27 +00:00
Manman Ren 3e3edc91f9 CXX_FAST_TLS calling convention: target independent portion.
Update supportSplitCSR's interface to take machine function instead of the
calling convention.

Review comments for http://reviews.llvm.org/D15341

llvm-svn: 255818
2015-12-16 20:45:48 +00:00
Derek Schuff 993d35b4aa Remove now-unused include
llvm-svn: 255817
2015-12-16 20:43:10 +00:00
Derek Schuff 83717cc297 Iterate over phys regs instead
llvm-svn: 255816
2015-12-16 20:43:08 +00:00
Derek Schuff 45cd5a79b2 [WebAssembly] Print an extra local decl when the user stack pointer is used
Differential Revision: http://reviews.llvm.org/D15546

llvm-svn: 255815
2015-12-16 20:43:06 +00:00
Sumanth Gundapaneni ce7fc17970 [PS4] Fix the unit test to be compatible with clang driver. NFC
".exe" extension is inherently checked by llvm::fs::can_execute()
This patch fixes the linker extension in clang driver and updates the
unit test to accommodate the the check string on windows.

Differential Revision:http://reviews.llvm.org/D15577

llvm-svn: 255814
2015-12-16 20:18:12 +00:00
Chris Bieneman c146ea45f5 [CMake] Name the bootstrap stages stage[0-9]
When you start chaining bootstrap stages the CMake-generated targets get unwieldy. This change supports naming the bootstrap targets and creating wrapper targets in the top-level build file.

Without this patch the default target generated for a second stage build was "bootstrap" with it the target is "stage2".

Also with some CMake goop setting CLANG_BOOTSTRAP_TARGETS, you can expose third stage targets as "stage3" instead of "bootstrap-bootstrap"

llvm-svn: 255813
2015-12-16 20:17:07 +00:00
Nico Weber 2381df7b54 Let -Wdelete-non-virtual-dtor mention final.
llvm-svn: 255812
2015-12-16 20:07:24 +00:00
Krzysztof Parzyszek 4f9164d9b3 [Hexagon] Misc fixes to r255807
llvm-svn: 255811
2015-12-16 20:07:04 +00:00
Paul Robinson 6c27a2c40e Set debugger tuning from TargetOptions (NFC)
Differential Revision: http://reviews.llvm.org/D15427

llvm-svn: 255810
2015-12-16 19:58:30 +00:00
Diego Novillo 1f5d845452 Add -fsyntax-only to fix failure in read-only directories.
Internally, this test is executed in a read-only directory, which causes
it to fail because the driver tries to generate a file unnecessarily.
Adding -fsyntax-only fixes the issue (thanks to Artem Belevich for
figuring out the root cause).

llvm-svn: 255809
2015-12-16 19:52:05 +00:00
Dawn Perchik bfd96183ef Rework breakpoint language filtering to use the symbol context's language.
This patch reworks the breakpoint filter-by-language patch to use the
symbol context instead of trying to guess the language solely from the
symbol's name. This has the advantage that symbols compiled with debug
info will have their actual language known. Symbols without debug info
will still do the same "guess"ing because Symbol::GetLanguage() is
implemented using Mangled::GuessLanguage(). The recognition of ObjC
names was merged into Mangled::GuessLanguage.

Reviewed by: jingham, clayborg
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D15326

llvm-svn: 255808
2015-12-16 19:40:00 +00:00
Krzysztof Parzyszek 56bbf54b43 [Hexagon] Update the Hexagon packetizer
llvm-svn: 255807
2015-12-16 19:36:12 +00:00
Reid Kleckner 187d33ee74 Revert "[ARM] Add ARMv8.2-A FP16 scalar instructions"
This reverts commit r255762.

llvm-svn: 255806
2015-12-16 19:21:03 +00:00
Pete Cooper 3e8f56565d Added some DEBUG() prints to make it clearer what the mach-o passes are doing. NFC.
We had some DEBUG prints these passes, but add more so that its clear where we are dumping
things, and what state we are in when we do so.

I'll be adding more and more DEBUG printing to try make it easier to observe whats going on
without having to attach a debugger.

llvm-svn: 255805
2015-12-16 19:12:49 +00:00
Sumanth Gundapaneni c27f54822c Fix the failing windows clang unit tests. NFC
Some tests are missing the {{(.exe)?}} suffix on the exectables
which the FileCheck is grepping for. This will ensure, the lit tests
are clean on windows

Differential Revision: http://reviews.llvm.org/D15579

llvm-svn: 255804
2015-12-16 19:09:51 +00:00
Dan Gohman b3aa1ecab0 [WebAssembly] Fix the CFG Stackifier to handle unoptimized branches
If a branch both branches to and falls through to the same block, treat it as
an explicit branch.

llvm-svn: 255803
2015-12-16 19:06:41 +00:00
Artem Belevich 7fda3c9ff3 [CUDA] renamed cuda_runtime.h wrapper to __cuda_runtime.h
Currently it's easy to break CUDA compilation by passing
"-isystem /path/to/cuda/include" to compiler which leads to
compiler including real cuda_runtime.h from there instead
of the wrapper we need.

Renaming the wrapper ensures that we can include the wrapper
regardless of user-specified include paths and files.

Differential Revision: http://reviews.llvm.org/D15534

llvm-svn: 255802
2015-12-16 18:51:59 +00:00
Chris Bieneman 5ac5d61b9c [CMake] If you're building compiler-rt, the bootstrap build should depend on it.
Adding optional dependency for the bootstrap targets on compiler-rt.

llvm-svn: 255801
2015-12-16 18:49:12 +00:00
Chris Bieneman 475f52c93f [CMake] Make CLANG_BOOTSTRAP_TARGETS overridable
This allows exposing a custom list of targets from the next stage build up.

llvm-svn: 255799
2015-12-16 18:45:53 +00:00
Chris Bieneman 77c5e78e71 [CMake] ExternalProject for compiler-rt needs to depend on llvm-config and clang
The add_dependencies call on compiler-rt-configure adds llvm-config and clang to the phony target, but not to the actual configure custom command. We need the dependency bound to the custom command so that it can't be re-ordered by Ninja.

llvm-svn: 255798
2015-12-16 18:42:14 +00:00
Justin Bogner 883a3ea67f LPM: Make callers of LPM.deleteLoopFromQueue update LoopInfo directly. NFC
As of r255720, the loop pass manager will DTRT when passes update the
loop info for removed loops, so they no longer need to reach into
LPPassManager APIs to do this kind of transformation. This change very
nearly removes the need for the LPPassManager to even be passed into
loop passes - the only remaining pass that uses the LPM argument is
LoopUnswitch.

llvm-svn: 255797
2015-12-16 18:40:20 +00:00
Matt Arsenault e05ff15186 AMDGPU: Override getCFInstrCost
The default cost was 0 with the assumption that it is predictable.

llvm-svn: 255796
2015-12-16 18:37:19 +00:00
Tom Stellard 5ce530608f MachineScheduler: Add a target hook for deciding which RegPressure sets to
increase

Summary:
This patch adds a function called getRegPressureSetScore() to
TargetRegisterInfo.  The MachineScheduler uses this when comparing
instruction that increase the register pressure of different sets
to determine which set is safer to increase.

This hook is useful for GPU targets where the number of registers in the
class is not the best metric for determing which presser set is safer to
increase.

Future work may include adding more parameters to this function, like
for example, the current pressure level of the set or the amount that
the pressure will be increased/decreased.

Reviewers: qcolombet, escha, arsenm, atrick, MatzeB

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D14806

llvm-svn: 255795
2015-12-16 18:31:01 +00:00