oota-llvm.git
14 years agono really, fix the test.
Chris Lattner [Fri, 27 Aug 2010 23:05:54 +0000 (23:05 +0000)]
no really, fix the test.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112317 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agofix this test. It's not clear what it's really testing.
Chris Lattner [Fri, 27 Aug 2010 23:05:27 +0000 (23:05 +0000)]
fix this test.  It's not clear what it's really testing.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112316 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoEnhance the shift propagator to handle the case when you have:
Chris Lattner [Fri, 27 Aug 2010 22:53:44 +0000 (22:53 +0000)]
Enhance the shift propagator to handle the case when you have:

A = shl x, 42
...
B = lshr ..., 38

which can be transformed into:
A = shl x, 4
...

iff we can prove that the would-be-shifted-in bits
are already zero.  This eliminates two shifts in the testcase
and allows eliminate of the whole i128 chain in the real example.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112314 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoSimplify.
Devang Patel [Fri, 27 Aug 2010 22:25:51 +0000 (22:25 +0000)]
Simplify.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112305 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoImplement a pretty general logical shift propagation
Chris Lattner [Fri, 27 Aug 2010 22:24:38 +0000 (22:24 +0000)]
Implement a pretty general logical shift propagation
framework, which is good at ripping through bitfield
operations.  This generalize a bunch of the existing
xforms that instcombine does, such as
  (x << c) >> c -> and
to handle intermediate logical nodes.  This is useful for
ripping up the "promote to large integer" code produced by
SRoA.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112304 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix a comment typo.
Bob Wilson [Fri, 27 Aug 2010 21:56:59 +0000 (21:56 +0000)]
Fix a comment typo.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112302 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoUnsigned value cannot be < 0.
Bob Wilson [Fri, 27 Aug 2010 21:44:35 +0000 (21:44 +0000)]
Unsigned value cannot be < 0.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112300 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoWhen merging adjacent operands, scan ahead and merge all equal
Dan Gohman [Fri, 27 Aug 2010 21:39:59 +0000 (21:39 +0000)]
When merging adjacent operands, scan ahead and merge all equal
adjacent operands at once, instead of just two at a time.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112299 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix a couple of typos.
Eric Christopher [Fri, 27 Aug 2010 21:38:11 +0000 (21:38 +0000)]
Fix a couple of typos.

Patch by Cameron Esfahani!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112297 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoremove some special shift cases that have been subsumed into the
Chris Lattner [Fri, 27 Aug 2010 21:04:34 +0000 (21:04 +0000)]
remove some special shift cases that have been subsumed into the
more general simplify demanded bits logic.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112291 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoMake the {A,+,B}<L> + {C,+,D}<L> --> Other + {A+C,+,B+D}<L>
Dan Gohman [Fri, 27 Aug 2010 20:45:56 +0000 (20:45 +0000)]
Make the {A,+,B}<L> + {C,+,D}<L>  -->  Other + {A+C,+,B+D}<L>
transformation collect all the addrecs with the same loop
add combine them at once rather than starting everything over
at the first chance.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112290 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agomerge and filecheckize test
Chris Lattner [Fri, 27 Aug 2010 20:44:45 +0000 (20:44 +0000)]
merge and filecheckize test

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112289 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agomerge two tests
Chris Lattner [Fri, 27 Aug 2010 20:42:10 +0000 (20:42 +0000)]
merge two tests

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112288 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoRemove now unneeded command line flag that enables 'optimize compares.'
Bill Wendling [Fri, 27 Aug 2010 20:39:09 +0000 (20:39 +0000)]
Remove now unneeded command line flag that enables 'optimize compares.'

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112287 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix typos in comments.
Owen Anderson [Fri, 27 Aug 2010 20:32:56 +0000 (20:32 +0000)]
Fix typos in comments.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112286 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoteach the truncation optimization that an entire chain of
Chris Lattner [Fri, 27 Aug 2010 20:32:06 +0000 (20:32 +0000)]
teach the truncation optimization that an entire chain of
computation can be truncated if it is fed by a sext/zext that doesn't
have to be exactly equal to the truncation result type.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112285 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoSwitch ScalarEvolution's main Value*->SCEV* map from std::map
Dan Gohman [Fri, 27 Aug 2010 18:55:03 +0000 (18:55 +0000)]
Switch ScalarEvolution's main Value*->SCEV* map from std::map
to DenseMap.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112281 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoget this test passing on linux builders.
Chris Lattner [Fri, 27 Aug 2010 18:49:08 +0000 (18:49 +0000)]
get this test passing on linux builders.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112280 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd an instcombine to clean up a common pattern produced
Chris Lattner [Fri, 27 Aug 2010 18:31:05 +0000 (18:31 +0000)]
Add an instcombine to clean up a common pattern produced
by the SRoA "promote to large integer" code, eliminating
some type conversions like this:

   %94 = zext i16 %93 to i32                       ; <i32> [#uses=2]
   %96 = lshr i32 %94, 8                           ; <i32> [#uses=1]
   %101 = trunc i32 %96 to i8                      ; <i8> [#uses=1]

This also unblocks other xforms from happening, now clang is able to compile:

struct S { float A, B, C, D; };
float foo(struct S A) { return A.A + A.B+A.C+A.D; }

into:

_foo:                                   ## @foo
## BB#0:                                ## %entry
pshufd $1, %xmm0, %xmm2
addss %xmm0, %xmm2
movdqa %xmm1, %xmm3
addss %xmm2, %xmm3
pshufd $1, %xmm1, %xmm0
addss %xmm3, %xmm0
ret

on x86-64, instead of:

_foo:                                   ## @foo
## BB#0:                                ## %entry
movd %xmm0, %rax
shrq $32, %rax
movd %eax, %xmm2
addss %xmm0, %xmm2
movapd %xmm1, %xmm3
addss %xmm2, %xmm3
movd %xmm1, %rax
shrq $32, %rax
movd %eax, %xmm0
addss %xmm3, %xmm0
ret

This seems pretty close to optimal to me, at least without
using horizontal adds.  This also triggers in lots of other
code, including SPEC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112278 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd alignment arguments to all the NEON load/store intrinsics.
Bob Wilson [Fri, 27 Aug 2010 17:13:24 +0000 (17:13 +0000)]
Add alignment arguments to all the NEON load/store intrinsics.
Update all the tests using those intrinsics and add support for
auto-upgrading bitcode files with the old versions of the intrinsics.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112271 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoUse LVI to eliminate conditional branches where we've tested a related condition...
Owen Anderson [Fri, 27 Aug 2010 17:12:29 +0000 (17:12 +0000)]
Use LVI to eliminate conditional branches where we've tested a related condition previously.  Update tests for this change.
This fixes PR5652.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112270 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoOptimize SCEVComplexityCompare. Use a 3-way return instead of a 2-way
Dan Gohman [Fri, 27 Aug 2010 15:26:01 +0000 (15:26 +0000)]
Optimize SCEVComplexityCompare. Use a 3-way return instead of a 2-way
return to avoid needing two calls to test for equivalence, and sort
addrecs by their degree before examining their operands.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112267 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoClarify a comment.
Dan Gohman [Fri, 27 Aug 2010 15:16:40 +0000 (15:16 +0000)]
Clarify a comment.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112266 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoParse " (Hidden)" and cope with it.
Dan Gohman [Fri, 27 Aug 2010 15:16:09 +0000 (15:16 +0000)]
Parse " (Hidden)" and cope with it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112265 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoDefault to looking for clang++ in the PATH, rather than trying to
Dan Gohman [Fri, 27 Aug 2010 15:15:31 +0000 (15:15 +0000)]
Default to looking for clang++ in the PATH, rather than trying to
guess a path that will work.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112264 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoProperly handle passing of FP stuff to varargs function on Win64:
Anton Korobeynikov [Fri, 27 Aug 2010 14:43:06 +0000 (14:43 +0000)]
Properly handle passing of FP stuff to varargs function on Win64:
value should be copied to the corresponding shadow reg as well.
Patch by Cameron Esfahani!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112262 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoMCELF: Port EmitInstruction changes from MachO streamer. Patch by Roman Divacky.
Benjamin Kramer [Fri, 27 Aug 2010 10:40:51 +0000 (10:40 +0000)]
MCELF: Port EmitInstruction changes from MachO streamer. Patch by Roman Divacky.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112260 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoMCELF: Always overwrite FixedValue.
Benjamin Kramer [Fri, 27 Aug 2010 10:38:39 +0000 (10:38 +0000)]
MCELF: Always overwrite FixedValue.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112259 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix the msvs 2010 build.
Michael J. Spencer [Fri, 27 Aug 2010 02:49:45 +0000 (02:49 +0000)]
Fix the msvs 2010 build.

The Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 16.00.30319.01
implements parts of C++0x based on the draft standard. An old version of
the draft had a bug that makes std::pair<T1*, T2*>(something, 0) fail to
compile. This is because the template<class U, class V> pair(U&& x, V&& y)
constructor is selected, even though it later fails to implicitly convert
U and V to frist_type and second_type.

This has been fixed in n3090, but it seems that Microsoft is not going to
update msvc.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112257 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoX86: Fix an encoding issue with LOCK_ADD64mr, which could lead to very hard to find...
Daniel Dunbar [Fri, 27 Aug 2010 01:30:14 +0000 (01:30 +0000)]
X86: Fix an encoding issue with LOCK_ADD64mr, which could lead to very hard to find miscompiles with the integrated assembler.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112250 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoRevert r112213. It is not needed.
Devang Patel [Thu, 26 Aug 2010 23:35:15 +0000 (23:35 +0000)]
Revert r112213. It is not needed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112242 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoSimplify eliminateFrameIndex() interface back down now that PEI doesn't need
Jim Grosbach [Thu, 26 Aug 2010 23:32:16 +0000 (23:32 +0000)]
Simplify eliminateFrameIndex() interface back down now that PEI doesn't need
to try to re-use scavenged frame index reference registers. rdar://8277890

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112241 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoIf node is not available then use FuncInfo.ValueMap to emit debug info for byval...
Devang Patel [Thu, 26 Aug 2010 22:53:27 +0000 (22:53 +0000)]
If node is not available then use FuncInfo.ValueMap to emit debug info for byval parameter.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112238 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoRemove the now obsolete frame index virtual re-use algorithm from PEI. Pre-RA
Jim Grosbach [Thu, 26 Aug 2010 22:42:12 +0000 (22:42 +0000)]
Remove the now obsolete frame index virtual re-use algorithm from PEI. Pre-RA
virtual base registers handle this function, and more. A bit more cleanup
to do on the interface to eliminateFrameIndex() after this.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112237 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agofilecheckize
Chris Lattner [Thu, 26 Aug 2010 22:23:39 +0000 (22:23 +0000)]
filecheckize

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112235 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agorename test.
Chris Lattner [Thu, 26 Aug 2010 22:20:47 +0000 (22:20 +0000)]
rename test.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112234 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agooptimize "integer extraction out of the middle of a vector" as produced
Chris Lattner [Thu, 26 Aug 2010 22:14:59 +0000 (22:14 +0000)]
optimize "integer extraction out of the middle of a vector" as produced
by SRoA.  This is part of rdar://7892780, but needs another xform to
expose this.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112232 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agotidy up a bit. no functional change.
Jim Grosbach [Thu, 26 Aug 2010 21:56:30 +0000 (21:56 +0000)]
tidy up a bit. no functional change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112228 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agooptimize bitcast(trunc(bitcast(x))) where the result is a float and 'x'
Chris Lattner [Thu, 26 Aug 2010 21:55:42 +0000 (21:55 +0000)]
optimize bitcast(trunc(bitcast(x))) where the result is a float and 'x'
is a vector to be a vector element extraction.  This allows clang to
compile:

struct S { float A, B, C, D; };
float foo(struct S A) { return A.A + A.B+A.C+A.D; }

into:

_foo:                                   ## @foo
## BB#0:                                ## %entry
movd %xmm0, %rax
shrq $32, %rax
movd %eax, %xmm2
addss %xmm0, %xmm2
movapd %xmm1, %xmm3
addss %xmm2, %xmm3
movd %xmm1, %rax
shrq $32, %rax
movd %eax, %xmm0
addss %xmm3, %xmm0
ret

instead of:

_foo:                                   ## @foo
## BB#0:                                ## %entry
movd %xmm0, %rax
movd %eax, %xmm0
shrq $32, %rax
movd %eax, %xmm2
addss %xmm0, %xmm2
movd %xmm1, %rax
movd %eax, %xmm1
addss %xmm2, %xmm1
shrq $32, %rax
movd %eax, %xmm0
addss %xmm1, %xmm0
ret

... eliminating half of the horribleness.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112227 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agofilecheckize
Chris Lattner [Thu, 26 Aug 2010 21:51:41 +0000 (21:51 +0000)]
filecheckize

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112225 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agorename test
Chris Lattner [Thu, 26 Aug 2010 21:50:56 +0000 (21:50 +0000)]
rename test

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112224 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoadd m_BitCast for matching a bitcast.
Chris Lattner [Thu, 26 Aug 2010 21:35:52 +0000 (21:35 +0000)]
add m_BitCast for matching a bitcast.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112222 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoTurn off the scavenging based frame reg reuse briefly to measure whether it's
Jim Grosbach [Thu, 26 Aug 2010 21:29:54 +0000 (21:29 +0000)]
Turn off the scavenging based frame reg reuse briefly to measure whether it's
still having a significant effect. It shouldn't be now that the pre-RA
virtual base reg stuff is in. Assuming that's valididated by the nightly
testers, we can simplify a lot of the PEI frame index code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112220 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agozap the now unused MVT::getIntVectorWithNumElements
Bruno Cardoso Lopes [Thu, 26 Aug 2010 20:53:12 +0000 (20:53 +0000)]
zap the now unused MVT::getIntVectorWithNumElements

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112218 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoSpeculatively revert r112207.
Devang Patel [Thu, 26 Aug 2010 20:33:42 +0000 (20:33 +0000)]
Speculatively revert r112207.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112216 91177308-0d34-0410-b5e6-96231b3b80d8

14 years ago80 col.
Devang Patel [Thu, 26 Aug 2010 20:32:32 +0000 (20:32 +0000)]
80 col.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112215 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoUpdate DanglingDebugInfo so that it can be used to track llvm.dbg.declare also.
Devang Patel [Thu, 26 Aug 2010 20:06:46 +0000 (20:06 +0000)]
Update DanglingDebugInfo so that it can be used to track llvm.dbg.declare also.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112213 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoUse pseudo instructions for VST3.
Bob Wilson [Thu, 26 Aug 2010 18:51:29 +0000 (18:51 +0000)]
Use pseudo instructions for VST3.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112208 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoDonot forget to resolve dangling debug info in a case where virtual register, used...
Devang Patel [Thu, 26 Aug 2010 18:36:14 +0000 (18:36 +0000)]
Donot forget to resolve dangling debug info in a case where virtual register, used for a value, is initialized after a dbg intrinsic is seen.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112207 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoReapply r112176 without removing the other CMN patterns (that was unintentional).
Bill Wendling [Thu, 26 Aug 2010 18:33:51 +0000 (18:33 +0000)]
Reapply r112176 without removing the other CMN patterns (that was unintentional).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112206 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoExperimental clang-based code-completion support for vim. This currently
Dan Gohman [Thu, 26 Aug 2010 18:12:22 +0000 (18:12 +0000)]
Experimental clang-based code-completion support for vim. This currently
depends on some clang patches which are not yet upstream.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112204 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoMCELF: Fix a thinko of mine.
Benjamin Kramer [Thu, 26 Aug 2010 18:12:04 +0000 (18:12 +0000)]
MCELF: Fix a thinko of mine.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112203 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix comment typos.
Bob Wilson [Thu, 26 Aug 2010 18:08:11 +0000 (18:08 +0000)]
Fix comment typos.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112202 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix prototypes.
Devang Patel [Thu, 26 Aug 2010 17:47:45 +0000 (17:47 +0000)]
Fix prototypes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112200 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoMake JumpThreading smart enough to properly thread StrSwitch when it's compiled with...
Owen Anderson [Thu, 26 Aug 2010 17:40:24 +0000 (17:40 +0000)]
Make JumpThreading smart enough to properly thread StrSwitch when it's compiled with clang++.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112198 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoMCELF: Compensate for the addend on i386. Patch by Roman Divacky, with some cleanups.
Benjamin Kramer [Thu, 26 Aug 2010 17:23:02 +0000 (17:23 +0000)]
MCELF: Compensate for the addend on i386. Patch by Roman Divacky, with some cleanups.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112197 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoRestrict the register to tGPR to make sure the str instruction will be
Jim Grosbach [Thu, 26 Aug 2010 17:02:47 +0000 (17:02 +0000)]
Restrict the  register to tGPR to make sure the str instruction will be
encodable as a 16-bit wide instruction.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112195 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoRevert r112176; it broke test/CodeGen/Thumb2/thumb2-cmn.ll.
Dan Gohman [Thu, 26 Aug 2010 15:50:25 +0000 (15:50 +0000)]
Revert r112176; it broke test/CodeGen/Thumb2/thumb2-cmn.ll.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112191 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoReapply r112091 and r111922, support for metadata linking, with a
Dan Gohman [Thu, 26 Aug 2010 15:41:53 +0000 (15:41 +0000)]
Reapply r112091 and r111922, support for metadata linking, with a
fix: add a flag to MapValue and friends which indicates whether
any module-level mappings are being made. In the common case of
inlining, no module-level mappings are needed, so MapValue doesn't
need to examine non-function-local metadata, which can be very
expensive in the case of a large module with really deep metadata
(e.g. a large C++ program compiled with -g).

This flag is a little awkward; perhaps eventually it can be moved
into the ClonedCodeInfo class.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112190 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoStringRef::compare_numeric also differed from StringRef::compare for characters ...
Benjamin Kramer [Thu, 26 Aug 2010 15:25:35 +0000 (15:25 +0000)]
StringRef::compare_numeric also differed from StringRef::compare for characters > 127.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112189 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoDo unsigned char comparisons in StringRef::compare_lower to be more consistent with...
Benjamin Kramer [Thu, 26 Aug 2010 14:21:08 +0000 (14:21 +0000)]
Do unsigned char comparisons in StringRef::compare_lower to be more consistent with compare in corner cases.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112185 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoThere seems to be a (potential) hardware bug with the CMN instruction and
Bill Wendling [Thu, 26 Aug 2010 09:07:33 +0000 (09:07 +0000)]
There seems to be a (potential) hardware bug with the CMN instruction and
comparison with 0. These two pieces of code should give identical results:

  rsbs r1, r1, 0
  cmp  r0, r1
  mov  r0, #0
  it   ls
  mov  r0, #1

and:

  cmn  r0, r1
  mov  r0, #0
  it   ls
  mov  r0, #1

However, the CMN gives the *opposite* result when r1 is 0. This is because the
carry flag is set in the CMP case but not in the CMN case. In short, the CMP
instruction doesn't perform a truncate of the (logical) NOT of 0 plus the value
of r0 and the carry bit (because the "carry bit" parameter to AddWithCarry is
defined as 1 in this case, the carry flag will always be set when r0 >= 0). The
CMN instruction doesn't perform a NOT of 0 so there is never a "carry" when this
AddWithCarry is performed (because the "carry bit" parameter to AddWithCarry is
defined as 0).

The AddWithCarry in the CMP case seems to be relying upon the identity:

  ~x + 1 = -x

However when x is 0 and unsigned, this doesn't hold:

   x = 0
  ~x = 0xFFFF FFFF
  ~x + 1 = 0x1 0000 0000
  (-x = 0) != (0x1 0000 0000 = ~x + 1)

Therefore, we should disable *all* versions of CMN, especially when comparing
against zero, until we can limit when the CMN instruction is used (when we know
that the RHS is not 0) or when we have a hardware fix for this.

(See the ARM docs for the "AddWithCarry" pseudo-code.)

This is related to <rdar://problem/7569620>.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112176 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd a hackaround for PR7993 which is causing failures on x86 builders that lack sse2.
Chris Lattner [Thu, 26 Aug 2010 06:57:07 +0000 (06:57 +0000)]
Add a hackaround for PR7993 which is causing failures on x86 builders that lack sse2.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112175 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoI think enough general codegen bugs are fixed to allow this to work
Chris Lattner [Thu, 26 Aug 2010 05:52:42 +0000 (05:52 +0000)]
I think enough general codegen bugs are fixed to allow this to work
on random hosts, lets see!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112172 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoimplement SplitVecOp_CONCAT_VECTORS, fixing the included testcase with SSE1.
Chris Lattner [Thu, 26 Aug 2010 05:51:22 +0000 (05:51 +0000)]
implement SplitVecOp_CONCAT_VECTORS, fixing the included testcase with SSE1.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112171 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoUse pseudo instructions for VST1d64Q.
Bob Wilson [Thu, 26 Aug 2010 05:33:30 +0000 (05:33 +0000)]
Use pseudo instructions for VST1d64Q.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112170 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoMake sure this forces the x86 targets
Chris Lattner [Thu, 26 Aug 2010 05:25:05 +0000 (05:25 +0000)]
Make sure this forces the x86 targets

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112169 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agofix sse1 only codegen in x86-64 mode, which is something we
Chris Lattner [Thu, 26 Aug 2010 05:24:29 +0000 (05:24 +0000)]
fix sse1 only codegen in x86-64 mode, which is something we
apparently try to support.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112168 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoRevert r111922, "MapValue support for MDNodes. This is similar to r109117,
Daniel Dunbar [Thu, 26 Aug 2010 03:48:11 +0000 (03:48 +0000)]
Revert r111922, "MapValue support for MDNodes. This is similar to r109117,
except ...", it is causing *massive* performance regressions when building Clang
with itself (-O3 -g).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112158 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoRevert r112091, "Remap metadata attached to instructions when remapping
Daniel Dunbar [Thu, 26 Aug 2010 03:48:08 +0000 (03:48 +0000)]
Revert r112091, "Remap metadata attached to instructions when remapping
individual ...", which depends on r111922, which I am reverting.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112157 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agozap dead code.
Chris Lattner [Thu, 26 Aug 2010 02:57:35 +0000 (02:57 +0000)]
zap dead code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112155 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoUpdated CMake library dependencies. Removed unnecessary component name
Oscar Fuentes [Thu, 26 Aug 2010 02:29:53 +0000 (02:29 +0000)]
Updated CMake library dependencies. Removed unnecessary component name
from llvm-link/CMakeLists.txt

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112153 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoSmallVector's growth policies don't like starting from zero capacity.
John McCall [Thu, 26 Aug 2010 02:11:48 +0000 (02:11 +0000)]
SmallVector's growth policies don't like starting from zero capacity.
I think there are good reasons to change this, but in the interests
of short-term stability, make SmallVector<...,0> reserve non-zero
capacity in its constructors.  This means that SmallVector<...,0>
uses more memory than SmallVector<...,1> and should really only be
used (unless/until this workaround is removed) by clients that
care about using SmallVector with an incomplete type.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112147 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoremove dead proto
Chris Lattner [Thu, 26 Aug 2010 01:14:37 +0000 (01:14 +0000)]
remove dead proto

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112131 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agozap dead code.
Chris Lattner [Thu, 26 Aug 2010 01:13:54 +0000 (01:13 +0000)]
zap dead code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112130 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix PR7748 without using microsoft extensions
Bruno Cardoso Lopes [Thu, 26 Aug 2010 01:02:53 +0000 (01:02 +0000)]
Fix PR7748 without using microsoft extensions

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112128 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoEnable pre-RA virtual frame base register allocation. rdar://8277890
Jim Grosbach [Thu, 26 Aug 2010 00:58:06 +0000 (00:58 +0000)]
Enable pre-RA virtual frame base register allocation. rdar://8277890

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112127 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoRewrite ExtractGV, removing a bunch of stuff that didn't fully work,
Dan Gohman [Thu, 26 Aug 2010 00:22:55 +0000 (00:22 +0000)]
Rewrite ExtractGV, removing a bunch of stuff that didn't fully work,
and was over-complicated, and replacing it with a simple implementation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112120 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoRevert svn 107892 (with changes to work with trunk). It caused a crash if
Bob Wilson [Thu, 26 Aug 2010 00:13:36 +0000 (00:13 +0000)]
Revert svn 107892 (with changes to work with trunk).  It caused a crash if
a VLD result was not used (Radar 8355607).  It should also fix pr7988, but
I haven't verified that yet.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112118 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agotemporarily disable this, which started failing on the llvm-i686-linux
Chris Lattner [Wed, 25 Aug 2010 23:43:14 +0000 (23:43 +0000)]
temporarily disable this, which started failing on the llvm-i686-linux
builder.  I will investigate tonight.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112113 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoConvert llvm-extract to use lazy loading. This makes it substantially
Dan Gohman [Wed, 25 Aug 2010 23:33:07 +0000 (23:33 +0000)]
Convert llvm-extract to use lazy loading. This makes it substantially
faster on large modules.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112110 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agowe should pattern match the SSE complex arithmetic ops.
Chris Lattner [Wed, 25 Aug 2010 23:31:42 +0000 (23:31 +0000)]
we should pattern match the SSE complex arithmetic ops.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112109 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoStart converting NEON load/stores to use pseudo instructions, beginning here
Bob Wilson [Wed, 25 Aug 2010 23:27:42 +0000 (23:27 +0000)]
Start converting NEON load/stores to use pseudo instructions, beginning here
with the VST4 instructions.  Until after register allocation, we want to
represent sets of adjacent registers by a single super-register.  These
VST4 pseudo instructions have a single QQ or QQQQ source register operand.
They get expanded to the real VST4 instructions with 4 separate D register
operands.  Once this conversion is complete, we'll be able to remove the
NEONPreAllocPass and avoid some fragile and hacky code elsewhere.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112108 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoProvide an explicit specialization of SmallVector at N=0 which does
John McCall [Wed, 25 Aug 2010 23:11:24 +0000 (23:11 +0000)]
Provide an explicit specialization of SmallVector at N=0 which does
not require its type argument to be complete if no members are
actually used.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112106 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoadd a specialization for the MVT form of getTypeAction, since it is
Chris Lattner [Wed, 25 Aug 2010 23:05:45 +0000 (23:05 +0000)]
add a specialization for the MVT form of getTypeAction, since it is
trivial.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112105 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoremove some llvmcontext arguments that are now dead post-refactoring.
Chris Lattner [Wed, 25 Aug 2010 23:00:45 +0000 (23:00 +0000)]
remove some llvmcontext arguments that are now dead post-refactoring.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112104 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoChange handling of illegal vector types to widen when possible instead of
Chris Lattner [Wed, 25 Aug 2010 22:49:25 +0000 (22:49 +0000)]
Change handling of illegal vector types to widen when possible instead of
expanding: e.g. <2 x float> -> <4 x float> instead of -> 2 floats.  This
affects two places in the code: handling cross block values and handling
function return and arguments.  Since vectors are already widened by
legalizetypes, this gives us much better code and unblocks x86-64 abi
and SPU abi work.

For example, this (which is a silly example of a cross-block value):
define <4 x float> @test2(<4 x float> %A) nounwind {
 %B = shufflevector <4 x float> %A, <4 x float> undef, <2 x i32> <i32 0, i32 1>
 %C = fadd <2 x float> %B, %B
  br label %BB
BB:
 %D = fadd <2 x float> %C, %C
 %E = shufflevector <2 x float> %D, <2 x float> undef, <4 x i32> <i32 0, i32 1, i32 undef, i32 undef>
 ret <4 x float> %E
}

Now compiles into:

_test2:                                 ## @test2
## BB#0:
 addps %xmm0, %xmm0
 addps %xmm0, %xmm0
 ret

previously it compiled into:

_test2:                                 ## @test2
## BB#0:
 addps %xmm0, %xmm0
 pshufd $1, %xmm0, %xmm1
                                        ## kill: XMM0<def> XMM0<kill> XMM0<def>
 insertps $0, %xmm0, %xmm0
 insertps $16, %xmm1, %xmm0
 addps %xmm0, %xmm0
 ret

This implements rdar://8230384

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112101 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agotidy up
Chris Lattner [Wed, 25 Aug 2010 22:45:53 +0000 (22:45 +0000)]
tidy up

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112099 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoRemap metadata attached to instructions when remapping individual
Dan Gohman [Wed, 25 Aug 2010 21:36:50 +0000 (21:36 +0000)]
Remap metadata attached to instructions when remapping individual
instructions, not when remapping modules.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112091 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoRevert this for now, PUNPCKLDQ dont operate on v4f32
Bruno Cardoso Lopes [Wed, 25 Aug 2010 21:26:37 +0000 (21:26 +0000)]
Revert this for now, PUNPCKLDQ dont operate on v4f32

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112090 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoX86: Fix misencode of RI64mi8. This fixes OpenSSL / x86_64-apple-darwin10 / clang...
Daniel Dunbar [Wed, 25 Aug 2010 21:11:02 +0000 (21:11 +0000)]
X86: Fix misencode of RI64mi8. This fixes OpenSSL / x86_64-apple-darwin10 / clang -O3.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112089 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix comment.
Devang Patel [Wed, 25 Aug 2010 20:41:24 +0000 (20:41 +0000)]
Fix comment.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112086 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoRemove dead argument.
Devang Patel [Wed, 25 Aug 2010 20:39:26 +0000 (20:39 +0000)]
Remove dead argument.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112085 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd some statistics for PEI register scavenging
Jim Grosbach [Wed, 25 Aug 2010 20:34:28 +0000 (20:34 +0000)]
Add some statistics for PEI register scavenging

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112084 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd a FIXME comment.
Dan Gohman [Wed, 25 Aug 2010 20:23:38 +0000 (20:23 +0000)]
Add a FIXME comment.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112083 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix the bitcode reader to clear out function-specific state
Dan Gohman [Wed, 25 Aug 2010 20:22:53 +0000 (20:22 +0000)]
Fix the bitcode reader to clear out function-specific state
from MDValueList between each function, now that the bitcode
writer is reusing the index space for function-local metadata.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112082 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix a bug found by inspection.
Dan Gohman [Wed, 25 Aug 2010 20:20:21 +0000 (20:20 +0000)]
Fix a bug found by inspection.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112081 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd a comment.
Dan Gohman [Wed, 25 Aug 2010 20:17:19 +0000 (20:17 +0000)]
Add a comment.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112080 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoMCELF: Use precomputed symbol indices, patch by Roman Divacky.
Benjamin Kramer [Wed, 25 Aug 2010 20:09:43 +0000 (20:09 +0000)]
MCELF: Use precomputed symbol indices, patch by Roman Divacky.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112079 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix header define to reflect the name of the file.
Eric Christopher [Wed, 25 Aug 2010 19:28:39 +0000 (19:28 +0000)]
Fix header define to reflect the name of the file.

Patch by Adam Treat!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112077 91177308-0d34-0410-b5e6-96231b3b80d8