OSDN Git Service
Logan Chien [Fri, 30 May 2014 16:48:56 +0000 (16:48 +0000)]
Fix MIPS exception personality encoding.
For MIPS, we have to encode the personality routine with
an indirect pointer to absptr; otherwise, some link warning
warning will be raised, and the program might crash in some
early MIPS Android device.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209907
91177308-0d34-0410-b5e6-
96231b3b80d8
Tim Northover [Fri, 30 May 2014 16:01:29 +0000 (16:01 +0000)]
MachO: move test to ARM directory.
This test specifies an ARM triple, so it needs ARM as a registered
target.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209905
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Fri, 30 May 2014 15:54:32 +0000 (15:54 +0000)]
PR19753: Optimize comparisons with "ashr exact" of a constanst.
Patch by suyog sarda.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209903
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Fri, 30 May 2014 15:00:45 +0000 (15:00 +0000)]
[pr19636] Fix known bit computation in urem instruction with power of two.
Patch by Andrey Kuharev.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209902
91177308-0d34-0410-b5e6-
96231b3b80d8
Tim Northover [Fri, 30 May 2014 14:41:51 +0000 (14:41 +0000)]
SelectionDAG: skip barriers for unordered atomic operations
Unordered is strictly weaker than monotonic, so if the latter doesn't have any
barriers then the former certainly shouldn't.
rdar://problem/
16548260
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209901
91177308-0d34-0410-b5e6-
96231b3b80d8
Tim Northover [Fri, 30 May 2014 13:23:06 +0000 (13:23 +0000)]
ARM: use AAPCS-style prologues for embedded MachO.
Darwin prologues save their GPRs in two stages: a narrow push of r0-r7 & lr,
followed by a wide push of the remaining registers if there are any. AAPCS uses
a single push.w instruction.
It turns out that, on average, enough registers get pushed that code is smaller
in the AAPCS prologue, which is a nice property for M-class programmers. They
also have other options available for back-traces, so can hopefully deal with
the fact that FP & LR aren't adjacent in memory.
rdar://problem/
15909583
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209895
91177308-0d34-0410-b5e6-
96231b3b80d8
Tim Northover [Fri, 30 May 2014 13:22:59 +0000 (13:22 +0000)]
MachO: support N_INDR aliases in assembly files.
This makes LLVM create N_INDR aliases (to be resolved by the linker) when
appropriate.
rdar://problem/
15125513
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209894
91177308-0d34-0410-b5e6-
96231b3b80d8
Tim Northover [Fri, 30 May 2014 10:56:12 +0000 (10:56 +0000)]
AArch64 & ARM: disable generic test that relies on no CFG changes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209885
91177308-0d34-0410-b5e6-
96231b3b80d8
Tim Northover [Fri, 30 May 2014 10:09:59 +0000 (10:09 +0000)]
ARM & AArch64: make use of common cmpxchg idioms after expansion
The C and C++ semantics for compare_exchange require it to return a bool
indicating success. This gets mapped to LLVM IR which follows each cmpxchg with
an icmp of the value loaded against the desired value.
When lowered to ldxr/stxr loops, this extra comparison is redundant: its
results are implicit in the control-flow of the function.
This commit makes two changes: it replaces that icmp with appropriate PHI
nodes, and then makes sure earlyCSE is called after expansion to actually make
use of the opportunities revealed.
I've also added -{arm,aarch64}-enable-atomic-tidy options, so that
existing fragile tests aren't perturbed too much by the change. Many
of them either rely on undef/unreachable too pervasively to be
restored to something well-defined (particularly while making sure
they test the same obscure assert from many years ago), or depend on a
particular CFG shape, which is disrupted by SimplifyCFG.
rdar://problem/
16227836
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209883
91177308-0d34-0410-b5e6-
96231b3b80d8
Tim Northover [Fri, 30 May 2014 08:59:55 +0000 (08:59 +0000)]
AArch64 & ARM: remove undefined behaviour from some tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209880
91177308-0d34-0410-b5e6-
96231b3b80d8
Hao Liu [Fri, 30 May 2014 05:58:19 +0000 (05:58 +0000)]
Test cases named with dates is a legacy rule not used now. Rename several test cases.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209877
91177308-0d34-0410-b5e6-
96231b3b80d8
Karthik Bhat [Fri, 30 May 2014 04:31:24 +0000 (04:31 +0000)]
Allow vectorization of intrinsics such as powi,cttz and ctlz in Loop and SLP Vectorizer.
This patch adds support to vectorize intrinsics such as powi, cttz and ctlz in Vectorizer. These intrinsics are different from other
intrinsics as second argument to these function must be same in order to vectorize them and it should be represented as a scalar.
Review: http://reviews.llvm.org/D3851#inline-32769 and http://reviews.llvm.org/D3937#inline-32857
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209873
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Fri, 30 May 2014 03:50:06 +0000 (03:50 +0000)]
Add a trivial ArrayRef helper overload to the SelectionDAG interface.
I'm using this pretty frequently in a patch I'm working on and it seems
generally useful.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209872
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Trieu [Fri, 30 May 2014 03:15:17 +0000 (03:15 +0000)]
Remove use of comma operator.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209871
91177308-0d34-0410-b5e6-
96231b3b80d8
Nick Lewycky [Fri, 30 May 2014 02:31:27 +0000 (02:31 +0000)]
When analyzing params/args for readnone/readonly, don't forget to consider that a pointer argument may be passed through a callsite to the return, and that we may need to analyze it. Fixes a bug reported on llvm-dev: lists.cs.uiuc.edu/pipermail/llvmdev/2014-May/073098.html
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209870
91177308-0d34-0410-b5e6-
96231b3b80d8
Adam Nemet [Thu, 29 May 2014 23:52:53 +0000 (23:52 +0000)]
[X86] Move test from r209863 to CodeGen/X86
We should only run this if X86 is in the targets.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209866
91177308-0d34-0410-b5e6-
96231b3b80d8
Adam Nemet [Thu, 29 May 2014 23:35:36 +0000 (23:35 +0000)]
[X86] Remove AVX1 vbroadcast intrinsics
The corresponding CFE patch replaces these intrinsics with vector initializers
in avxintrin.h. This patch removes the LLVM intrinsics from the backend.
We now stop lowering at X86ISD::VBROADCAST custom node rather than lowering
that further to the intrinsics.
The patch only changes VBROADCASTS* and leaves VBROADCAST[FI]128 to continue
to use intrinsics. As explained in the CFE patch, the reason is that we
currently don't generate as good code for them without the intrinsics.
CodeGen/X86/avx-vbroadcast.ll already provides coverage for this change. It
checks that for a series of insertelements we generate the appropriate
vbroadcast instruction.
Also verified that there was no assembly change in the test-suite before and
after this patch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209864
91177308-0d34-0410-b5e6-
96231b3b80d8
Adam Nemet [Thu, 29 May 2014 23:35:33 +0000 (23:35 +0000)]
[X86] Auto-upgrade AVX1 vbroadcast intrinsics
They are replaced with the same IR that is generated for the
vector-initializers in avxintrin.h.
The test verifies that we get back the original instruction. I haven't seen
this approach to be used in other auto-upgrade tests (i.e. llc + FileCheck)
but I think it's the most direct way to test this case. I believe this should
work because llc upgrades calls during parsing. (Other tests mostly check
that assembling and disassembling yields the upgraded IR.)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209863
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Thu, 29 May 2014 23:21:12 +0000 (23:21 +0000)]
And fix my fix to sink down through the type at the right time. My
original fix would actually trigger the *exact* same crasher as the
original bug for a different reason. Awesomesauce.
Working on test cases now, but wanted to get bots healthier.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209860
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Thu, 29 May 2014 23:05:52 +0000 (23:05 +0000)]
Fix one bug in the latest incarnation of r209843 -- combining GEPs
across PHI nodes. The code was computing the Idxs from the 'GEP'
variable's indices when what it wanted was Op1's indices. This caused an
ASan heap-overflow for me that pin pointed the issue when Op1 had more
indices than GEP did. =] I'll let Louis add a specific test case for
this if he wants.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209857
91177308-0d34-0410-b5e6-
96231b3b80d8
Jeroen Ketema [Thu, 29 May 2014 22:23:22 +0000 (22:23 +0000)]
Sync list of targets with configure's reality
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209855
91177308-0d34-0410-b5e6-
96231b3b80d8
Arnold Schwaighofer [Thu, 29 May 2014 22:10:01 +0000 (22:10 +0000)]
LoopVectorizer: Add a check that the backedge taken count + 1 does not overflow
The loop vectorizer instantiates be-taken-count + 1 as the loop iteration count.
If this expression overflows the generated code was invalid.
In case of overflow the code now jumps to the scalar loop.
Fixes PR17288.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209854
91177308-0d34-0410-b5e6-
96231b3b80d8
Filipe Cabecinhas [Thu, 29 May 2014 22:04:42 +0000 (22:04 +0000)]
Added tests for shufflevector lowering to blend instrs.
These tests ensure that a change I will propose in clang works as
expected.
Summary:
Added tests for the generation of blend+immediate instructions from a
shufflevector.
These tests were proposed along with a patch that was dropped. I'm
committing the tests anyway to protect against possible regressions in
codegen.
Reviewers: nadav, bkramer
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D3600
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209853
91177308-0d34-0410-b5e6-
96231b3b80d8
Louis Gerbarg [Thu, 29 May 2014 20:29:47 +0000 (20:29 +0000)]
Add support for combining GEPs across PHI nodes
Currently LLVM will generally merge GEPs. This allows backends to use more
complex addressing modes. In some cases this is not happening because there
is PHI inbetween the two GEPs:
GEP1--\
|-->PHI1-->GEP3
GEP2--/
This patch checks to see if GEP1 and GEP2 are similiar enough that they can be
cloned (GEP12) in GEP3's BB, allowing GEP->GEP merging (GEP123):
GEP1--\ --\ --\
|-->PHI1-->GEP3 ==> |-->PHI2->GEP12->GEP3 == > |-->PHI2->GEP123
GEP2--/ --/ --/
This also breaks certain use chains that are preventing GEP->GEP merges that the
the existing instcombine would merge otherwise.
Tests included.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209843
91177308-0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Thu, 29 May 2014 19:59:58 +0000 (19:59 +0000)]
Update Credits.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209840
91177308-0d34-0410-b5e6-
96231b3b80d8
Sebastian Pop [Thu, 29 May 2014 19:44:09 +0000 (19:44 +0000)]
implement missing SCEVDivision case
without this case we would end on an infinite recursion: the remainder is zero,
so Numerator - Remainder is equal to Numerator and so we would recursively ask
for the division of Numerator by Denominator.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209838
91177308-0d34-0410-b5e6-
96231b3b80d8
Sebastian Pop [Thu, 29 May 2014 19:44:05 +0000 (19:44 +0000)]
fail to find dimensions when ElementSize is nullptr
when ScalarEvolution::getElementSize returns nullptr it is safe to early return
in ScalarEvolution::findArrayDimensions such that we avoid later problems when
we try to divide the terms by ElementSize.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209837
91177308-0d34-0410-b5e6-
96231b3b80d8
Alexey Samsonov [Thu, 29 May 2014 18:40:48 +0000 (18:40 +0000)]
Use range-based for loops in ASan, TSan and MSan
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209834
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Thu, 29 May 2014 17:12:05 +0000 (17:12 +0000)]
[ADT] Delete the Twine assignment operator
This makes it slightly harder to misuse Twines. It is still possible to
refer to destroyed temporaries with the regular constructors, though.
Patch by Marco Alesiani!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209832
91177308-0d34-0410-b5e6-
96231b3b80d8
Adrian Prantl [Thu, 29 May 2014 16:56:48 +0000 (16:56 +0000)]
Debug Info: Remove unused code. The MInsn of an _abstract_ variable is
never used again and updating the abstract variable for each inlined
instance of it was questionable in the first place.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209829
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 29 May 2014 16:16:12 +0000 (16:16 +0000)]
Rename alias variables to make it easier to add new tests to the file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209822
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 29 May 2014 15:41:38 +0000 (15:41 +0000)]
[PPC] Use alias symbols in address computation.
This seems to match what gcc does for ppc and what every other llvm
backend does.
This is a fixed version of r209638. The difference is to avoid any change
in behavior for functions. The logic for using constant pools for function
addresseses is spread over a few places and we have to keep them in sync.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209821
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 29 May 2014 15:13:23 +0000 (15:13 +0000)]
Add a test showing the ppc code sequence for getting a function pointer.
This would have found the miscompile in r209638.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209820
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 29 May 2014 14:39:16 +0000 (14:39 +0000)]
Revert "Revert "Revert "InstCombine: Improvement to check if signed addition overflows."""
This reverts commit r209776.
It was miscompiling llvm::SelectionDAGISel::MorphNode.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209817
91177308-0d34-0410-b5e6-
96231b3b80d8
Artyom Skrobov [Thu, 29 May 2014 11:34:50 +0000 (11:34 +0000)]
Restore getInvertedCondCode() from the phased-out backend, fixing disassembly for NV
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209803
91177308-0d34-0410-b5e6-
96231b3b80d8
Artyom Skrobov [Thu, 29 May 2014 11:26:15 +0000 (11:26 +0000)]
Add missing check when MatchInstructionImpl() reports failure
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209802
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Atanasyan [Thu, 29 May 2014 11:05:31 +0000 (11:05 +0000)]
[elf2yaml][ELF] Move Info field to the RelocationSection structure. This
field represents ELF section header sh_info field and does not have any
sense for regular sections. Its interpretation depends on section type.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209801
91177308-0d34-0410-b5e6-
96231b3b80d8
Hao Liu [Thu, 29 May 2014 09:21:23 +0000 (09:21 +0000)]
Rename a test case to contain correct date info.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209799
91177308-0d34-0410-b5e6-
96231b3b80d8
Hao Liu [Thu, 29 May 2014 09:19:07 +0000 (09:19 +0000)]
Fix an assertion failure caused by v1i64 in DAGCombiner Shrink.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209798
91177308-0d34-0410-b5e6-
96231b3b80d8
Dinesh Dwivedi [Thu, 29 May 2014 06:47:23 +0000 (06:47 +0000)]
LCSSA should be performed on the outermost affected loop while unrolling loop.
During loop-unroll, loop exits from the current loop may end up in in different
outer loop. This requires to re-form LCSSA recursively for one level down from
the outer most loop where loop exits are landed during unroll. This fixes PR18861.
Differential Revision: http://reviews.llvm.org/D2976
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209796
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael J. Spencer [Thu, 29 May 2014 02:05:37 +0000 (02:05 +0000)]
[LoadCombine] Missed a file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209792
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael J. Spencer [Thu, 29 May 2014 01:55:07 +0000 (01:55 +0000)]
Add LoadCombine pass.
This pass is disabled by default. Use -combine-loads to enable in -O[1-3]
Differential revision: http://reviews.llvm.org/D3580
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209791
91177308-0d34-0410-b5e6-
96231b3b80d8
Alexey Samsonov [Thu, 29 May 2014 01:44:13 +0000 (01:44 +0000)]
[ASan] Hoist blacklisting globals from init-order checking to Clang.
Clang knows about the sanitizer blacklist and it makes no sense to
add global to the list of llvm.asan.dynamically_initialized_globals if it
will be blacklisted in the instrumentation pass anyway. Instead, we should
do as much blacklisting as possible (if not all) in the frontend.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209790
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael J. Spencer [Thu, 29 May 2014 01:42:45 +0000 (01:42 +0000)]
[x86] Fold extract_vector_elt of a load into the Load's address computation.
An address only use of an extract element of a load can be simplified to a
load. Without this the result of the extract element is spilled to the
stack so that an address is available.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209788
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Thu, 29 May 2014 01:18:01 +0000 (01:18 +0000)]
R600/SI: Fix pattern variable names.
These are confusing enough since the order swaps,
so give them more useful names.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209787
91177308-0d34-0410-b5e6-
96231b3b80d8
Alexey Samsonov [Thu, 29 May 2014 01:10:14 +0000 (01:10 +0000)]
Fix typo in variable name
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209784
91177308-0d34-0410-b5e6-
96231b3b80d8
Alexey Samsonov [Thu, 29 May 2014 00:51:15 +0000 (00:51 +0000)]
[ASan] Use llvm.global_ctors to insert init-order checking calls into ASan runtime.
Don't assume that dynamically initialized globals are all initialized from
_GLOBAL__<module_name>I_ function. Instead, scan the llvm.global_ctors and
insert poison/unpoison calls to each function there.
Patch by Nico Weber!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209780
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Wed, 28 May 2014 22:49:12 +0000 (22:49 +0000)]
Add a simple helper function to create a 64-bit integer.
Add a function to combine two 32-bit integers into a 64-bit integer.
There are no calls to this function yet, although a subsequent change
will add some in LLDB.
Reviewers: rnk
Differential Revision: http://reviews.llvm.org/D3941
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209777
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 28 May 2014 21:43:52 +0000 (21:43 +0000)]
Revert "Revert "InstCombine: Improvement to check if signed addition overflows.""
This reverts commit r209762, bringing back r209746. It was not responsible for the libc++ build failure
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209776
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 28 May 2014 21:41:21 +0000 (21:41 +0000)]
Revert "Add support for combining GEPs across PHI nodes"
This reverts commit r209755.
it was the real cause of the libc++ build failure.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209775
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Wed, 28 May 2014 20:51:42 +0000 (20:51 +0000)]
Fix wrong setcc result type when legalizing uaddo/usubo
No test because no in-tree targets change the bitwidth of the
setcc type depending on the bitwidth of the compared type.
Patch by Ke Bai
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209771
91177308-0d34-0410-b5e6-
96231b3b80d8
Jim Grosbach [Wed, 28 May 2014 20:31:52 +0000 (20:31 +0000)]
Update CREDITS to be at least moderately more current.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209770
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Wed, 28 May 2014 20:07:37 +0000 (20:07 +0000)]
fixed a few typos
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209768
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Wed, 28 May 2014 19:03:33 +0000 (19:03 +0000)]
test check-in: added missing parenthesis in comment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209763
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 28 May 2014 18:48:10 +0000 (18:48 +0000)]
Revert "InstCombine: Improvement to check if signed addition overflows."
This reverts commit r209746.
It looks it is causing a crash while building libcxx. I am trying to get a
reduced testcase.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209762
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Wed, 28 May 2014 18:19:55 +0000 (18:19 +0000)]
Fix standard integer definitions for MSVC in DataTypes.h
Previously, DataTypes.h would #define a variety of symbols any time
they weren't already defined. However, some versions of Visual
Studio do provide the appropriate headers, so if those headers are
included after DataTypes.h, it can lead to macro redefinition
warnings.
The fix is to include the appropriate headers if they exist, and
only #define the symbols if the required header does not exist.
Patch by Zachary Turner!
---
The big change here is that we no longer have our own stdint.h
typedefs because now all supported toolchains have stdint.h.
Hooray!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209760
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 28 May 2014 18:15:43 +0000 (18:15 +0000)]
[pr19844] Add thread local mode to aliases.
This matches gcc's behavior. It also seems natural given that aliases
contain other properties that govern how it is accessed (linkage,
visibility, dll storage).
Clang still has to be updated to expose this feature to C.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209759
91177308-0d34-0410-b5e6-
96231b3b80d8
Louis Gerbarg [Wed, 28 May 2014 17:38:31 +0000 (17:38 +0000)]
Add support for combining GEPs across PHI nodes
Currently LLVM will generally merge GEPs. This allows backends to use more
complex addressing modes. In some cases this is not happening because there
is PHI inbetween the two GEPs:
GEP1--\
|-->PHI1-->GEP3
GEP2--/
This patch checks to see if GEP1 and GEP2 are similiar enough that they can be
cloned (GEP12) in GEP3's BB, allowing GEP->GEP merging (GEP123):
GEP1--\ --\ --\
|-->PHI1-->GEP3 ==> |-->PHI2->GEP12->GEP3 == > |-->PHI2->GEP123
GEP2--/ --/ --/
This also breaks certain use chains that are preventing GEP->GEP merges that the
the existing instcombine would merge otherwise.
Tests included.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209755
91177308-0d34-0410-b5e6-
96231b3b80d8
Hal Finkel [Wed, 28 May 2014 15:33:19 +0000 (15:33 +0000)]
Revert "[DAGCombiner] Split up an indexed load if only the base pointer value is live"
This reverts r208640 (I've just XFAILed the test) because it broke ppc64/Linux
self-hosting. Because nearly every regression test triggers a segfault, I hope
this will be easy to fix.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209747
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 28 May 2014 15:30:40 +0000 (15:30 +0000)]
InstCombine: Improvement to check if signed addition overflows.
This patch implements two things:
1. If we know one number is positive and another is negative, we return true as
signed addition of two opposite signed numbers will never overflow.
2. Implemented TODO : If one of the operands only has one non-zero bit, and if
the other operand has a known-zero bit in a more significant place than it
(not including the sign bit) the ripple may go up to and fill the zero, but
won't change the sign. e.x - (x & ~4) + 1
We make sure that we are ignoring 0 at MSB.
Patch by Suyog Sarda.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209746
91177308-0d34-0410-b5e6-
96231b3b80d8
Hal Finkel [Wed, 28 May 2014 15:25:06 +0000 (15:25 +0000)]
Revert "[PPC] Use alias symbols in address computation."
This reverts commit r209638 because it broke self-hosting on ppc64/Linux. (the
Clang-compiled TableGen would segfault because it jumped to an invalid address
from within _ZNK4llvm17ManagedStaticBase21RegisterManagedStaticEPFPvvEPFvS1_E
(which is within the command-line parameter registration process)).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209745
91177308-0d34-0410-b5e6-
96231b3b80d8
Joerg Sonnenberger [Wed, 28 May 2014 15:12:55 +0000 (15:12 +0000)]
Don't hard-code ld when extracting host linker version, use ${LD} if
it is set.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209742
91177308-0d34-0410-b5e6-
96231b3b80d8
Evgeniy Stepanov [Wed, 28 May 2014 09:26:46 +0000 (09:26 +0000)]
[asancov] Don't emit extra runtime calls when compiling without coverage.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209721
91177308-0d34-0410-b5e6-
96231b3b80d8
Tilmann Scheller [Wed, 28 May 2014 06:43:00 +0000 (06:43 +0000)]
[AArch64] Add store post-index update folding regression tests for the load/store optimizer.
Add regression tests for the following transformation:
str X, [x20]
...
add x20, x20, #32
->
str X, [x20], #32
with X being either w0, x0, s0, d0 or q0.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209715
91177308-0d34-0410-b5e6-
96231b3b80d8
Justin Bogner [Wed, 28 May 2014 05:45:17 +0000 (05:45 +0000)]
utils: Teach lldbDataFormatters to load automatically
Add an __lldb_init_module function so that importing the
lldbDataFormatters script automatically adds the formatters.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209712
91177308-0d34-0410-b5e6-
96231b3b80d8
Tilmann Scheller [Wed, 28 May 2014 05:44:14 +0000 (05:44 +0000)]
[AArch64] Add load post-index update folding regression tests for the load/store optimizer.
Add regression tests for the following transformation:
ldr X, [x20]
...
add x20, x20, #32
->
ldr X, [x20], #32
with X being either w0, x0, s0, d0 or q0.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209711
91177308-0d34-0410-b5e6-
96231b3b80d8
Alexey Samsonov [Tue, 27 May 2014 23:09:50 +0000 (23:09 +0000)]
Change representation of instruction ranges where variable is accessible.
Use more straightforward way to represent the set of instruction
ranges where the location of a user variable is defined - vector of pairs
of instructions (defining start/end of each range),
instead of a flattened vector of instructions where some instructions
are supposed to start the range, and the rest are supposed to "clobber" it.
Simplify the code which generates actual .debug_loc entries.
No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209698
91177308-0d34-0410-b5e6-
96231b3b80d8
Alexey Samsonov [Tue, 27 May 2014 22:47:41 +0000 (22:47 +0000)]
Factor out looking for prologue end into a function
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209697
91177308-0d34-0410-b5e6-
96231b3b80d8
Sebastian Pop [Tue, 27 May 2014 22:42:00 +0000 (22:42 +0000)]
avoid type mismatch when building SCEVs
This is a corner case I have stumbled upon when dealing with ARM64 type
conversions. I was not able to extract a testcase for the community codebase to
fail on. The patch conservatively discards a division that would have ended up
in an ICE due to a type mismatch when building a multiply expression. I have
also added code to a place that builds add expressions and in which we should be
careful not to pass in operands of different types.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209694
91177308-0d34-0410-b5e6-
96231b3b80d8
Sebastian Pop [Tue, 27 May 2014 22:41:56 +0000 (22:41 +0000)]
do not use the GCD to compute the delinearization strides
We do not need to compute the GCD anymore after we removed the constant
coefficients from the terms: the terms are now all parametric expressions and
there is no need to recognize constant terms that divide only a subset of the
terms. We only rely on the size of the terms, i.e., the number of operands in
the multiply expressions, to sort the terms and recognize the parametric
dimensions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209693
91177308-0d34-0410-b5e6-
96231b3b80d8
Sebastian Pop [Tue, 27 May 2014 22:41:51 +0000 (22:41 +0000)]
remove BasePointer before delinearizing
No functional change is intended: instead of relying on the delinearization to
come up with the base pointer as a remainder of the divisions in the
delinearization, we just compute it from the array access and use that value.
We substract the base pointer from the SCEV to be delinearized and that
simplifies the work of the delinearizer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209692
91177308-0d34-0410-b5e6-
96231b3b80d8
Sebastian Pop [Tue, 27 May 2014 22:41:45 +0000 (22:41 +0000)]
remove constant terms
The delinearization is needed only to remove the non linearity induced by
expressions involving multiplications of parameters and induction variables.
There is no problem in dealing with constant times parameters, or constant times
an induction variable.
For this reason, the current patch discards all constant terms and multipliers
before running the delinearization algorithm on the terms. The only thing
remaining in the term expressions are parameters and multiply expressions of
parameters: these simplified term expressions are passed to the array shape
recognizer that will not recognize constant dimensions anymore: these will be
recognized as different strides in parametric subscripts.
The only important special case of a constant dimension is the size of elements.
Instead of relying on the delinearization to infer the size of an element,
compute the element size from the base address type. This is a much more precise
way of computing the element size than before, as we would have mixed together
the size of an element with the strides of the innermost dimension.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209691
91177308-0d34-0410-b5e6-
96231b3b80d8
Alexey Samsonov [Tue, 27 May 2014 22:35:00 +0000 (22:35 +0000)]
Don't pre-populate the set of keys in the map with variable locations history.
Current implementation of calculateDbgValueHistory already creates the
keys in the expected order (user variables are listed in order of appearance),
and should do so later by contract.
No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209690
91177308-0d34-0410-b5e6-
96231b3b80d8
Arnaud A. de Grandmaison [Tue, 27 May 2014 22:03:28 +0000 (22:03 +0000)]
No need for those tests to go thru llvm-as and/or llvm-dis.
opt can handle them by itself.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209689
91177308-0d34-0410-b5e6-
96231b3b80d8
Arnaud A. de Grandmaison [Tue, 27 May 2014 21:35:46 +0000 (21:35 +0000)]
Factor out comparison of Instruction "special" states.
No functional change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209688
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Tue, 27 May 2014 21:35:17 +0000 (21:35 +0000)]
Wording fix for llvm.global_dtors docs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209687
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Tue, 27 May 2014 20:20:43 +0000 (20:20 +0000)]
DebugInfo: partially revert cleanup committed in r209680
I'm not sure exactly where/how we end up with an abstract DbgVariable
with a null DIE, but we do... looking into it & will add a test and/or
fix when I figure it out.
Currently shows up in selfhost or compiler-rt builds.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209683
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Tue, 27 May 2014 19:34:32 +0000 (19:34 +0000)]
DebugInfo: Simplify solution to avoid DW_AT_artificial on inlined parameters.
Originally committed in r207717, I clearly didn't look very closely at
the code to understand how existing things were working...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209680
91177308-0d34-0410-b5e6-
96231b3b80d8
Sasa Stankovic [Tue, 27 May 2014 18:53:06 +0000 (18:53 +0000)]
[mips] Optimize long branch for MIPS64 by removing %higher and %highest.
%higher and %highest can have non-zero values only for offsets greater
than 2GB, which is highly unlikely, if not impossible when compiling a
single function. This makes long branch for MIPS64 3 instructions smaller.
Differential Revision: http://llvm-reviews.chandlerc.com/D3281.diff
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209678
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Tue, 27 May 2014 18:37:55 +0000 (18:37 +0000)]
DebugInfo: Create abstract function definitions even when concrete definitions preceed inline definitions.
After much puppetry, here's the major piece of the work to ensure that
even when a concrete definition preceeds all inline definitions, an
abstract definition is still created and referenced from both concrete
and inline definitions.
Variables are still broken in this case (see comment in
dbg-value-inlined-parameter.ll test case) and will be addressed in
follow up work.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209677
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Tue, 27 May 2014 18:37:51 +0000 (18:37 +0000)]
DebugInfo: Avoid an extra map lookup when finding abstract subprogram DIEs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209676
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Tue, 27 May 2014 18:37:48 +0000 (18:37 +0000)]
DebugInfo: Lazily construct subprogram definition DIEs.
A further step to correctly emitting concrete out of line definitions
preceeding inlined instances of the same program.
To do this, emission of subprograms must be delayed until required since
we don't know which (abstract only (if there's no out of line
definition), concrete only (if there are no inlined instances), or both)
DIEs are required at the start of the module.
To reduce the test churn in the following commit that actually fixes the
bug, this commit introduces the lazy DIE construction and cleans up test
cases that are impacted by the changes in the resulting DIE ordering.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209675
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Tue, 27 May 2014 18:37:43 +0000 (18:37 +0000)]
DebugInfo: Lazily attach definition attributes to definitions.
This is a precursor to fixing inlined debug info where the concrete,
out-of-line definition may preceed any inlined usage. To cope with this,
the attributes that may appear on the concrete definition or the
abstract definition are delayed until the end of the module. Then, if an
abstract definition was created, it is referenced (and no other
attributes are added to the out-of-line definition), otherwise the
attributes are added directly to the out-of-line definition.
In a couple of cases this causes not just reordering of attributes, but
reordering of types. When the creation of the attribute is delayed, if
that creation would create a type (such as for a DW_AT_type attribute)
then other top level DIEs may've been constructed during the delay,
causing the referenced type to be created and added after those
intervening DIEs. In the extreme case, in cross-cu-inlining.ll, this
actually causes the DW_TAG_basic_type for "int" to move from one CU to
another.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209674
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Tue, 27 May 2014 18:37:38 +0000 (18:37 +0000)]
DebugInfo: Separate out the addition of subprogram attribute additions so that they can be added later depending on whether or not the function is inlined.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209673
91177308-0d34-0410-b5e6-
96231b3b80d8
Jingyue Wu [Tue, 27 May 2014 18:12:55 +0000 (18:12 +0000)]
Fixed a test in r209670
The test was outdated with r209537.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209671
91177308-0d34-0410-b5e6-
96231b3b80d8
Jingyue Wu [Tue, 27 May 2014 18:00:00 +0000 (18:00 +0000)]
Distribute sext/zext to the operands of and/or/xor
This is an enhancement to SeparateConstOffsetFromGEP. With this patch, we can
extract a constant offset from "s/zext and/or/xor A, B".
Added a new test @ext_or to verify this enhancement.
Refactoring the code, I also extracted some common logic to function
Distributable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209670
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Tue, 27 May 2014 17:57:14 +0000 (17:57 +0000)]
DebugInfo: Fix argument ordering in test by adding argument numbering.
This old test didn't have the argument numbering that's now squirelled
away in the high bits of the line number in the DW_TAG_arg_variable
metadata.
Add the numbering and update the test to ensure arguments are in-order.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209669
91177308-0d34-0410-b5e6-
96231b3b80d8
Filipe Cabecinhas [Tue, 27 May 2014 16:54:33 +0000 (16:54 +0000)]
Post-commit fixes for r209643
Detected by Daniel Jasper, Ilia Filippov, and Andrea Di Biagio
Fixed the argument order to select (the mask semantics to blendv* are the
inverse of select) and fixed the tests
Added parenthesis to the assert condition
Ran clang-format
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209667
91177308-0d34-0410-b5e6-
96231b3b80d8
Tim Northover [Tue, 27 May 2014 16:50:09 +0000 (16:50 +0000)]
AArch64: add test for NZCV cross-copy save.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209665
91177308-0d34-0410-b5e6-
96231b3b80d8
Tim Northover [Tue, 27 May 2014 16:50:03 +0000 (16:50 +0000)]
AArch64: add AArch64-specific test for 'c' and 'n'.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209664
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Schmidt [Tue, 27 May 2014 15:57:51 +0000 (15:57 +0000)]
[PATCH] Correct type used for VADD_SPLAT optimization on PowerPC
In PPCISelLowering.cpp: PPCTargetLowering::LowerBUILD_VECTOR(), there
is an optimization for certain patterns to generate one or two vector
splats followed by a vector add or subtract. This operation is
represented by a VADD_SPLAT in the selection DAG. Prior to this
patch, it was possible for the VADD_SPLAT to be assigned the wrong
data type, causing incorrect code generation. This patch corrects the
problem.
Specifically, the code previously assigned the value type of the
BUILD_VECTOR node to the newly generated VADD_SPLAT node. This is
correct much of the time, but not always. The problem is that the
call to isConstantSplat() may return a SplatBitSize that is not the
same as the number of bits in the original element vector type. The
correct type to assign is a vector type with the same element bit size
as SplatBitSize.
The included test case shows an example of this, where the
BUILD_VECTOR node has a type of v16i8. The vector to be built is {0,
16, 0, 16, 0, 16, 0, 16, 0, 16, 0, 16, 0, 16, 0, 16}. isConstantSplat
detects that we can generate a splat of 16 for type v8i16, which is
the type we must assign to the VADD_SPLAT node. If we do not, we
generate a vspltisb of 8 and a vaddubm, which generates the incorrect
result {16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
16}. The correct code generation is a vspltish of 8 and a vadduhm.
This patch also corrected code generation for
CodeGen/PowerPC/2008-07-10-SplatMiscompile.ll, which had been marked
as an XFAIL, so we can remove the XFAIL from the test case.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209662
91177308-0d34-0410-b5e6-
96231b3b80d8
Zoran Jovanovic [Tue, 27 May 2014 14:58:51 +0000 (14:58 +0000)]
[mips][mips64r6] Add Relocations R_MIPS_PCHI16, R_MIPS_PCLO16
Differential Revision: http://reviews.llvm.org/D3860
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209659
91177308-0d34-0410-b5e6-
96231b3b80d8
Amara Emerson [Tue, 27 May 2014 13:30:21 +0000 (13:30 +0000)]
[ARM] Emit correct build attributes for the relocation models.
Patch by Asiri Rathnayake.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209656
91177308-0d34-0410-b5e6-
96231b3b80d8
Zoran Jovanovic [Tue, 27 May 2014 12:55:40 +0000 (12:55 +0000)]
[mips][mips64r6] Add relocations R_MIPS_PC21_S2, R_MIPS_PC26_S2
Differential Revision: http://reviews.llvm.org/D3824
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209655
91177308-0d34-0410-b5e6-
96231b3b80d8
Evgeniy Stepanov [Tue, 27 May 2014 12:39:31 +0000 (12:39 +0000)]
[asancov] Emit an initializer passing number of coverage code locations in each module.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209654
91177308-0d34-0410-b5e6-
96231b3b80d8
Tim Northover [Tue, 27 May 2014 12:16:02 +0000 (12:16 +0000)]
AArch64: implement copies to/from NZCV as a last ditch effort.
A test in test/Generic creates a DAG where the NZCV output of an ADCS is used
by multiple nodes. This makes LLVM want to save a copy of NZCV for later, which
it couldn't do before.
This should be the last fix required for the aarch64 buildbot.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209651
91177308-0d34-0410-b5e6-
96231b3b80d8
Tim Northover [Tue, 27 May 2014 10:43:38 +0000 (10:43 +0000)]
ARM: teach AAPCS-VFP to deal with Cortex-M4.
Cortex-M4 only has single-precision floating point support, so any LLVM
"double" type will have been split into 2 i32s by now. Fortunately, the
consecutive-register framework turns out to be precisely what's needed to
reconstruct the double and follow AAPCS-VFP correctly!
rdar://problem/
17012966
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209650
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Jasper [Tue, 27 May 2014 09:55:37 +0000 (09:55 +0000)]
Fix bad assert.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209648
91177308-0d34-0410-b5e6-
96231b3b80d8
Tim Northover [Tue, 27 May 2014 07:37:21 +0000 (07:37 +0000)]
AArch64: support 'c' and 'n' inline asm modifiers.
These are tested by test/CodeGen/Generic, so we should probably know
how to deal with them. Fortunately generic code does it if asked.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209646
91177308-0d34-0410-b5e6-
96231b3b80d8
Dinesh Dwivedi [Tue, 27 May 2014 06:44:25 +0000 (06:44 +0000)]
Adding testcase for PR18886.
Differential Revision: http://reviews.llvm.org/D3837
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209645
91177308-0d34-0410-b5e6-
96231b3b80d8