Chris Lattner
25a198e72b
remove some special shift cases that have been subsumed into the
...
more general simplify demanded bits logic.
llvm-svn: 112291
2010-08-27 21:04:34 +00:00
Dan Gohman
c866bf4fec
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.
llvm-svn: 112290
2010-08-27 20:45:56 +00:00
Chris Lattner
606b76eba6
merge and filecheckize test
...
llvm-svn: 112289
2010-08-27 20:44:45 +00:00
Chris Lattner
c665156e9f
merge two tests
...
llvm-svn: 112288
2010-08-27 20:42:10 +00:00
Bill Wendling
6628431a91
Remove now unneeded command line flag that enables 'optimize compares.'
...
llvm-svn: 112287
2010-08-27 20:39:09 +00:00
Owen Anderson
99d4cb861b
Fix typos in comments.
...
llvm-svn: 112286
2010-08-27 20:32:56 +00:00
Chris Lattner
7398434675
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.
llvm-svn: 112285
2010-08-27 20:32:06 +00:00
Dan Gohman
9bad2fb378
Switch ScalarEvolution's main Value*->SCEV* map from std::map
...
to DenseMap.
llvm-svn: 112281
2010-08-27 18:55:03 +00:00
Chris Lattner
7413e87b6d
get this test passing on linux builders.
...
llvm-svn: 112280
2010-08-27 18:49:08 +00:00
Chris Lattner
90cd746e63
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.
llvm-svn: 112278
2010-08-27 18:31:05 +00:00
Bob Wilson
edf722add3
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.
llvm-svn: 112271
2010-08-27 17:13:24 +00:00
Owen Anderson
6ebbd92380
Use LVI to eliminate conditional branches where we've tested a related condition previously. Update tests for this change.
...
This fixes PR5652.
llvm-svn: 112270
2010-08-27 17:12:29 +00:00
Dan Gohman
2706567c5c
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.
llvm-svn: 112267
2010-08-27 15:26:01 +00:00
Dan Gohman
ca15841394
Clarify a comment.
...
llvm-svn: 112266
2010-08-27 15:16:40 +00:00
Dan Gohman
fa4a4705f9
Parse " (Hidden)" and cope with it.
...
llvm-svn: 112265
2010-08-27 15:16:09 +00:00
Dan Gohman
7e64c985fb
Default to looking for clang++ in the PATH, rather than trying to
...
guess a path that will work.
llvm-svn: 112264
2010-08-27 15:15:31 +00:00
Anton Korobeynikov
c0b36921c2
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!
llvm-svn: 112262
2010-08-27 14:43:06 +00:00
Benjamin Kramer
1f6012479f
MCELF: Port EmitInstruction changes from MachO streamer. Patch by Roman Divacky.
...
llvm-svn: 112260
2010-08-27 10:40:51 +00:00
Benjamin Kramer
05e22982c8
MCELF: Always overwrite FixedValue.
...
llvm-svn: 112259
2010-08-27 10:38:39 +00:00
Michael J. Spencer
788a6079e1
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.
llvm-svn: 112257
2010-08-27 02:49:45 +00:00
Daniel Dunbar
1844a71e66
X86: Fix an encoding issue with LOCK_ADD64mr, which could lead to very hard to find miscompiles with the integrated assembler.
...
llvm-svn: 112250
2010-08-27 01:30:14 +00:00
Devang Patel
b12ff5999e
Revert r112213. It is not needed.
...
llvm-svn: 112242
2010-08-26 23:35:15 +00:00
Jim Grosbach
6a77066913
Simplify eliminateFrameIndex() interface back down now that PEI doesn't need
...
to try to re-use scavenged frame index reference registers. rdar://8277890
llvm-svn: 112241
2010-08-26 23:32:16 +00:00
Devang Patel
ea134f56b1
If node is not available then use FuncInfo.ValueMap to emit debug info for byval parameter.
...
llvm-svn: 112238
2010-08-26 22:53:27 +00:00
Jim Grosbach
2a1915d04b
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.
llvm-svn: 112237
2010-08-26 22:42:12 +00:00
Chris Lattner
c188b96bbe
filecheckize
...
llvm-svn: 112235
2010-08-26 22:23:39 +00:00
Chris Lattner
387d6bcdcb
rename test.
...
llvm-svn: 112234
2010-08-26 22:20:47 +00:00
Chris Lattner
bfd2228182
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.
llvm-svn: 112232
2010-08-26 22:14:59 +00:00
Jim Grosbach
e82d5b4aaf
tidy up a bit. no functional change.
...
llvm-svn: 112228
2010-08-26 21:56:30 +00:00
Chris Lattner
d4ebd6df5a
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.
llvm-svn: 112227
2010-08-26 21:55:42 +00:00
Chris Lattner
3c19d3d5c3
filecheckize
...
llvm-svn: 112225
2010-08-26 21:51:41 +00:00
Chris Lattner
7717c616bd
rename test
...
llvm-svn: 112224
2010-08-26 21:50:56 +00:00
Chris Lattner
e14ae4ec24
add m_BitCast for matching a bitcast.
...
llvm-svn: 112222
2010-08-26 21:35:52 +00:00
Jim Grosbach
17da935964
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.
llvm-svn: 112220
2010-08-26 21:29:54 +00:00
Bruno Cardoso Lopes
e25ba0c7c2
zap the now unused MVT::getIntVectorWithNumElements
...
llvm-svn: 112218
2010-08-26 20:53:12 +00:00
Devang Patel
42b4ac7ed3
Speculatively revert r112207.
...
llvm-svn: 112216
2010-08-26 20:33:42 +00:00
Devang Patel
977057f481
80 col.
...
llvm-svn: 112215
2010-08-26 20:32:32 +00:00
Devang Patel
384fa91deb
Update DanglingDebugInfo so that it can be used to track llvm.dbg.declare also.
...
llvm-svn: 112213
2010-08-26 20:06:46 +00:00
Bob Wilson
97919e9c59
Use pseudo instructions for VST3.
...
llvm-svn: 112208
2010-08-26 18:51:29 +00:00
Devang Patel
ab596a637c
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.
...
llvm-svn: 112207
2010-08-26 18:36:14 +00:00
Bill Wendling
a9c03f4fae
Reapply r112176 without removing the other CMN patterns (that was unintentional).
...
llvm-svn: 112206
2010-08-26 18:33:51 +00:00
Dan Gohman
f34728a95c
Experimental clang-based code-completion support for vim. This currently
...
depends on some clang patches which are not yet upstream.
llvm-svn: 112204
2010-08-26 18:12:22 +00:00
Benjamin Kramer
2c45f431fa
MCELF: Fix a thinko of mine.
...
llvm-svn: 112203
2010-08-26 18:12:04 +00:00
Bob Wilson
a967c42a3d
Fix comment typos.
...
llvm-svn: 112202
2010-08-26 18:08:11 +00:00
Devang Patel
7b888fbd91
Fix prototypes.
...
llvm-svn: 112200
2010-08-26 17:47:45 +00:00
Owen Anderson
bd2ecc7e68
Make JumpThreading smart enough to properly thread StrSwitch when it's compiled with clang++.
...
llvm-svn: 112198
2010-08-26 17:40:24 +00:00
Benjamin Kramer
929cc7618f
MCELF: Compensate for the addend on i386. Patch by Roman Divacky, with some cleanups.
...
llvm-svn: 112197
2010-08-26 17:23:02 +00:00
Jim Grosbach
074d22e1ac
Restrict the register to tGPR to make sure the str instruction will be
...
encodable as a 16-bit wide instruction.
llvm-svn: 112195
2010-08-26 17:02:47 +00:00
Dan Gohman
10b20b2b81
Revert r112176; it broke test/CodeGen/Thumb2/thumb2-cmn.ll.
...
llvm-svn: 112191
2010-08-26 15:50:25 +00:00
Dan Gohman
ca26f79051
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.
llvm-svn: 112190
2010-08-26 15:41:53 +00:00