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
Chris Lattner
00e8e1e258
implement PR2328.
...
llvm-svn: 51176
2008-05-16 02:59:42 +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
Duncan Sands
15622620d3
Testcase for PR2303.
...
llvm-svn: 50951
2008-05-10 16:43:10 +00:00
Chris Lattner
02ca137915
Implement PR2298. This transforms:
...
~x < ~y --> y < x
-x == -y --> x == y
llvm-svn: 50882
2008-05-09 05:19:28 +00:00
Chris Lattner
4c1ef3628b
More than just loads can read from memory: readonly calls like strlen
...
also need to be checked for memory modifying instructions before we
can sink them. THis fixes the second half of PR2297.
llvm-svn: 50860
2008-05-08 17:37:37 +00:00
Chris Lattner
cba8b4c7e8
Make instcombine's DSE respect loads as well as stores. It is not safe to
...
delete the first store in:
store x -> p
load p
store y -> p
This is for PR2297.
llvm-svn: 50859
2008-05-08 17:20:30 +00:00
Dan Gohman
6ea87fa437
Fix a bug in the ComputeMaskedBits logic for multiply.
...
llvm-svn: 50793
2008-05-07 00:35:55 +00:00
Dan Gohman
faf9df7227
Correct the value of LowBits in srem and urem handling in
...
ComputeMaskedBits.
llvm-svn: 50692
2008-05-06 00:51:48 +00:00
Dan Gohman
27156711ef
Fix a mistake in the computation of leading zeros for udiv.
...
llvm-svn: 50591
2008-05-02 21:30:02 +00:00
Dan Gohman
04e2b94842
Update old-style syntax in some "not grep" tests.
...
llvm-svn: 50560
2008-05-01 23:50:07 +00:00
Dan Gohman
793c9fed45
Fix an overaggressive SimplifyDemandedBits optimization on urem. This
...
fixes the 254.gap regression on x86 and the 403.gcc regression on x86-64.
llvm-svn: 50537
2008-05-01 19:13:24 +00:00
Chris Lattner
d4bf588b85
move some tests from libcall optimizer suite.
...
llvm-svn: 50516
2008-05-01 06:13:48 +00:00
Chris Lattner
15195e00ee
move lowering of llvm.memset -> store from simplify libcalls
...
to instcombine.
llvm-svn: 50472
2008-04-30 06:39:11 +00:00
Chris Lattner
5bd55b0885
don't eliminate load from volatile value on paths where the load is dead.
...
This fixes the second half of PR2262
llvm-svn: 50430
2008-04-29 17:28:22 +00:00
Chris Lattner
4b5d48a3f0
make this test reduced and *valid*
...
llvm-svn: 50429
2008-04-29 17:25:32 +00:00
Chris Lattner
7099f3c400
fix a subtle volatile handling bug.
...
llvm-svn: 50428
2008-04-29 17:13:43 +00:00
Chris Lattner
51fe8415da
don't delete the last store to an alloca if the store is volatile.
...
llvm-svn: 50390
2008-04-29 04:58:38 +00:00
Dan Gohman
1b7238e6e4
Teach InstCombine's ComputeMaskedBits what SelectionDAG's
...
ComputeMaskedBits knows about cttz, ctlz, and ctpop. Teach
SelectionDAG's ComputeMaskedBits what InstCombine's knows
about SRem. And teach them both some things about high bits
in Mul, UDiv, URem, and Sub. This allows instcombine and
dagcombine to eliminate sign-extension operations in
several new cases.
llvm-svn: 50358
2008-04-28 17:02:21 +00:00
Chris Lattner
d059ac2e32
distill down the essense of this test.
...
llvm-svn: 50125
2008-04-23 03:03:42 +00:00
Dale Johannesen
547a55caf1
new test
...
llvm-svn: 50123
2008-04-23 01:22:22 +00:00
Evan Cheng
680839e258
Don't do: "(X & 4) >> 1 == 2 --> (X & 4) == 4" if there are more than one uses of the shift result.
...
llvm-svn: 50118
2008-04-23 00:38:06 +00:00
Chris Lattner
14be19cf1e
optimize "p != gep p, ..." better. This allows us to compile
...
getelementptr-seteq.ll into:
define i1 @test(i64 %X, %S* %P) {
%C = icmp eq i64 %X, -1 ; <i1> [#uses=1]
ret i1 %C
}
instead of:
define i1 @test(i64 %X, %S* %P) {
%A.idx.mask = and i64 %X, 4611686018427387903 ; <i64> [#uses=1]
%C = icmp eq i64 %A.idx.mask, 4611686018427387903 ; <i1> [#uses=1]
ret i1 %C
}
And fixes the second half of PR2235. This speeds up the insertion sort
case by 45%, from 1.12s to 0.77s. In practice, this will significantly
speed up for loops structured like:
for (double *P = Base + N; P != Base; --P)
...
Which happens frequently for C++ iterators.
llvm-svn: 50079
2008-04-22 02:53:33 +00:00
Chris Lattner
a9d8d647ca
rename *.llx -> *.ll, last batch.
...
llvm-svn: 49971
2008-04-19 22:32:52 +00:00
Dan Gohman
318d9a6605
Teach InstCombine's ComputeMaskedBits to handle pointer expressions
...
in addition to integer expressions. Rewrite GetOrEnforceKnownAlignment
as a ComputeMaskedBits problem, moving all of its special alignment
knowledge to ComputeMaskedBits as low-zero-bits knowledge.
Also, teach ComputeMaskedBits a few basic things about Mul and PHI
instructions.
This improves ComputeMaskedBits-based simplifications in a few cases,
but more noticeably it significantly improves instcombine's alignment
detection for loads, stores, and memory intrinsics.
llvm-svn: 49492
2008-04-10 18:43:06 +00:00
Evan Cheng
563b265f37
Handle a special case xor undef, undef -> 0. Technically this should be transformed to undef. But this is such a common idiom (misuse) we are going to handle it.
...
llvm-svn: 48791
2008-03-25 20:07:13 +00:00
Tanya Lattner
b6a27ed83f
Byebye llvm-upgrade!
...
llvm-svn: 48762
2008-03-25 04:26:08 +00:00
Evan Cheng
1d63708523
Transform (zext (or (icmp), (icmp))) to (or (zext (cimp), (zext icmp))) if at least one of the (zext icmp) can be transformed to eliminate an icmp.
...
llvm-svn: 48715
2008-03-24 00:21:34 +00:00
Chris Lattner
96cdf21ed4
Teach masked value is zero about add and sub, and use MVIZ to
...
simplify things like (X & 4) >> 1 == 2 --> (X & 4) == 4.
since it is obvious that the shift doesn't remove any bits.
llvm-svn: 48631
2008-03-21 05:19:58 +00:00
Tanya Lattner
60b7b29981
Upgrade tests to not use llvm-upgrade.
...
llvm-svn: 48483
2008-03-18 03:45:45 +00:00
Bill Wendling
7d054f8b3f
The inst combining of inttoptr into GEP with one index was using the bit size of
...
the type instead of the byte size. This was causing troublesome mis-compilations.
True to form, this took 2 days to find and is a one-line fix. :-P
llvm-svn: 48354
2008-03-14 05:12:19 +00:00
Tanya Lattner
9aa573954c
Remove llvm-upgrade and update tests.
...
llvm-svn: 48103
2008-03-09 08:16:40 +00:00
Nick Lewycky
c6edcb8904
Commit the testcase too.
...
llvm-svn: 47988
2008-03-06 06:50:03 +00:00
Nick Lewycky
f249c5d5ad
Don't try to simplify urem and srem using arithmetic rules that don't work
...
under modulo (overflow). Fixes PR1933.
llvm-svn: 47987
2008-03-06 06:48:30 +00:00
Tanya Lattner
c072619922
Remove llvm-upgrade and update test cases.
...
llvm-svn: 47793
2008-03-01 09:15:35 +00:00
Chris Lattner
5aeccb7353
Folding or(fcmp,fcmp) only works if the operands of the fcmps are the same fp type.
...
llvm-svn: 47750
2008-02-29 06:09:11 +00:00
Chris Lattner
9d19e558b7
fix this test so that the fn name doesn't match the regex
...
llvm-svn: 47608
2008-02-26 18:13:51 +00:00
Gabor Greif
a8990a9cac
Really feed llvm-as with the testcase, do not let it read from stdin. This fixes the hangs seen on solaris10.
...
llvm-svn: 47604
2008-02-26 13:37:13 +00:00
Zhou Sheng
5f4e29db89
Testcase for Revision 47478.
...
llvm-svn: 47531
2008-02-23 10:59:51 +00:00
Nick Lewycky
1f3c58df08
Correctly fold divide-by-constant, even when faced with overflow.
...
llvm-svn: 47287
2008-02-18 22:48:05 +00:00
Chris Lattner
9851db050b
optimize away stackrestore calls that have no intervening alloca or call.
...
llvm-svn: 47258
2008-02-18 06:12:38 +00:00
Chris Lattner
dd489bf3eb
upgrade this test.
...
llvm-svn: 47257
2008-02-18 06:11:00 +00:00
Chris Lattner
2fa904b3af
Fold (-x + -y) -> -(x+y) which promotes better association, fixing
...
the second half of PR2047
llvm-svn: 47244
2008-02-17 21:03:36 +00:00
Chris Lattner
96deed5d4d
Fix a bug compiling PR1978 (perhaps not the only one though) which
...
was incorrectly simplifying "x == (gep x, 1, i)" into false, even
though i could be negative. As it turns out, all the code to
handle this already existed, we just need to disable the incorrect
optimization case and let the general case handle it.
llvm-svn: 46739
2008-02-05 04:45:32 +00:00
Nick Lewycky
81cc718a25
Tag this test with the PR reference.
...
llvm-svn: 46688
2008-02-03 16:35:19 +00:00
Nick Lewycky
febd3642ce
There are some cases where icmp(add) can be folded into a new icmp. Handle them.
...
llvm-svn: 46687
2008-02-03 16:33:09 +00:00
Chris Lattner
83f411c586
eliminate additions of 0.0 when they are obviously dead. This has to be careful to
...
avoid turning -0.0 + 0.0 -> -0.0 which is incorrect.
llvm-svn: 46499
2008-01-29 06:52:45 +00:00