Nick Lewycky
76fbcdaaa7
Remove LLVMContext and its include.
...
llvm-svn: 89644
2009-11-23 03:34:29 +00:00
Nick Lewycky
9d1ee635e3
Reapply r88830 with a bugfix: this transform only applies to icmp eq/ne. This
...
fixes part of PR5438.
llvm-svn: 89639
2009-11-23 03:17:33 +00:00
Eric Christopher
455f4d8400
Add more optimizations for object size checking, enable handling of
...
object size intrinsic and verify return type is correct. Collect various
code in one place.
llvm-svn: 89523
2009-11-21 01:01:30 +00:00
Dan Gohman
94cca19d9d
Fix IPSCCP's code for deleting dead blocks to tolerate outstanding
...
blockaddress users. This fixes PR5569.
llvm-svn: 89483
2009-11-20 20:19:14 +00:00
Daniel Dunbar
09a7f92b02
Revert "Add some rough optimizations for checking routines.", it buildeth not.
...
llvm-svn: 89482
2009-11-20 20:17:30 +00:00
Eric Christopher
61485dfd00
Add some rough optimizations for checking routines.
...
llvm-svn: 89479
2009-11-20 19:57:37 +00:00
Duncan Sands
5f5ec2a6ec
Fix PR5563, an expensive checks failure when running on
...
tests/Transforms/InstCombine/shufflemask-undef.ll. If
anyone cares, the use of 2*e here (and the equivalent
all over the place in instcombine) seems wrong, though
harmless: it should really be twice the length of the
input vector. I think shufflevector used to require
that the mask have the same length as the input, but I
don't think that's true any more. I don't care enough
about vectors to do anything about this...
llvm-svn: 89456
2009-11-20 13:19:51 +00:00
Dan Gohman
026230b0a9
Enable hoisting of loads from constant memory by default. In cases where
...
they are lowered to instruction sequences more complex than a simple
load, such that CodeGen cannot rematerialize them, a reload from a
spill slot is likely to be cheaper than the complex sequence.
llvm-svn: 89374
2009-11-19 19:00:10 +00:00
Jim Grosbach
2853c74dc9
grammar
...
llvm-svn: 89145
2009-11-17 21:37:04 +00:00
Jim Grosbach
1aa8f6c5c7
80-column violations
...
llvm-svn: 89123
2009-11-17 19:05:35 +00:00
Evan Cheng
aaa58b7653
Generalize OptimizeLoopTermCond to optimize more loop terminating icmp to use postinc iv.
...
llvm-svn: 89116
2009-11-17 18:10:11 +00:00
Jim Grosbach
5851dbf184
Remove trailing whitespace
...
llvm-svn: 89110
2009-11-17 17:53:56 +00:00
David Greene
47e8728c22
Fix an expensive-checks error.
...
The Mask and LHSMask may not be of the same size, so don't do the
transformation if they're different.
llvm-svn: 88972
2009-11-16 21:52:23 +00:00
Duncan Sands
03e15012ed
CreateIntCast takes an "isSigned" parameter. Pass "true" for it, rather than
...
a name.
llvm-svn: 88908
2009-11-16 12:32:28 +00:00
Chris Lattner
15cd19dddb
make PRE of loads preserve the alignment of the moved load instruction.
...
llvm-svn: 88865
2009-11-15 19:58:31 +00:00
Chris Lattner
59f69de88f
fix a bug handling 'not x' when x is undef.
...
llvm-svn: 88864
2009-11-15 19:57:43 +00:00
Nick Lewycky
f05946faff
Revert r88830 and r88831 which appear to have caused a selfhost buildbot some
...
grief. I suspect this patch merely exposed a bug else.
llvm-svn: 88841
2009-11-15 07:47:32 +00:00
Nick Lewycky
14a2122db3
Teach instcombine to look for booleans in wider integers when it encounters a
...
zext(icmp). It may be able to optimize that away. This fixes one of the cases
in PR5438.
llvm-svn: 88830
2009-11-15 05:55:17 +00:00
Nick Lewycky
316e082216
Remove LLVMContext from reassociate. It was threaded through every function but
...
ultimately never used.
llvm-svn: 88763
2009-11-14 07:25:54 +00:00
Dan Gohman
406baaac43
Add an option for running GVN with redundant load processing disabled.
...
llvm-svn: 88742
2009-11-14 02:27:51 +00:00
Owen Anderson
81f2ff1d61
Re-enable this code, since redundant PHIs are now being better nuked.
...
llvm-svn: 87042
2009-11-12 23:22:41 +00:00
Evan Cheng
b0a193db31
- Teach LSR to avoid changing cmp iv stride if it will create an immediate that
...
cannot be folded into target cmp instruction.
- Avoid a phase ordering issue where early cmp optimization would prevent the
later count-to-zero optimization.
- Add missing checks which could cause LSR to reuse stride that does not have
users.
- Fix a bug in count-to-zero optimization code which failed to find the pre-inc
iv's phi node.
- Remove, tighten, loosen some incorrect checks disable valid transformations.
- Quite a bit of code clean up.
llvm-svn: 86969
2009-11-12 07:35:05 +00:00
Chris Lattner
01fddcec53
use getPredicateOnEdge to fold comparisons through PHI nodes,
...
which implements GCC PR18046. This also gets us 360 more
jump threads on 176.gcc.
llvm-svn: 86953
2009-11-12 05:24:05 +00:00
Chris Lattner
3e63fb7318
various fixes to the lattice transfer functions.
...
llvm-svn: 86952
2009-11-12 04:57:13 +00:00
Chris Lattner
c1619b4fe9
switch jump threading to use getPredicateOnEdge in one place
...
making the new LVI stuff smart enough to subsume some special
cases in the old code. Disable them when LVI is around, the
testcase still passes.
llvm-svn: 86951
2009-11-12 04:37:50 +00:00
Chris Lattner
68f3b53ddc
with the new code we can thread non-instruction values. This
...
allows us to handle the test10 testcase.
llvm-svn: 86924
2009-11-12 01:41:34 +00:00
Chris Lattner
ea8b237a74
this argument can be an arbitrary value, it doesn't need to be an instruction.
...
llvm-svn: 86923
2009-11-12 01:37:43 +00:00
Chris Lattner
b5bb115ece
expose edge information and switch j-t to use it.
...
llvm-svn: 86920
2009-11-12 01:29:10 +00:00
Chris Lattner
73b7ed2d9c
pass TD into a SimplifyCmpInst call. Add another case that
...
uses LVI info when -enable-jump-threading-lvi is passed.
llvm-svn: 86886
2009-11-11 22:31:38 +00:00
Chris Lattner
36009e416c
remove the now dead condprop pass, PR3906.
...
llvm-svn: 86810
2009-11-11 05:56:35 +00:00
Chris Lattner
b45381c3f0
stub out some LazyValueInfo interfaces, and have JumpThreading
...
start using them in a trivial way when -enable-jump-threading-lvi
is passed. enable-jump-threading-lvi will be my playground for
awhile.
llvm-svn: 86789
2009-11-11 02:08:33 +00:00
Chris Lattner
c1709a798a
add a fixme
...
llvm-svn: 86766
2009-11-11 00:21:58 +00:00
Evan Cheng
ea76ec6720
Block terminator may be a switch.
...
llvm-svn: 86761
2009-11-11 00:00:21 +00:00
Chris Lattner
f66a81aecd
implement a TODO by teaching jump threading about "xor x, 1".
...
llvm-svn: 86739
2009-11-10 22:39:16 +00:00
Chris Lattner
ec4264fbb0
move some generally useful functions out of jump threading
...
into libanalysis and transformutils.
llvm-svn: 86735
2009-11-10 22:26:15 +00:00
Chris Lattner
a163be92fc
fix a crash in SCCP handling extractvalue of an array, pointed out and
...
tracked down by Stephan Reiter!
llvm-svn: 86726
2009-11-10 22:02:09 +00:00
Chris Lattner
f48b199c43
improve comment.
...
llvm-svn: 86723
2009-11-10 21:45:09 +00:00
Chris Lattner
fca84b3dff
Make jump threading eliminate blocks that just contain phi nodes,
...
debug intrinsics, and an unconditional branch when possible. This
reuses the TryToSimplifyUncondBranchFromEmptyBlock function split
out of simplifycfg.
llvm-svn: 86722
2009-11-10 21:40:01 +00:00
Evan Cheng
f5e85bec73
Generalize lsr code that optimize loop to count down towards zero.
...
llvm-svn: 86715
2009-11-10 21:14:05 +00:00
Duncan Sands
1053bb18c6
Add defensive break.
...
llvm-svn: 86705
2009-11-10 19:36:40 +00:00
Duncan Sands
bfba3451b2
Fix obvious typo.
...
llvm-svn: 86694
2009-11-10 18:21:37 +00:00
Chris Lattner
dc0722e39a
clarify logic.
...
llvm-svn: 86689
2009-11-10 17:00:47 +00:00
Duncan Sands
732a2ed037
Teach DSE to eliminate useless trampolines.
...
llvm-svn: 86683
2009-11-10 13:49:50 +00:00
Duncan Sands
a25c87ef1f
Add brackets to make gcc-4.4 happy.
...
llvm-svn: 86681
2009-11-10 09:32:10 +00:00
Chris Lattner
562cc40dbb
unify the code that determines whether it is a good idea to change the type
...
of a computation. This fixes some infinite loops when dealing with TD that
has no native types.
llvm-svn: 86670
2009-11-10 07:23:37 +00:00
Nick Lewycky
4939d449e1
Simplify.
...
llvm-svn: 86668
2009-11-10 07:00:43 +00:00
Nick Lewycky
f6be02e523
Reapply r86359, "Teach dead store elimination that certain intrinsics write to
...
memory just like a store" with bug fixed (partial-overwrite.ll is the
regression test).
llvm-svn: 86667
2009-11-10 06:46:40 +00:00
Chris Lattner
f3fc70a936
make jump threading recursively simplify expressions instead of doing it
...
just one level deep. On the testcase we go from getting this:
F1: ; preds = %T2
%F = and i1 true, %cond ; <i1> [#uses=1]
br i1 %F, label %X, label %Y
to a fully threaded:
F1: ; preds = %T2
br label %Y
This changes gets us to the point where we're forming (too many) switch
instructions on doug's strswitch testcase.
llvm-svn: 86646
2009-11-10 01:57:31 +00:00
Chris Lattner
a087a1ca04
don't invalidate PN, rewrite of this code is in progress anyway.
...
llvm-svn: 86639
2009-11-10 01:19:06 +00:00
Chris Lattner
a279728372
add a new SimplifyInstruction API, which is like ConstantFoldInstruction,
...
except that the result may not be a constant. Switch jump threading to
use it so that it gets things like (X & 0) -> 0, which occur when phi preds
are deleted and the remaining phi pred was a zero.
llvm-svn: 86637
2009-11-10 01:08:51 +00:00