summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Utils/LoopSimplify.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Fix LoopSimplify to notify ScalarEvolution when splitting a loop backedgeDan Gohman2010-09-041-1/+10
| | | | | | | into an inner loop, as the new loop iteration may differ substantially. This fixes PR8078. llvm-svn: 113057
* Now that PassInfo and Pass::ID have been separated, move the rest of the ↵Owen Anderson2010-08-231-2/+2
| | | | | | passes over to the new registration API. llvm-svn: 111815
* Avoid #include <ScalarEvolution.h> in LoopSimplify.cpp, which doesn'tDan Gohman2010-08-161-2/+1
| | | | | | actually use ScalarEvolution. llvm-svn: 111124
* LoopSimplify shouldn't split loop backedges that use indirectbr. PR7867.Dan Gohman2010-08-141-0/+5
| | | | llvm-svn: 111061
* Reapply r110396, with fixes to appease the Linux buildbot gods.Owen Anderson2010-08-061-2/+2
| | | | llvm-svn: 110460
* Revert r110396 to fix buildbots.Owen Anderson2010-08-061-2/+2
| | | | llvm-svn: 110410
* Don't use PassInfo* as a type identifier for passes. Instead, use the ↵Owen Anderson2010-08-051-2/+2
| | | | | | | | address of the static ID member as the sole unique type identifier. Clean up APIs related to this change. llvm-svn: 110396
* Remove LCSSA's bogus dependence on LoopSimplify and LoopSimplify's bogusDan Gohman2010-07-261-9/+4
| | | | | | | | | | | | | | dependence on DominanceFrontier. Instead, add an explicit DominanceFrontier pass in StandardPasses.h to ensure that it gets scheduled at the right time. Declare that loop unrolling preserves ScalarEvolution, and shuffle some getAnalysisUsages. This eliminates one LoopSimplify and one LCCSA run in the standard compile opts sequence. llvm-svn: 109413
* keep in 80 colsGabor Greif2010-07-221-3/+4
| | | | llvm-svn: 109122
* Reorder the contents of various getAnalysisUsage functions, eliminatingDan Gohman2010-07-161-3/+10
| | | | | | a redundant loopsimplify run from the default -O2 sequence. llvm-svn: 108539
* cache result of operator*Gabor Greif2010-07-091-2/+4
| | | | llvm-svn: 107983
* cache operator*'s result (in multiple functions)Gabor Greif2010-07-091-15/+22
| | | | llvm-svn: 107965
* Use pre-increment instead of post-increment when the result is not used.Dan Gohman2010-06-221-3/+3
| | | | llvm-svn: 106542
* Skip debug info intrinsics.Devang Patel2010-03-151-0/+4
| | | | llvm-svn: 98581
* Fix a comment.Dan Gohman2010-03-101-1/+1
| | | | llvm-svn: 98122
* Add some debug output to LoopSimplify.Dan Gohman2010-03-011-0/+30
| | | | llvm-svn: 97458
* Make LoopSimplify change conditional branches in loop exiting blocksDan Gohman2010-02-251-2/+16
| | | | | | | | | | | | which branch on undef to branch on a boolean constant for the edge exiting the loop. This helps ScalarEvolution compute trip counts for loops. Teach ScalarEvolution to recognize single-value PHIs, when safe, and ForgetSymbolicName to forget such single-value PHI nodes as apprpriate in ForgetSymbolicName. llvm-svn: 97126
* Use a SmallSetVector instead of a SetVector; this code showed up as aDan Gohman2010-02-051-2/+3
| | | | | | malloc caller in a profile. llvm-svn: 95407
* Fix a comment typo.Bob Wilson2010-01-151-1/+1
| | | | llvm-svn: 93560
* revert r89298, which was committed without a testcase. I thinkChris Lattner2009-12-211-6/+0
| | | | | | the underlying PHI node insertion issue in SSAUpdate is fixed. llvm-svn: 91821
* Update a comment.Dan Gohman2009-12-181-1/+1
| | | | llvm-svn: 91645
* Make Loop::getLoopLatch() work on loops which don't have preheaders, asDan Gohman2009-11-201-1/+6
| | | | | | | | | | | | it may be used in contexts where preheader insertion may have failed due to an indirectbr. Make LoopSimplify's LoopSimplify::SeparateNestedLoop properly fail in the case that it would require splitting an indirectbr edge. These fix PR5502. llvm-svn: 89484
* Eliminate duplicate phi nodes in loops. Loop rotation, for example, can ↵Jim Grosbach2009-11-191-0/+6
| | | | | | introduce these, and it's beneficial to later passes to clean them up. llvm-svn: 89298
* Avoid calling getUniqueExitBlocks from within LoopSimplify, as it dependsDan Gohman2009-11-051-1/+8
| | | | | | | on loops having dedicated exits, which LoopSimplify can no longer always guarantee. llvm-svn: 86181
* The introduction of indirectbr meant the introduction ofDan Gohman2009-11-051-21/+82
| | | | | | | | | unsplittable critical edges, which means the introduction of loops which cannot be transformed to LoopSimplify form. Fix LoopSimplify to avoid transforming such loops into invalid code. llvm-svn: 86176
* Remove includes of Support/Compiler.h that are no longer needed after theNick Lewycky2009-10-251-1/+0
| | | | | | VISIBILITY_HIDDEN removal. llvm-svn: 85043
* Remove VISIBILITY_HIDDEN from class/struct found inside anonymous namespaces.Nick Lewycky2009-10-251-1/+1
| | | | | | | Chris claims we should never have visibility_hidden inside any .cpp file but that's still not true even after this commit. llvm-svn: 85042
* Fix this code so that it doesn't try to iterate through a std::vectorDan Gohman2009-09-301-3/+4
| | | | | | | while calling changeImmediateDominator, which removes elements from the vector. This fixes PR5097. llvm-svn: 83166
* Convert LoopSimplify and LoopExtractor from FunctionPass to LoopPass.Dan Gohman2009-09-281-83/+48
| | | | llvm-svn: 82990
* Re-apply r80926, with fixes: keep the domtree informed of new blocksDan Gohman2009-09-081-29/+11
| | | | | | | | | | | | | | | that get created during loop unswitching, and fix SplitBlockPredecessors' LCSSA updating code to create new PHIs instead of trying to just move existing ones. Also, optimize Loop::verifyLoop, since it gets called a lot. Use searches on a sorted list of blocks instead of calling the "contains" function, as is done in other places in the Loop class, since "contains" does a linear search. Also, don't call verifyLoop from LoopSimplify or LCSSA, as the PassManager is already calling verifyLoop as part of LoopInfo's verifyAnalysis. llvm-svn: 81221
* Revert r80926. It causes loop unswitch assertion and slow down some JIT ↵Evan Cheng2009-09-061-12/+28
| | | | | | tests significantly. llvm-svn: 81101
* Add a verifyAnalysis to LoopInfo, LoopSimplify, and LCSSA form that verifyDan Gohman2009-09-031-28/+12
| | | | | | | | | that these passes are properly preserved. Fix several transformation passes that claimed to preserve LoopSimplify form but weren't. llvm-svn: 80926
* Change PHINode::hasConstantValue to have a DominatorTree argumentDan Gohman2009-09-031-9/+8
| | | | | | | | instead of a bool argument, and to do the dominator check itself. This makes it eaiser to use when DominatorTree information is available. llvm-svn: 80920
* Push LLVMContexts through the IntegerType APIs.Owen Anderson2009-08-131-2/+3
| | | | llvm-svn: 78948
* Move more code back to 2.5 APIs.Owen Anderson2009-07-301-1/+1
| | | | llvm-svn: 77635
* Get rid of the Pass+Context magic.Owen Anderson2009-07-221-1/+1
| | | | llvm-svn: 76702
* Make makeLoopInvariant report whether it made any changes or not,Dan Gohman2009-07-151-6/+4
| | | | | | and use this to simplify more code. llvm-svn: 75722
* Update LoopSimplify and LoopUnswitch to use the new makeLoopInvariantDan Gohman2009-07-141-14/+9
| | | | | | function. llvm-svn: 75584
* More LLVMContext-ification.Owen Anderson2009-07-051-1/+2
| | | | llvm-svn: 74807
* Minor code simplification.Dan Gohman2009-06-301-3/+2
| | | | llvm-svn: 74491
* Remove the block from the LoopInfo, rather than just the Loop.Dan Gohman2009-06-271-1/+1
| | | | | | | LoopInfo will handle removing it from the Loop, as well as updating its own tables. llvm-svn: 74398
* Teach LoopSimplify how to merge multiple loop exits into a single exit,Dan Gohman2009-06-271-0/+75
| | | | | | | | | | | | | | | | when one of them can be converted to a trivial icmp and conditional branch. This addresses what is essentially a phase ordering problem. SimplifyCFG knows how to do this transformation, but it doesn't do so if the primary block has any instructions in it other than an icmp and a branch. In the given testcase, the block contains other instructions, however they are loop-invariant and can be hoisted. SimplifyCFG doesn't have LoopInfo though, so it can't hoist them. And, it's important that the blocks be merged before LoopRotation, as it doesn't support multiple-exit loops. llvm-svn: 74396
* Rename getAnalysisToUpdate to getAnalysisIfAvailable.Duncan Sands2009-01-281-2/+2
| | | | llvm-svn: 63198
* Tidy up several unbeseeming casts from pointer to intptr_t.Dan Gohman2008-09-041-1/+1
| | | | llvm-svn: 55779
* Use Loop::block_iterator.Dan Gohman2008-06-221-2/+3
| | | | llvm-svn: 52616
* LoopSimplify preserves AA.Devang Patel2008-06-061-3/+5
| | | | llvm-svn: 52053
* Change class' public PassInfo variables to by initialized with theDan Gohman2008-05-131-1/+1
| | | | | | | | | | | address of the PassInfo directly instead of calling getPassInfo. This eliminates a bunch of dynamic initializations of static data. Also, fold RegisterPassBase into PassInfo, make a bunch of its data members const, and rearrange some code to initialize data members in constructors instead of using setter member functions. llvm-svn: 51022
* Clean up the use of static and anonymous namespaces. This turned upDan Gohman2008-05-131-4/+4
| | | | | | | several things that were neither in an anonymous namespace nor static but not intended to be global. llvm-svn: 51017
* Remove 'unwinds to' support from mainline. This patch undoes r47802 r47989Nick Lewycky2008-04-251-10/+7
| | | | | | r48047 r48084 r48085 r48086 r48088 r48096 r48099 r48109 and r48123. llvm-svn: 50265
* Move SplitBlockPredecessors out of loopsimplify into BasicBlockUtils.hChris Lattner2008-04-211-107/+14
| | | | | | | | | as a global helper function. At the same type, switch it from taking a vector of predecessors to an arbitrary sequential input. This allows us to switch LoopSimplify to use a SmallVector for various temporary vectors that it passed into SplitBlockPredecessors. llvm-svn: 50020
OpenPOWER on IntegriCloud