Colin LeMahieu [Thu, 20 Nov 2014 21:56:35 +0000 (21:56 +0000)]
[Hexagon] [NFC] Merging InstPrinter directory in to MCTargetDesc since they have a circular dependency.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222458
91177308-0d34-0410-b5e6-
96231b3b80d8
Lang Hames [Thu, 20 Nov 2014 21:16:16 +0000 (21:16 +0000)]
[MCJIT] Remove JITEventListener::NotifyFunctionEmitted - this method is dead
now that the legacy JIT has been removed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222453
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Zolotukhin [Thu, 20 Nov 2014 20:19:55 +0000 (20:19 +0000)]
Fix a trip-count overflow issue in LoopUnroll.
Currently LoopUnroll generates a prologue loop before the main loop
body to execute first N%UnrollFactor iterations. Also, this loop is
used if trip-count can overflow - it's determined by a runtime check.
However, we've been mistakenly optimizing this loop to a linear code for
UnrollFactor = 2, not taking into account that it also serves as a safe
version of the loop if its trip-count overflows.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222451
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Ilseman [Thu, 20 Nov 2014 19:33:33 +0000 (19:33 +0000)]
Compilation test for PostOrderIterator.
If the template specialization for externally managed sets in
PostOrderIterator call too far out of sync with each other, this unit
test will fail to build. This is especially useful for developers who
may not build Clang (the only in-tree user) every time.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222447
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Ilseman [Thu, 20 Nov 2014 19:33:30 +0000 (19:33 +0000)]
Update template specialization to reflect API changes.
po_iterator_storage's insertEdge was updated to reflect the API
changes from many of our insert methods in r222334, however the
template specialization for external storage was not updated. This
updates the specialization.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222446
91177308-0d34-0410-b5e6-
96231b3b80d8
Saleem Abdulrasool [Thu, 20 Nov 2014 18:01:26 +0000 (18:01 +0000)]
X86: use the correct alloca symbol for Windows Itanium
Windows itanium targets the MSVCRT, and the stack probe symbol is provided by
MSVCRT. This corrects the emission of stack probes on i686-windows-itanium.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222439
91177308-0d34-0410-b5e6-
96231b3b80d8
Frederic Riss [Thu, 20 Nov 2014 16:21:11 +0000 (16:21 +0000)]
Make DWARFAcceleratorTable::dump() const.
As dump() methods should be. To allow that, do not store the DWARFFormValue
objects used for the dump in the header data.
Per Alexey's suggestion!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222436
91177308-0d34-0410-b5e6-
96231b3b80d8
Frederic Riss [Thu, 20 Nov 2014 16:21:06 +0000 (16:21 +0000)]
Add missing copyright headers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222435
91177308-0d34-0410-b5e6-
96231b3b80d8
Frederic Riss [Thu, 20 Nov 2014 15:52:34 +0000 (15:52 +0000)]
Do not create a replaceable Variables MDNode for function forward decls.
These fields would need to be explicitly deleted before we RAUW the temporary
node anyway (this was done in cfe commit r222373). Instead, do not create
these useless nodes in the first place.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222434
91177308-0d34-0410-b5e6-
96231b3b80d8
Renato Golin [Thu, 20 Nov 2014 13:32:16 +0000 (13:32 +0000)]
MCJIT tests passing on ARM after r222414 fixed the relocation
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222430
91177308-0d34-0410-b5e6-
96231b3b80d8
Timur Iskhodzhanov [Thu, 20 Nov 2014 12:36:43 +0000 (12:36 +0000)]
Revert r222416, r222422, r222426: the former revision had problems and fixing them introduced bugs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222428
91177308-0d34-0410-b5e6-
96231b3b80d8
Timur Iskhodzhanov [Thu, 20 Nov 2014 11:48:58 +0000 (11:48 +0000)]
Fix a typo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222426
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Thu, 20 Nov 2014 08:59:02 +0000 (08:59 +0000)]
SimplifyCFG.cpp: Tweak to let msc17 compliant.
- Use LLVM_DELETED_FUNCTION.
- Don't use member initializers.
- Don't use initializer list.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222422
91177308-0d34-0410-b5e6-
96231b3b80d8
Mehdi Amini [Thu, 20 Nov 2014 06:51:02 +0000 (06:51 +0000)]
SimplifyCFG: Refactor GatherConstantCompares() result in a struct
Code seems cleaner and easier to understand this way
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222416
91177308-0d34-0410-b5e6-
96231b3b80d8
Jyoti Allur [Thu, 20 Nov 2014 05:58:11 +0000 (05:58 +0000)]
[ELF] Prevent ARM ELF object writer from generating deprecated relocation code R_ARM_PLT32
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222414
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Thu, 20 Nov 2014 05:32:10 +0000 (05:32 +0000)]
Add a test for r221870
bad-relocs.obj.coff-i386 has a relocation whose symbol index is outside
the symbol table.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222413
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Thu, 20 Nov 2014 05:22:37 +0000 (05:22 +0000)]
Fix a typo in a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222412
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Thu, 20 Nov 2014 05:22:35 +0000 (05:22 +0000)]
Remove unnecessary extra spaces from tablegen register info output.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222411
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Thu, 20 Nov 2014 05:22:32 +0000 (05:22 +0000)]
Use array_lengthof instead of sizeof(array)/sizeof(element) in a tablegen output.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222410
91177308-0d34-0410-b5e6-
96231b3b80d8
Alexey Samsonov [Thu, 20 Nov 2014 01:27:19 +0000 (01:27 +0000)]
Remove support for undocumented SpecialCaseList entries.
"global-init", "global-init-src" and "global-init-type" were originally
used to blacklist entities in ASan init-order checker. However, they
were never documented, and later were replaced by "=init" category.
Old blacklist entries should be converted as follows:
* global-init:foo -> global:foo=init
* global-init-src:bar -> src:bar=init
* global-init-type:baz -> type:baz=init
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222401
91177308-0d34-0410-b5e6-
96231b3b80d8
Colin LeMahieu [Wed, 19 Nov 2014 23:22:23 +0000 (23:22 +0000)]
[Hexagon] Adding A2_xor instruction with IR selection pattern and test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222399
91177308-0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Wed, 19 Nov 2014 23:21:20 +0000 (23:21 +0000)]
Revert "[Reassociate] As the expression tree is rewritten make sure the operands are"
This reverts commit r222142. This is causing/exposing an execution-time regression
in spec2006/gcc and coremark on AArch64/A57/Ofast.
Conflicts:
test/Transforms/Reassociate/optional-flags.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222398
91177308-0d34-0410-b5e6-
96231b3b80d8
Colin LeMahieu [Wed, 19 Nov 2014 22:58:04 +0000 (22:58 +0000)]
[Hexagon] Adding A2_or instruction with IR selection pattern and test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222396
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Wed, 19 Nov 2014 22:39:21 +0000 (22:39 +0000)]
gold-plugin: Fix typo in error message
Spotted while reading code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222395
91177308-0d34-0410-b5e6-
96231b3b80d8
Jordan Rose [Wed, 19 Nov 2014 22:03:21 +0000 (22:03 +0000)]
[CMake] Update GetSVN.cmake to use LLVM version control helper scripts.
This allows the logic to work with Git, and also uses the variable names
to match what Clang is actually looking for.
This is a re-application of r190556 and r190808. This changes the interface
of GetSVN.cmake. Clang change to follow.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222391
91177308-0d34-0410-b5e6-
96231b3b80d8
Saleem Abdulrasool [Wed, 19 Nov 2014 21:55:31 +0000 (21:55 +0000)]
ADT: windows itanium targets msvcrt.dll
Update the isOSMSVCRT to correctly identify that windows-itanium uses
msvcrt.dll.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222389
91177308-0d34-0410-b5e6-
96231b3b80d8
Nico Weber [Wed, 19 Nov 2014 21:16:11 +0000 (21:16 +0000)]
Try to fix MSVS build after r222384. No intended behavior change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222386
91177308-0d34-0410-b5e6-
96231b3b80d8
Kevin Enderby [Wed, 19 Nov 2014 20:20:16 +0000 (20:20 +0000)]
Fix Use-of-uninitialized-value for adrp_addr and adrp_inst in MachODump.cpp
Fixes PR21607
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222385
91177308-0d34-0410-b5e6-
96231b3b80d8
Mehdi Amini [Wed, 19 Nov 2014 20:09:11 +0000 (20:09 +0000)]
SimplifyCFG: turn recursive GatherConstantCompares into iterative
A long sequence of || or && could lead to a stack explosion.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222384
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Wed, 19 Nov 2014 19:46:17 +0000 (19:46 +0000)]
RegisterCoalescer: Improve debug messages
- Show "Considering..." message after flipping so you actually see the final
destination vreg as destination.
- Add a message on final join, so you can grep for "Success" messages to obtain
a list of which register got merged with which.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222382
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Wed, 19 Nov 2014 19:46:15 +0000 (19:46 +0000)]
Add a print and verify pass after the RegisterCoalescer
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222381
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Wed, 19 Nov 2014 19:46:13 +0000 (19:46 +0000)]
MachineVerifier: Report register for bad liveranges
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222380
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Wed, 19 Nov 2014 19:46:11 +0000 (19:46 +0000)]
Introduce register dump helper
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222379
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Wed, 19 Nov 2014 19:36:18 +0000 (19:36 +0000)]
AliasSet: Simplify mergeSetIn
No functional change intended.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222376
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrea Di Biagio [Wed, 19 Nov 2014 19:34:29 +0000 (19:34 +0000)]
[X86] Improved lowering of v4x32 build_vector dag nodes.
This patch improves the lowering of v4f32 and v4i32 build_vector dag nodes
that are known to have at least two non-zero elements.
With this patch, a build_vector that performs a blend with zero is
converted into a shuffle. This is done to let the shuffle legalizer expand
the dag node in a optimal way. For example, if we know that a build_vector
performs a blend with zero, we can try to lower it as a movq/blend instead of
always selecting an insertps.
This patch also improves the logic that lowers a build_vector into a insertps
with zero masking. See for example the extra test cases added to test sse41.ll.
Differential Revision: http://reviews.llvm.org/D6311
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222375
91177308-0d34-0410-b5e6-
96231b3b80d8
Lang Hames [Wed, 19 Nov 2014 19:15:41 +0000 (19:15 +0000)]
[ADT] Fix PR20728 - Incorrect APFloat::fusedMultiplyAdd results for x86_fp80.
As detailed at http://llvm.org/PR20728, due to an internal overflow in
APFloat::multiplySignificand the APFloat::fusedMultiplyAdd method can return
incorrect results for x87DoubleExtended (x86_fp80) values. This commonly
manifests as incorrect constant folding of libm fmal calls on x86. E.g.
fmal(1.0L, 1.0L, 3.0L) == 0.0L (should be 4.0L)
This patch fixes PR20728 by adding an extra bit to the significand for
intermediate results of APFloat::multiplySignificand, avoiding the overflow.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222374
91177308-0d34-0410-b5e6-
96231b3b80d8
Colin LeMahieu [Wed, 19 Nov 2014 17:10:39 +0000 (17:10 +0000)]
[llvm-readobj][NFC]
Appeasing mingw without C++11 std::to_string
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222369
91177308-0d34-0410-b5e6-
96231b3b80d8
Tom Stellard [Wed, 19 Nov 2014 16:58:49 +0000 (16:58 +0000)]
R600/SI: Make SIInstrInfo::isOperandLegal() more strict
A register operand that has a common sub-class with its instruction's
defined register class is not always legal. For example,
SReg_32 and M0Reg both have a common sub-class, but we can't
use an SReg_32 in instructions that expect a M0Reg.
This prevents the llvm.SI.sendmsg.ll test from failing when the fold
operand pass is added.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222368
91177308-0d34-0410-b5e6-
96231b3b80d8
Zoran Jovanovic [Wed, 19 Nov 2014 16:44:02 +0000 (16:44 +0000)]
[mips][micromips] Implement SWM32 and LWM32 instructions
Differential Revision: http://reviews.llvm.org/D5519
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222367
91177308-0d34-0410-b5e6-
96231b3b80d8
Suyog Sarda [Wed, 19 Nov 2014 16:07:38 +0000 (16:07 +0000)]
Vectorize a reduction chain feeding into a 'return' statement.
e.x
return (a[0]+b[0]) + (a[1]+b[1])
Differential Revision: http://reviews.llvm.org/D6227
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222364
91177308-0d34-0410-b5e6-
96231b3b80d8
Jozef Kolek [Wed, 19 Nov 2014 13:37:51 +0000 (13:37 +0000)]
[mips][microMIPS] Fix opcodes of MFHC1 and MTHC1 instructions.
Differential Revision: http://reviews.llvm.org/D6169
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222355
91177308-0d34-0410-b5e6-
96231b3b80d8
Arnaud A. de Grandmaison [Wed, 19 Nov 2014 13:32:51 +0000 (13:32 +0000)]
Fix tail recursion elimination
When the BasicBlock containing the return instrution has a PHI with 2
incoming values, FoldReturnIntoUncondBranch will remove the no longer
used incoming value and remove the no longer needed phi as well. This
leaves us with a BB that no longer has a PHI, but the subsequent call
to FoldReturnIntoUncondBranch from FoldReturnAndProcessPred will not
remove the return instruction (which still uses the result of the call
instruction). This prevents EliminateRecursiveTailCall to remove
the value, as it is still being used in a basicblock which has no
predecessors.
The basicblock can not be erased on the spot, because its iterator is
still being used in runTRE.
This issue was exposed when removing the threshold on size for lifetime
marker insertion for named temporaries in clang. The testcase is a much
reduced version of peelOffOuterExpr(const Expr*, const ExplodedNode *)
from clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222354
91177308-0d34-0410-b5e6-
96231b3b80d8
Jozef Kolek [Wed, 19 Nov 2014 13:23:58 +0000 (13:23 +0000)]
[mips][microMIPS] Implement CodeGen support for 16-bit instruction ADDIUR2.
Differential Revision: http://reviews.llvm.org/D5800
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222352
91177308-0d34-0410-b5e6-
96231b3b80d8
Jozef Kolek [Wed, 19 Nov 2014 13:11:09 +0000 (13:11 +0000)]
[mips][microMIPS] Implement CodeGen support for ADDIUS5 instruction.
Differential Revision: http://reviews.llvm.org/D5799
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222351
91177308-0d34-0410-b5e6-
96231b3b80d8
Jozef Kolek [Wed, 19 Nov 2014 11:49:57 +0000 (11:49 +0000)]
[mips][microMIPS] Add disassembler tests for new microMIPS 32-bit
instructions: LWXS, BGEZALS, BLTZALS, BEQZC, BNEZC, JALS and JALRS.
http://reviews.llvm.org/D5413
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222349
91177308-0d34-0410-b5e6-
96231b3b80d8
Jozef Kolek [Wed, 19 Nov 2014 11:39:12 +0000 (11:39 +0000)]
[mips][microMIPS] Implement LWXS instruction.
Differential Revision: http://reviews.llvm.org/D5407
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222348
91177308-0d34-0410-b5e6-
96231b3b80d8
Jozef Kolek [Wed, 19 Nov 2014 11:25:50 +0000 (11:25 +0000)]
[mips][microMIPS] Implement SDBBP and RDHWR instructions.
Differential Revision: http://reviews.llvm.org/D5240
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222347
91177308-0d34-0410-b5e6-
96231b3b80d8
Evgeniy Stepanov [Wed, 19 Nov 2014 10:30:02 +0000 (10:30 +0000)]
Use ninja pools to limit the number of concurrent compile/link jobs.
This change makes use of the new "job pool" capability in cmake 3.0
with ninja generator to allow limiting the number of concurrent jobs
of a certain type.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222341
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Wed, 19 Nov 2014 10:06:49 +0000 (10:06 +0000)]
[X86][SSE] pslldq/psrldq byte shifts/rotation for SSE2
This patch builds on http://reviews.llvm.org/D5598 to perform byte rotation shuffles (lowerVectorShuffleAsByteRotate) on pre-SSSE3 (palignr) targets - pre-SSSE3 is only enabled on i8 and i16 vector targets where it is a more definite performance gain.
I've also added a separate byte shift shuffle (lowerVectorShuffleAsByteShift) that makes use of the ability of the SLLDQ/SRLDQ instructions to implicitly shift in zero bytes to avoid the need to create a zero register if we had used palignr.
Differential Revision: http://reviews.llvm.org/D5699
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222340
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Wed, 19 Nov 2014 09:41:05 +0000 (09:41 +0000)]
AliasSetTracker: UnknownInsts should contribute to the refcount
AliasSetTracker::addUnknown may create an AliasSet devoid of pointers
just to contain an instruction if no suitable AliasSet already exists.
It will then AliasSet::addUnknownInst and we will be done.
However, it's possible for addUnknown to choose an existing AliasSet to
addUnknownInst.
If this were to occur, we are in a bit of a pickle: removing pointers
from the AliasSet can cause the entire AliasSet to become destroyed,
taking our unknown instructions out with them.
Instead, keep track whether or not our AliasSet has any unknown
instructions.
This fixes PR21582.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222338
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Wed, 19 Nov 2014 08:12:55 +0000 (08:12 +0000)]
Add missing header
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222337
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Wed, 19 Nov 2014 07:49:26 +0000 (07:49 +0000)]
Update SetVector to rely on the underlying set's insert to return a pair<iterator, bool>
This is to be consistent with StringSet and ultimately with the standard
library's associative container insert function.
This lead to updating SmallSet::insert to return pair<iterator, bool>,
and then to update SmallPtrSet::insert to return pair<iterator, bool>,
and then to update all the existing users of those functions...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222334
91177308-0d34-0410-b5e6-
96231b3b80d8
Hao Liu [Wed, 19 Nov 2014 06:48:56 +0000 (06:48 +0000)]
[AArch64] Disable useAA for Cortex-A57.
Using AA during CodeGen is very useful for in-order cores. It is less useful for ooo cores. Also I find
enabling useAA for Cortex-A57 may generate worse code for some test cases. If useAA in codegen is improved
and benefical for ooo cores, we can enable it again.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222333
91177308-0d34-0410-b5e6-
96231b3b80d8
Hao Liu [Wed, 19 Nov 2014 06:39:53 +0000 (06:39 +0000)]
[AArch64] Enable SeparateConstOffsetFromGEP, EarlyCSE and LICM passes on AArch64 backend.
SeparateConstOffsetFromGEP can gives more optimizaiton opportunities related to GEPs, which benefits EarlyCSE
and LICM. By enabling these passes we can have better address calculations and generate a better addressing
mode. Some SPEC 2006 benchmarks (astar, gobmk, namd) have obvious improvements on Cortex-A57.
Reviewed in http://reviews.llvm.org/D5864.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222331
91177308-0d34-0410-b5e6-
96231b3b80d8
Hao Liu [Wed, 19 Nov 2014 06:24:44 +0000 (06:24 +0000)]
[SeparateConstOffsetFromGEP] Allow SeparateConstOffsetFromGEP pass to lower GEPs.
If LowerGEP is enabled, it can lower a GEP with multiple indices into GEPs with a single index
or arithmetic operations. Lowering GEPs can always extract structure indices. Lowering GEPs can
also give use more optimization opportunities. It can benefit passes like CSE, LICM and CGP.
Reviewed in http://reviews.llvm.org/D5864
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222328
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Wed, 19 Nov 2014 05:49:42 +0000 (05:49 +0000)]
Remove StringMap::GetOrCreateValue in favor of StringMap::insert
Having two ways to do this doesn't seem terribly helpful and
consistently using the insert version (which we already has) seems like
it'll make the code easier to understand to anyone working with standard
data structures. (I also updated many references to the Entry's
key and value to use first() and second instead of getKey{Data,Length,}
and get/setValue - for similar consistency)
Also removes the GetOrCreateValue functions so there's less surface area
to StringMap to fix/improve/change/accommodate move semantics, etc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222319
91177308-0d34-0410-b5e6-
96231b3b80d8
Peter Collingbourne [Wed, 19 Nov 2014 03:34:20 +0000 (03:34 +0000)]
Teach llvm-build to avoid touching LibraryDependencies.inc unless the contents
change. This saves us from rebuilding llvm-config each time we reconfigure.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222308
91177308-0d34-0410-b5e6-
96231b3b80d8
Peter Collingbourne [Wed, 19 Nov 2014 03:34:17 +0000 (03:34 +0000)]
Expose LLVM version string via macro in llvm-config.h, and modify Go bindings
to make use of it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222307
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Wed, 19 Nov 2014 02:56:00 +0000 (02:56 +0000)]
Make StringSet::insert return pair<iterator, bool> like other self-associative containers
StringSet is still a bit dodgy in that it exposes the raw iterator of
the StringMap parent, which exposes the weird detail that StringSet
actually has a 'value'... but anyway, this is useful for a handful of
clients that want to reference the newly inserted/persistent string data
in the StringSet/Map/Entry/thing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222302
91177308-0d34-0410-b5e6-
96231b3b80d8
Rui Ueyama [Wed, 19 Nov 2014 02:07:10 +0000 (02:07 +0000)]
llvm-readobj: fix off-by-one error in COFFDumper
It printed out base relocation table header as table entry.
This patch also makes llvm-readobj to not skip ABSOLUTE entries
becuase it was confusing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222299
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 19 Nov 2014 01:02:22 +0000 (01:02 +0000)]
Use a memcpy so that type based alias analysis sees the change.
The other option would be to do something like
if (that.isSingleWord())
VAL = that.VAL;
else
pVal = that.pVal
This bug was causing 86TTI::getIntImmCost to be miscompiled in a LTO
bootstrap in stage2, causing the build of stage3 to fail.
LLVM is getting quiet good at exploiting this. Not sure if there is anything
a sanitizer could do to help
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222294
91177308-0d34-0410-b5e6-
96231b3b80d8
Weiming Zhao [Wed, 19 Nov 2014 00:29:14 +0000 (00:29 +0000)]
[Aarch64] Customer lowering of CTPOP to SIMD should check for NEON availability
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222292
91177308-0d34-0410-b5e6-
96231b3b80d8
Kostya Serebryany [Wed, 19 Nov 2014 00:22:58 +0000 (00:22 +0000)]
[asan] add experimental basic-block tracing to asan-coverage; also fix -fsanitize-coverage=3 which was broken by r221718
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222290
91177308-0d34-0410-b5e6-
96231b3b80d8
Rui Ueyama [Wed, 19 Nov 2014 00:18:07 +0000 (00:18 +0000)]
llvm-readobj: teach it how to dump COFF base relocation table
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222289
91177308-0d34-0410-b5e6-
96231b3b80d8
Kostya Serebryany [Wed, 19 Nov 2014 00:17:31 +0000 (00:17 +0000)]
Introduce llvm::SplitAllCriticalEdges
Summary:
move the code from BreakCriticalEdges::runOnFunction()
into a separate utility function llvm::SplitAllCriticalEdges()
so that it can be used independently.
No functionality change intended.
Test Plan: check-llvm
Reviewers: nlewycky
Reviewed By: nlewycky
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D6313
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222288
91177308-0d34-0410-b5e6-
96231b3b80d8
Manman Ren [Wed, 19 Nov 2014 00:13:26 +0000 (00:13 +0000)]
Revert r222039 because of bot failure.
http://lab.llvm.org:8080/green/job/clang-Rlto_master/298/
Hopefully, bot will be green. If not, we will re-submit the commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222287
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Wed, 19 Nov 2014 00:01:31 +0000 (00:01 +0000)]
R600/SI: Implement areMemAccessesTriviallyDisjoint
This partially makes up for not having address spaces
used for alias analysis in some simple cases.
This is not yet enabled by default so shouldn't change anything yet.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222286
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Tue, 18 Nov 2014 23:57:33 +0000 (23:57 +0000)]
R600/SI: Set hasSideEffects = 0 on load and store instructions.
Assuming unmodeled side effects interferes with some scheduling
opportunities.
Don't put it in the base class of DS instructions since there
are a few weird effecting, non load/store instructions there.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222285
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Tue, 18 Nov 2014 23:38:19 +0000 (23:38 +0000)]
[X86][AVX] 256-bit vector stack unaligned load/stores identification
Under many circumstances the stack is not 32-byte aligned, resulting in the use of the vmovups/vmovupd/vmovdqu instructions when inserting ymm reloads/spills.
This minor patch adds these instructions to the isFrameLoadOpcode/isFrameStoreOpcode helpers so that they can be correctly identified and not be treated as folded reloads/spills.
This has also been noticed by http://llvm.org/bugs/show_bug.cgi?id=18846 where it was causing redundant spills - I've added a reduced test case at test/CodeGen/X86/pr18846.ll
Differential Revision: http://reviews.llvm.org/D6252
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222281
91177308-0d34-0410-b5e6-
96231b3b80d8
Colin LeMahieu [Tue, 18 Nov 2014 22:45:47 +0000 (22:45 +0000)]
[Hexagon] Adding A2_and instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222274
91177308-0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Tue, 18 Nov 2014 22:41:49 +0000 (22:41 +0000)]
[FastISel][AArch64] Also allow folding of sign-/zero-extend and arithmetic
shift-right for booleans (i1).
Arithmetic shift-right immediate with sign-/zero-extensions also works for
boolean values. Update the assert and the test cases to reflect that fact.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222272
91177308-0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Tue, 18 Nov 2014 22:38:42 +0000 (22:38 +0000)]
[FastISel][AArch64] Also allow folding of sign-/zero-extend and logical
shift-right for booleans (i1).
Logical shift-right immediate with sign-/zero-extensions also works for boolean
values. Update the assert and the test cases to reflect that fact.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222270
91177308-0d34-0410-b5e6-
96231b3b80d8
Justin Bogner [Tue, 18 Nov 2014 22:17:30 +0000 (22:17 +0000)]
Fix an inaccurate comment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222267
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Tue, 18 Nov 2014 22:06:45 +0000 (22:06 +0000)]
InstCombine: Fix another infinite loop caused by visitFPTrunc
We would attempt to replace an frem's operand with the same operand.
This would cause InstCombine to think real work was done, causing
InstCombine to enter an infinite loop.
This fixes the second part of PR21576.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222265
91177308-0d34-0410-b5e6-
96231b3b80d8
Colin LeMahieu [Tue, 18 Nov 2014 21:51:51 +0000 (21:51 +0000)]
[Hexagon] Adding A2_sub instruction
Renaming test files.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222263
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Tue, 18 Nov 2014 21:30:02 +0000 (21:30 +0000)]
Revert "Revert r222040 because of bot failure."
This reverts commit r222203, reverting r222040 didn't end up turning the
bot green.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222261
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Fiselier [Tue, 18 Nov 2014 21:23:38 +0000 (21:23 +0000)]
Add support for LLVM_USE_SANITIZER=Thread
Summary: This will help in testing libc++ and libc++abi with tsan.
Reviewers: samsonov
Reviewed By: samsonov
Subscribers: samsonov, llvm-commits
Differential Revision: http://reviews.llvm.org/D6283
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222258
91177308-0d34-0410-b5e6-
96231b3b80d8
Juergen Ributzka [Tue, 18 Nov 2014 21:20:17 +0000 (21:20 +0000)]
[FastISel][AArch64] Follow-up fix for "Fix shift-immediate emission for "zero" shifts."
Shifts also perform sign-/zero-extends to larger types, which requires us to emit
an integer extend instead of a simple COPY.
Related to PR21594.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222257
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Tue, 18 Nov 2014 21:06:58 +0000 (21:06 +0000)]
R600/SI: Move SIFixSGPRCopies to inst selector passes
This should expose more of the actually used VALU
instructions to the machine optimization passes.
This also should help getting i1 handling into a better state.
For not entirly understood reasons, this fixes the split-scalar-i64-add.ll
test where a 64-bit add would only partially be moved to the VALU
resulting in use of undefined VCC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222256
91177308-0d34-0410-b5e6-
96231b3b80d8
Juergen Ributzka [Tue, 18 Nov 2014 21:02:40 +0000 (21:02 +0000)]
[AArch64] Don't optimize all compare instructions.
"optimizeCompareInstr" converts compares (cmp/cmn) into plain sub/add
instructions when the flags are not used anymore. This conversion is valid for
most instructions, but not all. Some instructions that don't set the flags
(e.g. sub with immediate) can set the SP, whereas the flag setting version uses
the same encoding for the "zero" register.
Update the code to also check for the return register before performing the
optimization to make sure that a cmp doesn't suddenly turn into a sub that sets
the stack pointer.
I don't have a test case for this, because it isn't easy to trigger.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222255
91177308-0d34-0410-b5e6-
96231b3b80d8
Owen Anderson [Tue, 18 Nov 2014 20:50:19 +0000 (20:50 +0000)]
Fix an incorrect chain operand when expanding INSERT_VECTOR operations through the stack.
Patch by Daniil Troshkov!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222254
91177308-0d34-0410-b5e6-
96231b3b80d8
Tom Stellard [Tue, 18 Nov 2014 20:39:39 +0000 (20:39 +0000)]
R600/SI: Make sure resource descriptors are always stored in SGPRs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222253
91177308-0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Tue, 18 Nov 2014 20:34:01 +0000 (20:34 +0000)]
[Reassociate] Use test cases that can actually be optimized to verify optional
flags are cleared. The reassociation pass was just reordering the leaf nodes
in the previous test cases.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222250
91177308-0d34-0410-b5e6-
96231b3b80d8
Colin LeMahieu [Tue, 18 Nov 2014 20:28:11 +0000 (20:28 +0000)]
[Hexagon] Converting from ADD_rr to A2_add which has encoding bits.
Adding test to show correct instruction selection and encoding.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222249
91177308-0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Tue, 18 Nov 2014 20:21:54 +0000 (20:21 +0000)]
[Reassociate] Rename local variable to not use same name as a member
variable. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222248
91177308-0d34-0410-b5e6-
96231b3b80d8
Juergen Ributzka [Tue, 18 Nov 2014 19:58:59 +0000 (19:58 +0000)]
[FastISel][AArch64] Fix shift-immediate emission for "zero" shifts.
This change emits a COPY for a shift-immediate with a "zero" shift value.
This fixes PR21594 where we emitted a shift instruction with an incorrect
immediate operand.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222247
91177308-0d34-0410-b5e6-
96231b3b80d8
Jozef Kolek [Tue, 18 Nov 2014 19:20:34 +0000 (19:20 +0000)]
Test commit to verify that commit access works.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222244
91177308-0d34-0410-b5e6-
96231b3b80d8
Philip Reames [Tue, 18 Nov 2014 17:46:32 +0000 (17:46 +0000)]
Tweak EarlyCSE to recognize series of dead stores
EarlyCSE is giving up on the current instruction immediately when it recognizes that the current instruction makes a previous store trivially dead. There's no reason to do this. Once the previous store has been deleted, it's perfectly legal to remember the value of the current store (for value forwarding) and the fact the store occurred (it could be dead too!).
Reviewed by: Hal
Differential Revision: http://reviews.llvm.org/D6301
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222241
91177308-0d34-0410-b5e6-
96231b3b80d8
Manman Ren [Tue, 18 Nov 2014 16:45:34 +0000 (16:45 +0000)]
Remove triple in testing case to recover an arm bot.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222239
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Tue, 18 Nov 2014 12:23:19 +0000 (12:23 +0000)]
CallGraphTest.cpp: Remove invalid tests. ++S might step over F if S == F.
MSVC Runtime detects "Assertion failed: vector iterator not incrementable"
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222233
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Tue, 18 Nov 2014 09:31:41 +0000 (09:31 +0000)]
InstCombine: Fold away tautological masked compares
It is impossible for (x & INT_MAX) == 0 && x == INT_MAX to ever be true.
While this sort of reasoning should normally live in InstSimplify,
the machinery that derives this result is not trivial to split out.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222230
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Tue, 18 Nov 2014 09:31:36 +0000 (09:31 +0000)]
InstCombine: Clean up foldLogOpOfMaskedICmps
No functional change intended.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222229
91177308-0d34-0410-b5e6-
96231b3b80d8
Justin Bogner [Tue, 18 Nov 2014 05:22:39 +0000 (05:22 +0000)]
docs: Modernize some examples in WritingAnLLVMPass
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222223
91177308-0d34-0410-b5e6-
96231b3b80d8
Justin Bogner [Tue, 18 Nov 2014 05:00:52 +0000 (05:00 +0000)]
docs: Fix a couple of typo-ish errors in WritingAnLLVMPass
- Make CallGraphSCCPass's paragraph about doFinalization refer to
runOnSCC instead of runOnFunction, since that's what it's about.
- Fix a reference in the FunctionPass paragraph.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222222
91177308-0d34-0410-b5e6-
96231b3b80d8
Frederic Riss [Tue, 18 Nov 2014 02:46:11 +0000 (02:46 +0000)]
Allow DwarfCompileUnit::constructImportedEntityDIE to instanciate a GlobalVariable DIE.
Usually global variables are in a retain list and instanciated before
any call to constructImportedEntityDIE is made. This isn't true for
forward declarations though.
The testcase for this change is generated by a clang patched to emit
such forward declarations (patch at http://reviews.llvm.org/D6173
which will land soon). The updated testcase tests more than just
global variables, it now tests every type of 'using' clause we
support.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222217
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Tue, 18 Nov 2014 02:45:28 +0000 (02:45 +0000)]
llvm-readobj: Don't print the Characteristics field as the Subsystem
We claimed that we were printing the Subystem field when we were
actually printing the Characteristics field.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222216
91177308-0d34-0410-b5e6-
96231b3b80d8
Hans Wennborg [Tue, 18 Nov 2014 02:37:11 +0000 (02:37 +0000)]
SimplifyCFG: Range'ify some for-loops. No functional change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222215
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Tue, 18 Nov 2014 02:20:58 +0000 (02:20 +0000)]
IndVarSimplify: Allow LFTR to fire more often
I added a pessimization in r217102 to prevent miscompiles when the
incremented induction variable was used in a comparison; it would be
poison.
Try to use the incremented induction variable more often when we can be
sure that the increment won't end in poison.
Differential Revision: http://reviews.llvm.org/D6222
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222213
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Tue, 18 Nov 2014 02:20:29 +0000 (02:20 +0000)]
IR: Sink MDNode::Hash down to GenericMDNode::Hash
Part of PR21532.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222212
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Tue, 18 Nov 2014 01:56:14 +0000 (01:56 +0000)]
IR: Move MDNode operands from the back to the front
Having the operands at the back prevents subclasses from safely adding
fields. Move them to the front.
Instead of replicating the custom `malloc()`, `free()` and `DestroyFlag`
logic that was there before, overload `new` and `delete`.
I added calls to a new `GenericMDNode::dropAllReferences()` in
`LLVMContextImpl::~LLVMContextImpl()`. There's a maze of callbacks
happening during teardown, and this resolves them before we enter
the destructors.
Part of PR21532.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222211
91177308-0d34-0410-b5e6-
96231b3b80d8