summaryrefslogtreecommitdiff
path: root/lib/Transforms/Scalar/LoopDeletion.cpp
Commit message (Collapse)AuthorAge
* Use SmallVectorImpl& instead of SmallVector to avoid repeating small vector ↵Craig Topper2013-07-14
| | | | | | size. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186274 91177308-0d34-0410-b5e6-96231b3b80d8
* Use SmallVectorImpl::iterator/const_iterator instead of SmallVector to avoid ↵Craig Topper2013-07-04
| | | | | | specifying the vector size. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185606 91177308-0d34-0410-b5e6-96231b3b80d8
* Make method private. Keep coding standard.Jakub Staszak2013-03-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@177348 91177308-0d34-0410-b5e6-96231b3b80d8
* Use the new script to sort the includes of every file under lib.Chandler Carruth2012-12-03
| | | | | | | | | | | | | | | | | Sooooo many of these had incorrect or strange main module includes. I have manually inspected all of these, and fixed the main module include to be the nearest plausible thing I could find. If you own or care about any of these source files, I encourage you to take some time and check that these edits were sensible. I can't have broken anything (I strictly added headers, and reordered them, never removed), but they may not be the headers you'd really like to identify as containing the API being implemented. Many forward declarations and missing includes were added to a header files to allow them to parse cleanly when included first. The main module rule does in fact have its merits. =] git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169131 91177308-0d34-0410-b5e6-96231b3b80d8
* Clean whitespaces.Nadav Rotem2012-07-24
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160668 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't use PN->replaceUsesOfWith() to change a PHINode's incoming blocks,Jay Foad2011-06-21
| | | | | | | because it won't work after my phi operand changes, because the incoming blocks will no longer be Uses. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133512 91177308-0d34-0410-b5e6-96231b3b80d8
* Make LoopDeletion work on loops with multiple edges, as long as the incomingCameron Zwarich2011-02-22
| | | | | | values from all of the loop's exiting blocks are equal. Patch by Andrew Clinton. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126253 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove code for updating dominance frontiers and some outdated references toCameron Zwarich2011-01-18
| | | | | | | dominance and post-dominance frontiers. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123725 91177308-0d34-0410-b5e6-96231b3b80d8
* Use SmallVector instead of SmallPtrSet and avoid non-deterministic behavior.Devang Patel2011-01-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123318 91177308-0d34-0410-b5e6-96231b3b80d8
* split dom frontier handling stuff out to its own DominanceFrontier header,Chris Lattner2011-01-02
| | | | | | | | so that Dominators.h is *just* domtree. Also prune #includes a bit. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122714 91177308-0d34-0410-b5e6-96231b3b80d8
* Passes do not need to recursively initialize passes that they preserve, ifOwen Anderson2010-10-19
| | | | | | | | they do not also require them. This allows us to reduce inter-pass linkage dependencies. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116854 91177308-0d34-0410-b5e6-96231b3b80d8
* Get rid of static constructors for pass registration. Instead, every pass ↵Owen Anderson2010-10-19
| | | | | | | | | | | | | | | | | | exposes an initializeMyPassFunction(), which must be called in the pass's constructor. This function uses static dependency declarations to recursively initialize the pass's dependencies. Clients that only create passes through the createFooPass() APIs will require no changes. Clients that want to use the CommandLine options for passes will need to manually call the appropriate initialization functions in PassInitialization.h before parsing commandline arguments. I have tested this with all standard configurations of clang and llvm-gcc on Darwin. It is possible that there are problems with the static dependencies that will only be visible with non-standard options. If you encounter any crash in pass registration/creation, please send the testcase to me directly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116820 91177308-0d34-0410-b5e6-96231b3b80d8
* Begin adding static dependence information to passes, which will allow us toOwen Anderson2010-10-12
| | | | | | | | | | perform initialization without static constructors AND without explicit initialization by the client. For the moment, passes are required to initialize both their (potential) dependencies and any passes they preserve. I hope to be able to relax the latter requirement in the future. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116334 91177308-0d34-0410-b5e6-96231b3b80d8
* Now with fewer extraneous semicolons!Owen Anderson2010-10-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115996 91177308-0d34-0410-b5e6-96231b3b80d8
* Reapply r110396, with fixes to appease the Linux buildbot gods.Owen Anderson2010-08-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110460 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r110396 to fix buildbots.Owen Anderson2010-08-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110410 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't use PassInfo* as a type identifier for passes. Instead, use the ↵Owen Anderson2010-08-05
| | | | | | | | | address of the static ID member as the sole unique type identifier. Clean up APIs related to this change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110396 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove LCSSA's bogus dependence on LoopSimplify and LoopSimplify's bogusDan Gohman2010-07-26
| | | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109413 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix batch of converting RegisterPass<> to INTIALIZE_PASS().Owen Anderson2010-07-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109045 91177308-0d34-0410-b5e6-96231b3b80d8
* Use pre-increment instead of post-increment when the result is not used.Dan Gohman2010-06-22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106542 91177308-0d34-0410-b5e6-96231b3b80d8
* LoopDeletion depends on loops having dedicated exits.Dan Gohman2009-11-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86180 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename forgetLoopBackedgeTakenCount to forgetLoop, because itDan Gohman2009-10-31
| | | | | | | clears out more information than just the stored backedge taken count. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85664 91177308-0d34-0410-b5e6-96231b3b80d8
* Simplify this code. LoopDeletion doesn't need to explicit check thatDan Gohman2009-10-26
| | | | | | | | the loop exiting block dominates the latch block; if ScalarEvolution can prove that the trip-count is finite, that's sufficient. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85165 91177308-0d34-0410-b5e6-96231b3b80d8
* Make LoopDeletion check the maximum backedge taken count, rather than theDan Gohman2009-10-23
| | | | | | | | exact backedge taken count, when checking for infinite loops. This allows it to delete loops with multiple exit conditions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84952 91177308-0d34-0410-b5e6-96231b3b80d8
* eliminate VISIBILITY_HIDDEN from Transforms/Scalar. PR4861Chris Lattner2009-09-02
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80766 91177308-0d34-0410-b5e6-96231b3b80d8
* Make makeLoopInvariant report whether it made any changes or not,Dan Gohman2009-07-15
| | | | | | | and use this to simplify more code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75722 91177308-0d34-0410-b5e6-96231b3b80d8
* Tell ScalarEvolution to forget a loop before starting to delete it.Dan Gohman2009-07-08
| | | | | | | | This way ScalarEvolution can examine the loop to determine what state it needs to update, if it chooses. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75029 91177308-0d34-0410-b5e6-96231b3b80d8
* Change all SCEV* to SCEV *.Dan Gohman2009-07-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74918 91177308-0d34-0410-b5e6-96231b3b80d8
* SCEVHandle is no more!Owen Anderson2009-06-22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73906 91177308-0d34-0410-b5e6-96231b3b80d8
* Allow readonly functions to unwind exceptions. TeachDuncan Sands2009-05-06
| | | | | | | | | the optimizers about this. For example, a readonly function with no uses cannot be removed unless it is also marked nounwind. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71071 91177308-0d34-0410-b5e6-96231b3b80d8
* Re-apply 70645, converting ScalarEvolution to useDan Gohman2009-05-04
| | | | | | | | | | | | | CallbackVH, with fixes. allUsesReplacedWith need to walk the def-use chains and invalidate all users of a value that is replaced. SCEVs of users need to be recalcualted even if the new value is equivalent. Also, make forgetLoopPHIs walk def-use chains, since any SCEV that depends on a PHI should be recalculated when more information about that PHI becomes available. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70927 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r70645 for now; it's causing a variety of regressions.Dan Gohman2009-05-03
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70661 91177308-0d34-0410-b5e6-96231b3b80d8
* Convert ScalarEvolution to use CallbackVH for its internal map. ThisDan Gohman2009-05-02
| | | | | | | | | | makes ScalarEvolution::deleteValueFromRecords, and it's code that subtly needed to be called before ReplaceAllUsesWith, unnecessary. It also makes ValueDeletionListener unnecessary. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70645 91177308-0d34-0410-b5e6-96231b3b80d8
* Tell ScalarEvolution that the loop is being deleted before actuallyDan Gohman2009-05-02
| | | | | | | | deleting it. This will let ScalarEvolution be more complete about updating its records. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70632 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename ScalarEvolution's getIterationCount to getBackedgeTakenCount,Dan Gohman2009-02-24
| | | | | | | | | | to more accurately describe what it does. Expand its doxygen comment to describe what the backedge-taken count is and how it differs from the actual iteration count of the loop. Adjust names and comments in associated code accordingly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65382 91177308-0d34-0410-b5e6-96231b3b80d8
* Preserve the DominanceFrontier analysis in the LoopDeletion pass.Dan Gohman2009-02-24
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65359 91177308-0d34-0410-b5e6-96231b3b80d8
* LoopDeletion needs to inform ScalarEvolution when a loop is deleted,Dan Gohman2009-02-23
| | | | | | | | | so that ScalarEvolution doesn't hang onto a dangling Loop*, which could be a problem if another Loop happens to get allocated at the same address. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65323 91177308-0d34-0410-b5e6-96231b3b80d8
* Change create*Pass factory functions to return Pass* instead ofDaniel Dunbar2008-10-22
| | | | | | | | | | | | LoopPass*. - Although less precise, this means they can be used in clients without RTTI (who would otherwise need to include LoopPass.h, which eventually includes things using dynamic_cast). This was the simplest solution that presented itself, but I am happy to use a better one if available. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58010 91177308-0d34-0410-b5e6-96231b3b80d8
* Tidy up several unbeseeming casts from pointer to intptr_t.Dan Gohman2008-09-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55779 91177308-0d34-0410-b5e6-96231b3b80d8
* Use use_empty() instead of getNumUses(), avoiding a use list traversal.Dan Gohman2008-06-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52651 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove debugging code.Owen Anderson2008-05-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51666 91177308-0d34-0410-b5e6-96231b3b80d8
* Clean ups for loop deletion based on Chris' feedback.Owen Anderson2008-05-16
| | | | | | | | Also, use SCEV to determine the trip count of the loop, which is more powerful and accurate that Loop::getTripCount. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51179 91177308-0d34-0410-b5e6-96231b3b80d8
* Clean up the use of static and anonymous namespaces. This turned upDan Gohman2008-05-13
| | | | | | | | several things that were neither in an anonymous namespace nor static but not intended to be global. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51017 91177308-0d34-0410-b5e6-96231b3b80d8
* Improve pass documentation and comments.Gordon Henriksen2008-05-08
| | | | | | Patch by Matthijs Kooijman! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50861 91177308-0d34-0410-b5e6-96231b3b80d8
* We need to update PHIs containing the exiting block, not the exit block. We ↵Owen Anderson2008-05-06
| | | | | | really should come up with better names for these. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50770 91177308-0d34-0410-b5e6-96231b3b80d8
* This condition got inverted accidentally.Owen Anderson2008-04-30
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50473 91177308-0d34-0410-b5e6-96231b3b80d8
* A lot of cleanups and documentation improvements, as well as a few corner ↵Owen Anderson2008-04-29
| | | | | | | | | case fixes. Most of this was suggested by Chris. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50441 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename DeadLoopElimination to LoopDeletion, part 2.Owen Anderson2008-04-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50437 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename DeadLoopElimination to LoopDeletion, part one.Owen Anderson2008-04-29
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50436 91177308-0d34-0410-b5e6-96231b3b80d8