summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar/JumpThreading.cpp
Commit message (Collapse)AuthorAgeFilesLines
* fix PR5698Chris Lattner2009-12-061-0/+5
| | | | llvm-svn: 90708
* fix PR5640 by tracking whether a block is the header of a loop moreChris Lattner2009-12-011-3/+9
| | | | | | precisely, which prevents us from infinitely peeling the loop. llvm-svn: 90211
* make PRE of loads preserve the alignment of the moved load instruction.Chris Lattner2009-11-151-5/+8
| | | | llvm-svn: 88865
* fix a bug handling 'not x' when x is undef.Chris Lattner2009-11-151-2/+3
| | | | llvm-svn: 88864
* use getPredicateOnEdge to fold comparisons through PHI nodes,Chris Lattner2009-11-121-1/+11
| | | | | | | which implements GCC PR18046. This also gets us 360 more jump threads on 176.gcc. llvm-svn: 86953
* various fixes to the lattice transfer functions.Chris Lattner2009-11-121-0/+6
| | | | llvm-svn: 86952
* switch jump threading to use getPredicateOnEdge in one placeChris Lattner2009-11-121-10/+13
| | | | | | | | 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
* with the new code we can thread non-instruction values. ThisChris Lattner2009-11-121-1/+6
| | | | | | allows us to handle the test10 testcase. llvm-svn: 86924
* this argument can be an arbitrary value, it doesn't need to be an instruction.Chris Lattner2009-11-121-4/+3
| | | | llvm-svn: 86923
* expose edge information and switch j-t to use it.Chris Lattner2009-11-121-2/+2
| | | | llvm-svn: 86920
* pass TD into a SimplifyCmpInst call. Add another case thatChris Lattner2009-11-111-3/+24
| | | | | | uses LVI info when -enable-jump-threading-lvi is passed. llvm-svn: 86886
* stub out some LazyValueInfo interfaces, and have JumpThreadingChris Lattner2009-11-111-18/+45
| | | | | | | | 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
* add a fixmeChris Lattner2009-11-111-0/+4
| | | | llvm-svn: 86766
* implement a TODO by teaching jump threading about "xor x, 1".Chris Lattner2009-11-101-2/+14
| | | | llvm-svn: 86739
* move some generally useful functions out of jump threadingChris Lattner2009-11-101-83/+0
| | | | | | into libanalysis and transformutils. llvm-svn: 86735
* improve comment.Chris Lattner2009-11-101-2/+5
| | | | llvm-svn: 86723
* Make jump threading eliminate blocks that just contain phi nodes,Chris Lattner2009-11-101-0/+21
| | | | | | | | debug intrinsics, and an unconditional branch when possible. This reuses the TryToSimplifyUncondBranchFromEmptyBlock function split out of simplifycfg. llvm-svn: 86722
* make jump threading recursively simplify expressions instead of doing it Chris Lattner2009-11-101-20/+42
| | | | | | | | | | | | | | | | | | | 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
* don't invalidate PN, rewrite of this code is in progress anyway.Chris Lattner2009-11-101-4/+5
| | | | llvm-svn: 86639
* add a new SimplifyInstruction API, which is like ConstantFoldInstruction, Chris Lattner2009-11-101-6/+5
| | | | | | | | 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
* rename SimplifyCompare -> SimplifyCmpInst and split it into Chris Lattner2009-11-091-1/+1
| | | | | | | Simplify[IF]Cmp pieces. Add some predicates to CmpInst to determine whether a predicate is fp or int. llvm-svn: 86624
* use instructionsimplify instead of a weak clone of ad-hoc folding stuff.Chris Lattner2009-11-091-22/+2
| | | | llvm-svn: 86616
* stub out a new form of BasicBlock::RemovePredecessorAndSimplify whichChris Lattner2009-11-091-5/+65
| | | | | | | simplifies instruction users of PHIs when the phi is eliminated. This will be moved to transforms/utils after some other refactoring. llvm-svn: 86603
* comment typos pointed out by DuncanChris Lattner2009-11-091-3/+3
| | | | llvm-svn: 86497
* reapply 86289, 86278, 86270, 86267, 86266 & 86264 plus a fixChris Lattner2009-11-071-243/+363
| | | | | | | | | (making pred factoring only happen if threading is guaranteed to be successful). This now survives an X86-64 bootstrap of llvm-gcc. llvm-svn: 86355
* Revert following patches to fix llvmgcc bootstrap.Devang Patel2009-11-071-350/+234
| | | | | | | 86289, 86278, 86270, 86267, 86266 & 86264 Chris, please take a look. llvm-svn: 86321
* Avoid "ambiguous 'else'" warning from gcc.Jeffrey Yasskin2009-11-071-1/+2
| | | | llvm-svn: 86314
* Fix a bug where we'd call SplitBlockPredecessors with a pred in the Chris Lattner2009-11-061-2/+11
| | | | | | set only once even if it has multiple edges to BB. llvm-svn: 86299
* Remove function left over from other jump threading cleanup.Eli Friedman2009-11-061-24/+0
| | | | llvm-svn: 86289
* Fix a problem discovered on self host.Chris Lattner2009-11-061-1/+1
| | | | llvm-svn: 86278
* remove more code subsumed by r86264Chris Lattner2009-11-061-83/+17
| | | | llvm-svn: 86270
* eliminate some more code subsumed by r86264Chris Lattner2009-11-061-41/+4
| | | | llvm-svn: 86267
* remove now redundant code, r86264 handles this case.Chris Lattner2009-11-061-66/+0
| | | | llvm-svn: 86266
* Extend jump threading to support much more general threadingChris Lattner2009-11-061-27/+325
| | | | | | | | | | | | | | | | | | | | predicates. This allows us to jump thread things like: _ZN12StringSwitchI5ColorE4CaseILj7EEERS1_RAT__KcRKS0_.exit119: %tmp1.i24166 = phi i8 [ 1, %bb5.i117 ], [ %tmp1.i24165, %_Z....exit ], [ %tmp1.i24165, %bb4.i114 ] %toBoolnot.i87 = icmp eq i8 %tmp1.i24166, 0 ; <i1> [#uses=1] %tmp4.i90 = icmp eq i32 %tmp2.i, 6 ; <i1> [#uses=1] %or.cond173 = and i1 %toBoolnot.i87, %tmp4.i90 ; <i1> [#uses=1] br i1 %or.cond173, label %bb4.i96, label %_ZN12... Where it is "obvious" that when coming from %bb5.i117 that the 'and' is always false. This triggers a surprisingly high number of times in the testsuite, and gets us closer to generating good code for doug's strswitch testcase. This also make a bunch of other code in jump threading redundant, I'll rip out in the next patch. This survived an enable-checking llvm-gcc bootstrap. llvm-svn: 86264
* remove a bunch of extraneous LLVMContext argumentsChris Lattner2009-11-061-1/+1
| | | | | | from various APIs, addressing PR5325. llvm-svn: 86231
* improve DSE when TargetData is not around, based on work byChris Lattner2009-11-041-3/+0
| | | | | | Hans Wennborg! llvm-svn: 86067
* when folding duplicate conditions, delete the Chris Lattner2009-10-111-0/+2
| | | | | | now-probably-dead instruction tree feeding it. llvm-svn: 83778
* implement a transformation in jump threading that is currentlyChris Lattner2009-10-111-64/+218
| | | | | | | | | | done by condprop, but do it in a much more general form. The basic idea is that we can do a limited form of tail duplication in the case when we have a branch on a phi. Moving the branch up in to the predecessor block makes instruction selection much easier and encourages chained jump threadings. llvm-svn: 83759
* restructure some code, no functionality change.Chris Lattner2009-10-111-33/+29
| | | | llvm-svn: 83756
* factor some code better and move a function, no functionality change.Chris Lattner2009-10-111-81/+55
| | | | llvm-svn: 83755
* make jump threading on a phi with undef inputs happen.Chris Lattner2009-10-111-28/+54
| | | | llvm-svn: 83754
* Change jump threading to use the new SSAUpdater class instead of Chris Lattner2009-10-101-16/+43
| | | | | | | | | DemoteRegToStack. This makes it more efficient (because it isn't creating a ton of load/stores that are eventually removed by a later mem2reg), and more slightly more effective (because those load/stores don't get in the way of threading). llvm-svn: 83706
* Instruction::clone does not need to take an LLVMContext&. Remove that andNick Lewycky2009-09-271-1/+1
| | | | | | update all the callers. llvm-svn: 82889
* eliminate VISIBILITY_HIDDEN from Transforms/Scalar. PR4861Chris Lattner2009-09-021-2/+1
| | | | llvm-svn: 80766
* Push LLVMContexts through the IntegerType APIs.Owen Anderson2009-08-131-4/+7
| | | | llvm-svn: 78948
* Move getTrue() and getFalse() to 2.5-like APIs.Owen Anderson2009-07-311-2/+3
| | | | llvm-svn: 77685
* Move more code back to 2.5 APIs.Owen Anderson2009-07-301-2/+1
| | | | llvm-svn: 77635
* Move ConstantExpr to 2.5 API.Owen Anderson2009-07-291-1/+1
| | | | llvm-svn: 77494
* Remove Value::getName{Start,End}, the last of the old Name APIs.Daniel Dunbar2009-07-261-3/+3
| | | | llvm-svn: 77152
* Eliminate some uses of DOUT, cerr, and getNameStart().Daniel Dunbar2009-07-261-34/+35
| | | | llvm-svn: 77145
OpenPOWER on IntegriCloud