OSDN Git Service
Nadav Rotem [Sun, 30 Sep 2012 07:17:56 +0000 (07:17 +0000)]
Revert r164910 because it causes failures to several phase2 builds.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164911
91177308-0d34-0410-b5e6-
96231b3b80d8
Nadav Rotem [Sun, 30 Sep 2012 06:24:14 +0000 (06:24 +0000)]
A DAGCombine optimization for merging consecutive stores. This optimization is not profitable in many cases
because moden processos can store multiple values in parallel, and preparing the consecutive store requires
some work. We only handle these cases:
1. Consecutive stores where the values and consecutive loads. For example:
int a = p->a;
int b = p->b;
q->a = a;
q->b = b;
2. Consecutive stores where the values are constants. Foe example:
q->a = 4;
q->b = 5;
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164910
91177308-0d34-0410-b5e6-
96231b3b80d8
Bob Wilson [Sat, 29 Sep 2012 21:43:49 +0000 (21:43 +0000)]
Add LLVM support for Swift.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164899
91177308-0d34-0410-b5e6-
96231b3b80d8
Bob Wilson [Sat, 29 Sep 2012 21:27:31 +0000 (21:27 +0000)]
Whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164898
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Sat, 29 Sep 2012 19:57:14 +0000 (19:57 +0000)]
Shrink TargetAlignElem a bit, we do a lot of searches on them.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164897
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Sat, 29 Sep 2012 10:41:21 +0000 (10:41 +0000)]
Fix a somewhat surprising miscompile where code relying on an ABI
alignment could lose it due to the alloca type moving down to a much
smaller alignment guarantee.
Now SROA will actively compute a proper alignment, factoring the target
data, any explicit alignment, and the offset within the struct. This
will in some cases lower the alignment requirements, but when we lower
them below those of the type, we drop the alignment entirely to give
freedom to the code generator to align it however is convenient.
Thanks to Duncan for the lovely test case that pinned this down. =]
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164891
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan Sands [Sat, 29 Sep 2012 10:25:35 +0000 (10:25 +0000)]
Speculatively revert commit 164885 (nadav) in the hope of ressurecting a pile of
buildbots. Original commit message:
A DAGCombine optimization for merging consecutive stores. This optimization is not profitable in many cases
because moden processos can store multiple values in parallel, and preparing the consecutive store requires
some work. We only handle these cases:
1. Consecutive stores where the values and consecutive loads. For example:
int a = p->a;
int b = p->b;
q->a = a;
q->b = b;
2. Consecutive stores where the values are constants. Foe example:
q->a = 4;
q->b = 5;
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164890
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sat, 29 Sep 2012 07:18:53 +0000 (07:18 +0000)]
Tidy up to match coding standards. Remove 'else' after 'return' and moving operators to end of preceding line. No functional change intended.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164887
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sat, 29 Sep 2012 06:54:22 +0000 (06:54 +0000)]
Replace a couple if/elses around similar calls with conditional operators on the varying arguments. No functional change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164886
91177308-0d34-0410-b5e6-
96231b3b80d8
Nadav Rotem [Sat, 29 Sep 2012 06:33:25 +0000 (06:33 +0000)]
A DAGCombine optimization for merging consecutive stores. This optimization is not profitable in many cases
because moden processos can store multiple values in parallel, and preparing the consecutive store requires
some work. We only handle these cases:
1. Consecutive stores where the values and consecutive loads. For example:
int a = p->a;
int b = p->b;
q->a = a;
q->b = b;
2. Consecutive stores where the values are constants. Foe example:
q->a = 4;
q->b = 5;
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164885
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sat, 29 Sep 2012 02:25:34 +0000 (02:25 +0000)]
Remove more LLVM_DELETED_FUNCTIONs from destructors to fix -std=c++11 build on gcc 4.7.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164880
91177308-0d34-0410-b5e6-
96231b3b80d8
Evan Cheng [Sat, 29 Sep 2012 00:12:08 +0000 (00:12 +0000)]
Add test case for r164850.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164867
91177308-0d34-0410-b5e6-
96231b3b80d8
Evan Cheng [Fri, 28 Sep 2012 23:58:57 +0000 (23:58 +0000)]
Do not delete BBs if their addresses are taken. rdar://
12396696
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164866
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Fri, 28 Sep 2012 22:30:18 +0000 (22:30 +0000)]
Don't use bit-wise operations to query for inclusion/exclusion of attributes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164860
91177308-0d34-0410-b5e6-
96231b3b80d8
Evan Cheng [Fri, 28 Sep 2012 21:23:26 +0000 (21:23 +0000)]
GlobalDCE should be run at -O2 / -Os to eliminate unused dtor, etc. rdar://
9142819
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164850
91177308-0d34-0410-b5e6-
96231b3b80d8
Akira Hatanaka [Fri, 28 Sep 2012 21:23:16 +0000 (21:23 +0000)]
MIPS DSP: add operands to make sure instruction strings are being matched.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164849
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Fri, 28 Sep 2012 21:22:24 +0000 (21:22 +0000)]
Remove unused methods.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164848
91177308-0d34-0410-b5e6-
96231b3b80d8
Sean Silva [Fri, 28 Sep 2012 21:18:37 +0000 (21:18 +0000)]
docs: dedent list on index.rst
In reStructuredText, indented blocks denote block quotes [1]. This list
is not a block quote.
[1]. http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#block-quotes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164847
91177308-0d34-0410-b5e6-
96231b3b80d8
Akira Hatanaka [Fri, 28 Sep 2012 20:50:31 +0000 (20:50 +0000)]
MIPS DSP: other miscellaneous instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164845
91177308-0d34-0410-b5e6-
96231b3b80d8
Manman Ren [Fri, 28 Sep 2012 20:26:33 +0000 (20:26 +0000)]
Testcase for r164835
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164842
91177308-0d34-0410-b5e6-
96231b3b80d8
Akira Hatanaka [Fri, 28 Sep 2012 20:16:04 +0000 (20:16 +0000)]
MIPS DSP: ADDUH.QB instruction sub-class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164840
91177308-0d34-0410-b5e6-
96231b3b80d8
Manman Ren [Fri, 28 Sep 2012 18:53:24 +0000 (18:53 +0000)]
X86: when replacing SUB with TEST in ISelDAGToDAG, only replace uses of the
second output of SUB with first output of TEST.
PR13966
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164835
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Kaylor [Fri, 28 Sep 2012 17:35:20 +0000 (17:35 +0000)]
Removing dependency on third party library for Intel JIT event support.
Patch committed on behalf of Kirill Uhanov
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164831
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Fri, 28 Sep 2012 16:40:29 +0000 (16:40 +0000)]
PackedVector: Make the BitVector implementation configurable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164826
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Fri, 28 Sep 2012 15:36:41 +0000 (15:36 +0000)]
Provide malloc-free sentinels for the SparseBitVector internals.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164823
91177308-0d34-0410-b5e6-
96231b3b80d8
Dmitri Gribenko [Fri, 28 Sep 2012 14:15:28 +0000 (14:15 +0000)]
Replace the use of strncpy() and sprintf() with std::string and LLVM streams.
Patch by Martinez, Javier E.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164822
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Fri, 28 Sep 2012 10:42:50 +0000 (10:42 +0000)]
CorrelatedPropagation: BasicBlock::removePredecessor can simplify PHI nodes. If the it's the condition of a SwitchInst, reload it.
Fixes PR13972.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164818
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Fri, 28 Sep 2012 10:10:46 +0000 (10:10 +0000)]
Make backtraces work again with both the configure and cmake build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164817
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Fri, 28 Sep 2012 10:01:27 +0000 (10:01 +0000)]
GlobalOpt: non-constexpr bitcasts or GEPs can occur even if the global value is only stored once.
Fixes PR13968.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164815
91177308-0d34-0410-b5e6-
96231b3b80d8
Nick Lewycky [Fri, 28 Sep 2012 09:33:53 +0000 (09:33 +0000)]
Surprisingly, we missed a trivial case here. Fix that!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164814
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Fri, 28 Sep 2012 07:17:01 +0000 (07:17 +0000)]
Remove a LLVM_DELETED_FUNCTION from destructor to fix -std=c++11 build on gcc 4.7.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164813
91177308-0d34-0410-b5e6-
96231b3b80d8
Reed Kotler [Fri, 28 Sep 2012 02:26:24 +0000 (02:26 +0000)]
1. Add load/store words from the stack
2. As part of this, added assembly format FEXT_RI16_SP_explicit_ins and
moved other lines for FEXT_RI16 formats to be in the right place in the code.
3. Added mayLoad and mayStore assignements for the load/store instructions added and for ones already there that did not have this assignment.
4. Another patch will deal with the problem of load/store byte/halfword to the stack. This is a particular Mips16 problem.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164811
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Thu, 27 Sep 2012 23:31:32 +0000 (23:31 +0000)]
Remove <def,read-undef> flags from partial redefinitions.
The new coalescer can turn a full virtual register definition into a
partial redef by merging another value into an unused vector lane.
Make sure to clear the <read-undef> flag on such defs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164807
91177308-0d34-0410-b5e6-
96231b3b80d8
Micah Villmow [Thu, 27 Sep 2012 22:14:10 +0000 (22:14 +0000)]
Fix more crlf issues.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164805
91177308-0d34-0410-b5e6-
96231b3b80d8
Meador Inge [Thu, 27 Sep 2012 21:21:31 +0000 (21:21 +0000)]
instcombine: Add more test cases for __strncpy_chk simplification
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164800
91177308-0d34-0410-b5e6-
96231b3b80d8
Meador Inge [Thu, 27 Sep 2012 21:21:28 +0000 (21:21 +0000)]
instcombine: Add more test cases for __strcpy_chk simplification
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164799
91177308-0d34-0410-b5e6-
96231b3b80d8
Meador Inge [Thu, 27 Sep 2012 21:21:25 +0000 (21:21 +0000)]
instcombine: Add more test cases for __memmove_chk simplification
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164798
91177308-0d34-0410-b5e6-
96231b3b80d8
Meador Inge [Thu, 27 Sep 2012 21:21:21 +0000 (21:21 +0000)]
instcombine: Add more test cases for __memcpy_chk simplification
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164797
91177308-0d34-0410-b5e6-
96231b3b80d8
Meador Inge [Thu, 27 Sep 2012 21:21:18 +0000 (21:21 +0000)]
instcombine: Add more test cases for __memset_chk simplification
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164796
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Thu, 27 Sep 2012 21:06:02 +0000 (21:06 +0000)]
Enable the new coalescer algorithm by default.
The new coalescer is better at merging values into unused vector lanes,
improving NEON code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164794
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Thu, 27 Sep 2012 21:05:59 +0000 (21:05 +0000)]
Don't dereference begin() on an empty vector.
The fix is obvious and the only test case I have is horrible, so I am
not including it. The problem shows up when self-hosting clang on i386
with -new-coalescer enabled.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164793
91177308-0d34-0410-b5e6-
96231b3b80d8
Akira Hatanaka [Thu, 27 Sep 2012 19:09:21 +0000 (19:09 +0000)]
MIPS DSP: ABSQ_S.PH instruction sub-class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164787
91177308-0d34-0410-b5e6-
96231b3b80d8
Akira Hatanaka [Thu, 27 Sep 2012 19:05:08 +0000 (19:05 +0000)]
MIPS DSP: SHLL.QB instruction sub-class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164786
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Thu, 27 Sep 2012 18:29:58 +0000 (18:29 +0000)]
Fix a integer overflow in SimplifyCFG's look up table formation logic.
If the width is very large it gets truncated from uint64_t to uint32_t when
passed to TD->fitsInLegalInteger. The truncated value can fit in a register.
This manifested in massive memory usage or crashes (PR13946).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164784
91177308-0d34-0410-b5e6-
96231b3b80d8
Micah Villmow [Thu, 27 Sep 2012 17:51:02 +0000 (17:51 +0000)]
Fix CRLF issues.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164782
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Thu, 27 Sep 2012 16:34:19 +0000 (16:34 +0000)]
Avoid dereferencing a NULL pointer.
Fixes PR13943.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164778
91177308-0d34-0410-b5e6-
96231b3b80d8
Micah Villmow [Thu, 27 Sep 2012 15:05:49 +0000 (15:05 +0000)]
Patch for HowToBuildOnARM documentation from Wei-Ren Chen.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164776
91177308-0d34-0410-b5e6-
96231b3b80d8
Sylvestre Ledru [Thu, 27 Sep 2012 10:14:43 +0000 (10:14 +0000)]
Revert 'Fix a typo 'iff' => 'if''. iff is an abreviation of if and only if. See: en.wikipedia.org/wiki/If_and_only_if Commit 164767
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164768
91177308-0d34-0410-b5e6-
96231b3b80d8
Sylvestre Ledru [Thu, 27 Sep 2012 09:59:43 +0000 (09:59 +0000)]
Fix a typo 'iff' => 'if'
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164767
91177308-0d34-0410-b5e6-
96231b3b80d8
Nick Lewycky [Thu, 27 Sep 2012 08:33:56 +0000 (08:33 +0000)]
Prefer shuffles to selects. Backends love shuffles!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164763
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Thu, 27 Sep 2012 07:22:30 +0000 (07:22 +0000)]
Add constructors to the attribute builder.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164762
91177308-0d34-0410-b5e6-
96231b3b80d8
Nick Lewycky [Thu, 27 Sep 2012 06:33:40 +0000 (06:33 +0000)]
Add missing function CreateFPCast to the TargetFolder. It's there in the other
folders and not having it here fails to compile if you actually try to use it.
Also, CreatePointerCast was failing to do the part where it does TD-aware
constant folding. Granted there is exactly one case where that it will ever
do anything, but there's no reason to skip it. For reference, that case is a
subtraction between two constant offsets on the same global variable, eg.,
"&A[123] - &A[4].f".
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164760
91177308-0d34-0410-b5e6-
96231b3b80d8
Jush Lu [Thu, 27 Sep 2012 05:21:41 +0000 (05:21 +0000)]
[arm-fast-isel] Add support for ELF PIC.
This is a preliminary step towards ELF support; currently ARMFastISel hasn't
been used for ELF object files yet.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164759
91177308-0d34-0410-b5e6-
96231b3b80d8
Akira Hatanaka [Thu, 27 Sep 2012 04:12:30 +0000 (04:12 +0000)]
Test case for r164755 and 164756.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164757
91177308-0d34-0410-b5e6-
96231b3b80d8
Akira Hatanaka [Thu, 27 Sep 2012 04:08:42 +0000 (04:08 +0000)]
MIPS DSP: rddsp (instruction which reads DSPControl register fields to a GPR).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164756
91177308-0d34-0410-b5e6-
96231b3b80d8
Akira Hatanaka [Thu, 27 Sep 2012 03:58:34 +0000 (03:58 +0000)]
MIPS DSP: CMPU.EQ.QB instruction sub-class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164755
91177308-0d34-0410-b5e6-
96231b3b80d8
Akira Hatanaka [Thu, 27 Sep 2012 03:13:59 +0000 (03:13 +0000)]
MIPS DSP: ADDU.QB instruction sub-class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164754
91177308-0d34-0410-b5e6-
96231b3b80d8
Akira Hatanaka [Thu, 27 Sep 2012 02:15:57 +0000 (02:15 +0000)]
MIPS DSP: Branch on Greater Than or Equal To Value 32 in DSPControl Pos Field instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164751
91177308-0d34-0410-b5e6-
96231b3b80d8
Akira Hatanaka [Thu, 27 Sep 2012 02:11:20 +0000 (02:11 +0000)]
MIPS DSP: all the remaining instructions which read or write accumulators.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164750
91177308-0d34-0410-b5e6-
96231b3b80d8
Akira Hatanaka [Thu, 27 Sep 2012 02:05:42 +0000 (02:05 +0000)]
MIPS DSP: add support for extract-word instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164749
91177308-0d34-0410-b5e6-
96231b3b80d8
Akira Hatanaka [Thu, 27 Sep 2012 02:01:10 +0000 (02:01 +0000)]
MIPS DSP: add functions which decode DSP and accumulator registers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164748
91177308-0d34-0410-b5e6-
96231b3b80d8
Akira Hatanaka [Thu, 27 Sep 2012 01:59:07 +0000 (01:59 +0000)]
MIPS DSP: add code necessary for pseudo instruction lowering.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164747
91177308-0d34-0410-b5e6-
96231b3b80d8
Akira Hatanaka [Thu, 27 Sep 2012 01:56:38 +0000 (01:56 +0000)]
MIPS DSP: add bitcast patterns between vectors and int.
No test cases. These patterns will get tested along with dsp intrinsics.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164746
91177308-0d34-0410-b5e6-
96231b3b80d8
Akira Hatanaka [Thu, 27 Sep 2012 01:50:59 +0000 (01:50 +0000)]
MIPS DSP: add vector load/store patterns.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164744
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Kaylor [Wed, 26 Sep 2012 23:43:56 +0000 (23:43 +0000)]
Fix of hang during Intel JIT profiling
Committed on behalf of Kirill Uhanov
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164736
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Wed, 26 Sep 2012 23:38:00 +0000 (23:38 +0000)]
Buildbot Fix.
This method can be called with a '0' argument which checks the return
value. However, the method it calls doesn't expect '0' as a valid value. Call the
correct method when it's 0.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164735
91177308-0d34-0410-b5e6-
96231b3b80d8
Nick Lewycky [Wed, 26 Sep 2012 22:43:04 +0000 (22:43 +0000)]
Disable the new SROA pass to get the tree back in working order. We don't yet
have testcases for the current problems.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164731
91177308-0d34-0410-b5e6-
96231b3b80d8
Dan Gohman [Wed, 26 Sep 2012 22:17:14 +0000 (22:17 +0000)]
Add IRBuilder code for adding !tbaa.struct metadata tags to llvm.memcpy calls.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164728
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Wed, 26 Sep 2012 22:15:19 +0000 (22:15 +0000)]
Query the parameter attributes directly instead of using the Attribute symbols.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164727
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Wed, 26 Sep 2012 21:48:26 +0000 (21:48 +0000)]
Remove the `hasFnAttr' method from Function.
The hasFnAttr method has been replaced by querying the Attributes explicitly. No
intended functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164725
91177308-0d34-0410-b5e6-
96231b3b80d8
Jim Grosbach [Wed, 26 Sep 2012 21:27:45 +0000 (21:27 +0000)]
X86_32: Large Symbol+Offset relocations.
If the offset is more than 24-bits, it won't fit in a scattered
relocation offset field, so we fall back to using a non-scattered
relocation.
rdar://
12358909
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164724
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Wed, 26 Sep 2012 21:07:29 +0000 (21:07 +0000)]
Initial commit for the AttributesImpl class.
This opaque class will contain all of the attributes. All attribute queries will
go through this object. This object will also be uniqued in the LLVMContext.
Currently not used, so no implementation change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164722
91177308-0d34-0410-b5e6-
96231b3b80d8
Akira Hatanaka [Wed, 26 Sep 2012 19:27:24 +0000 (19:27 +0000)]
Add case clauses for returning dsp accumulator encoding values in function
getMipsRegisterNumbering.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164720
91177308-0d34-0410-b5e6-
96231b3b80d8
Akira Hatanaka [Wed, 26 Sep 2012 19:25:21 +0000 (19:25 +0000)]
Add DSP accumulator registers and register class. Remove hi/lo registers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164719
91177308-0d34-0410-b5e6-
96231b3b80d8
Akira Hatanaka [Wed, 26 Sep 2012 19:18:19 +0000 (19:18 +0000)]
Delete member MipsFunctionInfo::OutArgFIRange and code that accesses it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164718
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Wed, 26 Sep 2012 18:21:47 +0000 (18:21 +0000)]
Add support for detecting some corei7-class Xeons.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164714
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan Sands [Wed, 26 Sep 2012 17:16:01 +0000 (17:16 +0000)]
Now that invoke of an intrinsic is possible (for the llvm.do.nothing intrinsic)
teach the callgraph logic to not create callgraph edges to intrinsics for invoke
instructions; it already skips this for call instructions. Fixes PR13903.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164707
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Wed, 26 Sep 2012 15:52:15 +0000 (15:52 +0000)]
YAMLParser: Fix invalid reads when encountering incorrectly quoted scalar.
Fixes PR12632.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164701
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Wed, 26 Sep 2012 15:16:05 +0000 (15:16 +0000)]
Remove unneeded and invalid SetInsertPoint calls from unittest.
BB->end() returns a sentinel value that is not a legal insert point.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164699
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Wed, 26 Sep 2012 14:06:58 +0000 (14:06 +0000)]
APFloat::roundToIntegral: Special values don't keep the exponent value up to date, don't rely on it.
Add a couple of unit tests for special floats. Fixes 13929, found by MemorySanitizer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164698
91177308-0d34-0410-b5e6-
96231b3b80d8
Hans Wennborg [Wed, 26 Sep 2012 14:01:53 +0000 (14:01 +0000)]
Address Duncan's comments on r164684:
- Put statistics in alphabetical order
- Don't use getZextValue when building TableInt, just use APInts
- Introduce Create{Z,S}ExtOrTrunc in IRBuilder.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164696
91177308-0d34-0410-b5e6-
96231b3b80d8
Hans Wennborg [Wed, 26 Sep 2012 11:07:37 +0000 (11:07 +0000)]
Address Duncan's comments on r164682:
- Finish assert messages with exclamation mark
- Move overflow checking into ShouldBuildLookupTable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164692
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Wed, 26 Sep 2012 10:59:22 +0000 (10:59 +0000)]
Analogous fix to memset and memcpy rewriting. Don't have a test case
contrived for these yet, as I spotted them by inspection and the test
cases are a bit more tricky to phrase.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164691
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Wed, 26 Sep 2012 10:45:28 +0000 (10:45 +0000)]
When rewriting the pointer operand to a load or store which has
alignment guarantees attached, re-compute the alignment so that we
consider offsets which impact alignment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164690
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Wed, 26 Sep 2012 10:27:46 +0000 (10:27 +0000)]
Teach all of the loads, stores, memsets and memcpys created by the
rewriter in SROA to carry a proper alignment. This involves
interrogating various sources of alignment, etc. This is a more complete
and principled fix to PR13920 as well as related bugs pointed out by Eli
in review and by inspection in the area.
Also by inspection fix the integer and vector promotion paths to create
aligned loads and stores. I still need to work up test cases for
these... Sorry for the delay, they were found purely by inspection.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164689
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Wed, 26 Sep 2012 10:27:40 +0000 (10:27 +0000)]
Add some convenience methods to IRBuilder for constructing aligned loads
and stores. These will be used in subsequnet patches to SROA to more
systematically manage the alignment on loads and stores.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164688
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Wed, 26 Sep 2012 10:12:20 +0000 (10:12 +0000)]
ARM/atomicrmw_minmax.ll: Fix RUN line.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164687
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Wed, 26 Sep 2012 09:51:39 +0000 (09:51 +0000)]
Fix tests that didn't test anything.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164686
91177308-0d34-0410-b5e6-
96231b3b80d8
James Molloy [Wed, 26 Sep 2012 09:48:32 +0000 (09:48 +0000)]
Fix ordering of operands on lowering of atomicrmw min/max nodes on ARM.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164685
91177308-0d34-0410-b5e6-
96231b3b80d8
Hans Wennborg [Wed, 26 Sep 2012 09:44:49 +0000 (09:44 +0000)]
SimplifyCFG: Make the switch-to-lookup table transformation store the
tables in bitmaps when they fit in a target-legal register.
This saves some space, and it also allows for building tables that would
otherwise be deemed too sparse.
One interesting case that this hits is example 7 from
http://blog.regehr.org/archives/320. We currently generate good code
for this when lowering the switch to the selection DAG: we build a
bitmask to decide whether to jump to one block or the other. My patch
will result in the same bitmask, but it removes the need for the jump,
as the return value can just be retrieved from the mask.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164684
91177308-0d34-0410-b5e6-
96231b3b80d8
Hans Wennborg [Wed, 26 Sep 2012 09:34:53 +0000 (09:34 +0000)]
SimplifyCFG: Refactor the switch-to-lookup table transformation by
breaking out the building of lookup tables into a separate class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164682
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Wed, 26 Sep 2012 09:24:12 +0000 (09:24 +0000)]
llvm/test/CodeGen/X86/mulx*.ll: Fix copypasto.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164681
91177308-0d34-0410-b5e6-
96231b3b80d8
Sylvestre Ledru [Wed, 26 Sep 2012 08:30:35 +0000 (08:30 +0000)]
The assumption that /proc/self/exe always exists is incorrect.
For example, under a Linux chroot, /proc/ might not be mounted.
Therefor, we test if this file exist. If it is the case, use it (the current
behavior). Otherwise, we fall back to the detection used by *BSD.
The issue has been reported initially on the Debian bug tracker:
http://bugs.debian.org/674588
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164676
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Liao [Wed, 26 Sep 2012 08:26:25 +0000 (08:26 +0000)]
Add SARX/SHRX/SHLX code generation support
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164675
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Liao [Wed, 26 Sep 2012 08:24:51 +0000 (08:24 +0000)]
Add RORX code generation support
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164674
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Liao [Wed, 26 Sep 2012 08:22:37 +0000 (08:22 +0000)]
Add MULX code generation support
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164673
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan Sands [Wed, 26 Sep 2012 07:45:36 +0000 (07:45 +0000)]
Teach the 'lint' sanity checking pass to detect simple buffer overflows.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164671
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Wed, 26 Sep 2012 07:43:06 +0000 (07:43 +0000)]
Revert r164663 due to buildbot failure.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164670
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Wed, 26 Sep 2012 07:41:40 +0000 (07:41 +0000)]
Revert the business end of r164636 and try again. I'll come in again. ;]
This should really, really fix PR13916. For real this time. The
underlying bug is... a bit more subtle than I had imagined.
The setup is a code pattern that leads to an @llvm.memcpy call with two
equal pointers to an alloca in the source and dest. Now, not any pattern
will do. The alloca needs to be formed just so, and both pointers should
be wrapped in different bitcasts etc. When this precise pattern hits,
a funny sequence of events transpires. First, we correctly detect the
potential for overlap, and correctly optimize the memcpy. The first
time. However, we do simplify the set of users of the alloca, and that
causes us to run the alloca back through the SROA pass in case there are
knock-on simplifications. At this point, a curious thing has happened.
If we happen to have an i8 alloca, we have direct i8 pointer values. So
we don't bother creating a cast, we rewrite the arguments to the memcpy
to dircetly refer to the alloca.
Now, in an unrelated area of the pass, we have clever logic which
ensures that when visiting each User of a particular pointer derived
from an alloca, we only visit that User once, and directly inspect all
of its operands which refer to that particular pointer value. However,
the mechanism used to detect memcpy's with the potential to overlap
relied upon getting visited once per *Use*, not once per *User*. This is
always true *unless* the same exact value is both source and dest. It
turns out that almost nothing actually produces that pattern though.
We can hand craft test cases that more directly test this behavior of
course, and those are included. Also, note that there is a significant
missed optimization here -- we prove in many cases that there is
a non-volatile memcpy call with identical source and dest addresses. We
shouldn't prevent splitting the alloca in that case, and in fact we
should just remove such memcpy calls eagerly. I'll address that in
a subsequent commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164669
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Wed, 26 Sep 2012 07:17:37 +0000 (07:17 +0000)]
Add is16BitVector and is32BitVector to MVT and call them from EVT. Matches other similar methods.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164668
91177308-0d34-0410-b5e6-
96231b3b80d8