Gabor Greif
4a39cea7e7
resurrect lost tests by renaming them to not end with .tr
...
llvm-svn: 51375
2008-05-21 14:48:24 +00:00
Gabor Greif
b03785f0cd
Eliminate questionable syntax for stdin redirection. This probably also speeds things up a bit.
...
llvm-svn: 51357
2008-05-20 22:07:21 +00:00
Chris Lattner
821dc30131
Fix PR2346 by marking vaarg as volatile so that licm doesn't try to
...
hoist them.
llvm-svn: 51356
2008-05-20 22:05:28 +00:00
Dan Gohman
7d78d53d2a
Oops, commit the version of this test that actually works.
...
llvm-svn: 51351
2008-05-20 21:19:36 +00:00
Dan Gohman
b48d4a75f6
Port SelectionDAG's ComputeNumSignBits-using code to instcombine,
...
now that instcombine also has ComputeNumSignBits.
llvm-svn: 51350
2008-05-20 21:01:12 +00:00
Gabor Greif
807c2df887
sabre brings to my attention that the 'tr' suffix is also obsolete
...
llvm-svn: 51349
2008-05-20 21:00:03 +00:00
Gabor Greif
d8a4dbb5da
Rename the last test with .llx extension to .ll, resolve duplicate test by renaming to isnan2. Now that no test has llx ending there is no need to search for them from dg.exp too.
...
llvm-svn: 51328
2008-05-20 19:52:04 +00:00
Evan Cheng
55e3957c96
More local spiller complexity!
...
If local spiller optimization turns some instruction into an identity copy, it will be removed. If the output register happens to be dead (and source is obviously killed), transfer the kill / dead information to last use / def in the same MBB.
llvm-svn: 51306
2008-05-20 08:13:21 +00:00
Evan Cheng
408425f0e0
Don't spill dead def.
...
llvm-svn: 51305
2008-05-20 08:10:37 +00:00
Chris Lattner
b387fd90fc
Teach instcombine 4 new xforms:
...
(add (sext x), cst) --> (sext (add x, cst'))
(add (sext x), (sext y)) --> (sext (add int x, y))
(add double (sitofp x), fpcst) --> (sitofp (add int x, intcst))
(add double (sitofp x), (sitofp y)) --> (sitofp (add int x, y))
This generally reduces conversions. For example MiBench/telecomm-gsm
gets these simplifications:
HACK2: %tmp67.i142.i.i = sext i16 %tmp6.i141.i.i to i32 ; <i32> [#uses=1]
%tmp23.i139.i.i = sext i16 %tmp2.i138.i.i to i32 ; <i32> [#uses=1]
%tmp8.i143.i.i = add i32 %tmp67.i142.i.i, %tmp23.i139.i.i ; <i32> [#uses=3]
HACK2: %tmp67.i121.i.i = sext i16 %tmp6.i120.i.i to i32 ; <i32> [#uses=1]
%tmp23.i118.i.i = sext i16 %tmp2.i117.i.i to i32 ; <i32> [#uses=1]
%tmp8.i122.i.i = add i32 %tmp67.i121.i.i, %tmp23.i118.i.i ; <i32> [#uses=3]
HACK2: %tmp67.i.i190.i = sext i16 %tmp6.i.i189.i to i32 ; <i32> [#uses=1]
%tmp23.i.i187.i = sext i16 %tmp2.i.i186.i to i32 ; <i32> [#uses=1]
%tmp8.i.i191.i = add i32 %tmp67.i.i190.i, %tmp23.i.i187.i ; <i32> [#uses=3]
HACK2: %tmp67.i173.i.i.i = sext i16 %tmp6.i172.i.i.i to i32 ; <i32> [#uses=1]
%tmp23.i170.i.i.i = sext i16 %tmp2.i169.i.i.i to i32 ; <i32> [#uses=1]
%tmp8.i174.i.i.i = add i32 %tmp67.i173.i.i.i, %tmp23.i170.i.i.i ; <i32> [#uses=3]
HACK2: %tmp67.i152.i.i.i = sext i16 %tmp6.i151.i.i.i to i32 ; <i32> [#uses=1]
%tmp23.i149.i.i.i = sext i16 %tmp2.i148.i.i.i to i32 ; <i32> [#uses=1]
%tmp8.i153.i.i.i = add i32 %tmp67.i152.i.i.i, %tmp23.i149.i.i.i ; <i32> [#uses=3]
HACK2: %tmp67.i.i.i.i = sext i16 %tmp6.i.i.i.i to i32 ; <i32> [#uses=1]
%tmp23.i.i5.i.i = sext i16 %tmp2.i.i.i.i to i32 ; <i32> [#uses=1]
%tmp8.i.i7.i.i = add i32 %tmp67.i.i.i.i, %tmp23.i.i5.i.i ; <i32> [#uses=3]
This also fixes a bug in ComputeNumSignBits handling select and
makes it more aggressive with and/or.
llvm-svn: 51302
2008-05-20 05:46:13 +00:00
Dan Gohman
7681889f75
Run vortex-bug as x86-64, which is what the original bug was triggered on.
...
llvm-svn: 51289
2008-05-20 00:54:39 +00:00
Devang Patel
9f385d71c2
Do not erase induction variable increment if it is used outside the loop.
...
llvm-svn: 51280
2008-05-19 22:23:55 +00:00
Chris Lattner
63c384df1e
convert fptosi(sitofp x) -> x if the fp value has enough bits in its mantissa
...
to accurately represent the integer. This triggers 9 times in 471.omnetpp,
though 8 of those seem to be inlined from the same place.
llvm-svn: 51271
2008-05-19 20:25:04 +00:00
Chris Lattner
1435b94f62
Fold FP comparisons where one operand is converted from an integer
...
type and the other operand is a constant into integer comparisons.
This happens surprisingly frequently (e.g. 10 times in 471.omnetpp),
which are things like this:
%tmp8283 = sitofp i32 %tmp82 to double
%tmp1013 = fcmp ult double %tmp8283, 0.0
Clearly comparing tmp82 against i32 0 is cheaper here.
this also triggers 8 times in gobmk, including this one:
%tmp375376 = sitofp i32 %tmp375 to double
%tmp377 = fcmp ogt double %tmp375376, 8.150000e+01
which is comparing an integer against 81.5 :).
llvm-svn: 51268
2008-05-19 20:18:56 +00:00
Chris Lattner
510a6b249c
be more aggressive about transforming add -> or when the operands have no
...
intersecting bits. This triggers all over the place, for example in lencode,
with adds of stuff like:
%tmp580 = mul i32 %tmp579, 2
%tmp582 = and i32 %b8, 1
and
%tmp28 = shl i32 %abs.i, 1
%sign.0 = select i1 %tmp23, i32 1, i32 0
and
%tmp344 = shl i32 %tmp343, 2
%tmp346 = and i32 %tmp96, 3
etc.
llvm-svn: 51263
2008-05-19 20:01:56 +00:00
Duncan Sands
1c11cba7ec
Check that always_inline functions are inlined
...
whether or not -funit-at-a-time is used (C++ uses
it, C doesn't) - it was working before only when
not doing unit-at-a-time.
llvm-svn: 51258
2008-05-19 16:44:44 +00:00
Duncan Sands
7b84c36791
Fix PR2341 - when the length is 4 use an i32 not
...
an i16! Cleaned up trailing whitespace while there.
llvm-svn: 51240
2008-05-19 09:27:24 +00:00
Chris Lattner
8c0f0a0e6c
Fix PR2339
...
llvm-svn: 51226
2008-05-18 04:11:26 +00:00
Chris Lattner
8871489ae7
remove empty file?
...
llvm-svn: 51225
2008-05-18 04:10:18 +00:00
Nick Lewycky
46e3a168c0
Revert constant-folding change that will miscompile in some cases.
...
llvm-svn: 51223
2008-05-17 19:00:05 +00:00
Nick Lewycky
1df40102a9
Constant fold inttoptr and ptrtoint.
...
llvm-svn: 51216
2008-05-17 09:03:26 +00:00
Evan Cheng
76aaaf62e8
Fix test.
...
llvm-svn: 51191
2008-05-16 17:08:51 +00:00
Owen Anderson
55b78bc887
Move this test from ADCE to loop deletion, where it is more appropriate.
...
llvm-svn: 51181
2008-05-16 04:34:19 +00:00
Owen Anderson
79a25ff8ec
Use loop deletion instead of ADCE in these tests.
...
llvm-svn: 51180
2008-05-16 04:33:37 +00:00
Owen Anderson
d282184d18
Use loop deletion instead of ADCE for removing loops.
...
llvm-svn: 51178
2008-05-16 04:27:38 +00:00
Owen Anderson
3e607df2f8
Fix this test. It was testing broken behavior in that it required ADCE to eliminate
...
a potentially infinite loop, which is undesirable. Instead, test the LICM behavior
that we're really interested in.
llvm-svn: 51177
2008-05-16 04:25:09 +00:00
Chris Lattner
00e8e1e258
implement PR2328.
...
llvm-svn: 51176
2008-05-16 02:59:42 +00:00
Dale Johannesen
4e46c5601d
Use common where we mean common, not weak.
...
llvm-svn: 51173
2008-05-16 00:52:30 +00:00
Dan Gohman
fe7f6bc9ce
Revert the change from r51157 in
...
test/Verifier/2002-11-05-GetelementptrPointers.ll, which was incorrect.
Instead, fix getIndexedType to not follow pointer types, as
PointerType is a subclass of CompositeType.
llvm-svn: 51171
2008-05-16 00:16:32 +00:00
Dan Gohman
2da4145cd8
Fix a bug in LoopStrengthReduce that caused it to emit IR with
...
use-before-def. The problem comes up in code with multiple PHIs where
one PHI is being rewritten in terms of the other, but the other needs
to be casted first. LLVM rules requre the cast instruction to be
inserted after any PHI instructions, but when instructions were
inserted to replace the second PHI value with a function of the first,
they were ended up going before the cast instruction. Avoid this
problem by remembering the location of the cast instruction, when one
is needed, and inserting the expansion of the new value after it.
This fixes a bug that surfaced in 255.vortex on x86-64 when
instcombine was removed from the middle of the loop optimization
passes.
llvm-svn: 51169
2008-05-15 23:26:57 +00:00
Dale Johannesen
247e20c532
Remove the S92 code, which really has nothing to do
...
with what the test is testing; makes it pass again on ppc32.
llvm-svn: 51167
2008-05-15 22:23:54 +00:00
Dale Johannesen
f464bece2d
Evan has implemented this on ppc, so run the test there.
...
llvm-svn: 51166
2008-05-15 22:22:37 +00:00
Dan Gohman
821bf58428
IR support for extractvalue and insertvalue instructions. Also, begin
...
moving toward making structs and arrays first-class types.
llvm-svn: 51157
2008-05-15 19:50:34 +00:00
Bill Wendling
c1d9f9604b
Situations can arise when you have a function called that returns a 'void', but
...
is bitcast to return a floating point value. The result of the instruction may
not be used by the program afterwards, and LLVM will happily remove all
instructions except the call. But, on some platforms, if a value is returned as
a floating point, it may need to be removed from the stack (like x87). Thus, we
can't get rid of the bitcast even if there isn't a use of the value.
llvm-svn: 51134
2008-05-14 22:45:20 +00:00
Devang Patel
047ba6df54
Simplify internalize pass. Add test case.
...
Patch by Matthijs Kooijman!
llvm-svn: 51114
2008-05-14 20:01:01 +00:00
Dan Gohman
cd29e1fa60
When bit-twiddling CondCode values for integer comparisons produces
...
SETOEQ, is it does with (SETEQ & SETULE), map it to SETEQ.
llvm-svn: 51112
2008-05-14 18:17:09 +00:00
Tanya Lattner
ecd5a9390a
Check if llvm-gcc is available before running tests. Patch by Matthijs Kooijman!
...
llvm-svn: 51108
2008-05-14 16:32:44 +00:00
Duncan Sands
d1ee8534e8
Make this test pass on x86-32 linux.
...
llvm-svn: 51099
2008-05-14 09:46:01 +00:00
Dale Johannesen
676a1d026b
Fix for PR 2323, infinite loop in tail dup.
...
llvm-svn: 51063
2008-05-13 20:06:43 +00:00
Evan Cheng
9e15622879
Instead of a vector load, shuffle and then extract an element. Load the element from address with an offset.
...
pshufd $1, (%rdi), %xmm0
movd %xmm0, %eax
=>
movl 4(%rdi), %eax
llvm-svn: 51026
2008-05-13 08:35:03 +00:00
Owen Anderson
f67c06279b
Add a testcase for non-local CSE of read-only calls.
...
llvm-svn: 51025
2008-05-13 08:17:44 +00:00
Evan Cheng
e4ee4c2870
On x86, it's safe to treat i32 load anyext as a normal i32 load. Ditto for i8 anyext load to i16.
...
llvm-svn: 51019
2008-05-13 00:54:02 +00:00
Evan Cheng
fcbdc8bd6e
Xform bitconvert(build_pair(load a, load b)) to a single load if the load locations are at the right offset from each other.
...
llvm-svn: 51008
2008-05-12 23:04:07 +00:00
Dale Johannesen
b54491d31a
New test for tail merging
...
llvm-svn: 51007
2008-05-12 22:59:44 +00:00
Mikhail Glushenkov
18508c5df4
Filter option names to escape symbols not allowed as C++ identifiers.
...
Makes it possible to use options with names like "Wa,".
Also fixes the -Wall option handling as a side-effect.
llvm-svn: 50973
2008-05-12 16:33:06 +00:00
Duncan Sands
45b1810980
Testcase for PR2264.
...
llvm-svn: 50965
2008-05-12 13:01:19 +00:00
Duncan Sands
15622620d3
Testcase for PR2303.
...
llvm-svn: 50951
2008-05-10 16:43:10 +00:00
Evan Cheng
c19c639ad7
When transforming a vector_shuffle to a load, the base address must not be an undef.
...
llvm-svn: 50940
2008-05-10 06:46:49 +00:00
Evan Cheng
fc4b8e1d96
Add nounwind.
...
llvm-svn: 50931
2008-05-10 02:22:25 +00:00
Evan Cheng
cf4d5567d5
If all sources of a PHI node are defined by an implicit_def, just emit an implicit_def instead of a copy.
...
llvm-svn: 50927
2008-05-10 00:17:50 +00:00