summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
Commit message (Collapse)AuthorAgeFilesLines
* 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
* Add the braces gcc suggested.Daniel Dunbar2009-11-121-5/+8
| | | | llvm-svn: 86933
* 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
* Don't trivially delete unused calls to llvm.invariant.start. This allowsDuncan Sands2009-11-111-0/+3
| | | | | | | | | | | | | llvm.invariant.start to be used without necessarily being paired with a call to llvm.invariant.end. If you run the entire optimization pipeline then such calls are in fact deleted (adce does it), but that's actually a good thing since we probably do want them to be zapped late in the game. There should really be an integration test that checks that the llvm.invariant.start call lasts long enough that all passes that do interesting things with it get to do their stuff before it is deleted. But since no passes do anything interesting with it yet this will have to wait for later. llvm-svn: 86840
* remove the now dead condprop pass, PR3906.Chris Lattner2009-11-113-294/+0
| | | | llvm-svn: 86810
* 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
* Block terminator may be a switch.Evan Cheng2009-11-111-1/+1
| | | | llvm-svn: 86761
* Implement support to debug inlined functions.Devang Patel2009-11-102-4/+57
| | | | llvm-svn: 86748
* 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-102-85/+47
| | | | | | into libanalysis and transformutils. llvm-svn: 86735
* fix a crash in SCCP handling extractvalue of an array, pointed out andChris Lattner2009-11-101-3/+8
| | | | | | tracked down by Stephan Reiter! llvm-svn: 86726
* 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
* Generalize lsr code that optimize loop to count down towards zero.Evan Cheng2009-11-101-80/+126
| | | | llvm-svn: 86715
* Add defensive break.Duncan Sands2009-11-101-0/+1
| | | | llvm-svn: 86705
* Fix obvious typo.Duncan Sands2009-11-101-1/+1
| | | | llvm-svn: 86694
* clarify logic.Chris Lattner2009-11-101-4/+4
| | | | llvm-svn: 86689
* Teach DSE to eliminate useless trampolines.Duncan Sands2009-11-101-6/+19
| | | | llvm-svn: 86683
* Add brackets to make gcc-4.4 happy.Duncan Sands2009-11-101-3/+3
| | | | llvm-svn: 86681
* Update computeArraySize() to use ComputeMultiple() to determine the array ↵Victor Hernandez2009-11-101-7/+7
| | | | | | size associated with a malloc; also extend PerformHeapAllocSRoA() to check if the optimized malloc's arg had its highest bit set, so that it is safe for ComputeMultiple() to look through sext instructions while determining the optimized malloc's array size llvm-svn: 86676
* unify the code that determines whether it is a good idea to change the typeChris Lattner2009-11-101-27/+36
| | | | | | | of a computation. This fixes some infinite loops when dealing with TD that has no native types. llvm-svn: 86670
* Simplify.Nick Lewycky2009-11-101-3/+1
| | | | llvm-svn: 86668
* Reapply r86359, "Teach dead store elimination that certain intrinsics write toNick Lewycky2009-11-101-63/+118
| | | | | | | memory just like a store" with bug fixed (partial-overwrite.ll is the regression test). llvm-svn: 86667
* refactor TryToSimplifyUncondBranchFromEmptyBlock out of SimplifyCFG.Chris Lattner2009-11-102-164/+173
| | | | llvm-svn: 86666
* CMake: Support for building llvm loadable modules.Oscar Fuentes2009-11-101-1/+1
| | | | llvm-svn: 86656
* 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
* Fix DenseMap iterator constness.Jeffrey Yasskin2009-11-103-6/+6
| | | | | | | | | | | | | | | | | | | This patch forbids implicit conversion of DenseMap::const_iterator to DenseMap::iterator which was possible because DenseMapIterator inherited (publicly) from DenseMapConstIterator. Conversion the other way around is now allowed as one may expect. The template DenseMapConstIterator is removed and the template parameter IsConst which specifies whether the iterator is constant is added to DenseMapIterator. Actually IsConst parameter is not necessary since the constness can be determined from KeyT but this is not relevant to the fix and can be addressed later. Patch by Victor Zverovich! llvm-svn: 86636
* factor simplification logic for AND and OR out to InstSimplify from instcombine.Chris Lattner2009-11-101-85/+34
| | | | llvm-svn: 86635
* pull a bunch of logic out of instcombine into instsimplify for compare Chris Lattner2009-11-091-56/+13
| | | | | | simplification, this handles the foldable fcmp x,x cases among many others. llvm-svn: 86627
* inline a simple function.Chris Lattner2009-11-091-17/+20
| | | | llvm-svn: 86625
* rename SimplifyCompare -> SimplifyCmpInst and split it into Chris Lattner2009-11-092-1/+2
| | | | | | | Simplify[IF]Cmp pieces. Add some predicates to CmpInst to determine whether a predicate is fp or int. llvm-svn: 86624
* fix ConstantFoldCompareInstOperands to take the LHS/RHS asChris Lattner2009-11-091-2/+2
| | | | | | individual operands instead of taking a temporary array llvm-svn: 86619
* 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
* Fix a comment in a typo that Duncan noticed.Dan Gohman2009-11-091-1/+1
| | | | llvm-svn: 86575
* Generalize LCSSA to handle loops with exits with predecessors outsideDan Gohman2009-11-091-2/+14
| | | | | | | | | | | | the loop. This is needed because with indirectbr it may not be possible for LoopSimplify to guarantee that all loop exit predecessors are inside the loop. This fixes PR5437. LCCSA no longer actually requires LoopSimplify form, but for now it must still have the dependency because the PassManager doesn't know how to schedule LoopSimplify otherwise. llvm-svn: 86569
* if a 'with overflow' intrinsic just has the normal result used, simplifyChris Lattner2009-11-091-0/+41
| | | | | | it to a normal binop. Patch by Alastair Lynn, testcase by me. llvm-svn: 86524
* fix PR5104: when printing a single character, return the result ofChris Lattner2009-11-091-9/+13
| | | | | | putchar in case there is an error. llvm-svn: 86515
* enhance PHI slicing to handle the case when a slicable PHI is beginChris Lattner2009-11-091-74/+167
| | | | | | used by a chain of other PHIs. llvm-svn: 86503
* Small cleanups.Owen Anderson2009-11-091-8/+4
| | | | llvm-svn: 86499
* Revert my previous patch to ABCD and fix things the right way. There are ↵Owen Anderson2009-11-091-13/+28
| | | | | | | | | | | | | two problems addressed here: 1) We need to avoid processing sigma nodes as phi nodes for constraint generation. 2) We need to generate constraints for comparisons against constants properly. This includes our first working ABCD test! llvm-svn: 86498
* comment typos pointed out by DuncanChris Lattner2009-11-091-3/+3
| | | | llvm-svn: 86497
OpenPOWER on IntegriCloud