aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/Analysis/LoopInfo.h
Commit message (Collapse)AuthorAgeFilesLines
* Revert r110396 to fix buildbots.Owen Anderson2010-08-061-1/+1
| | | | 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-051-1/+1
| | | | | | | | | 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
* Eliminate getCanonicalInductionVariableIncrement's last user andDan Gohman2010-07-231-6/+0
| | | | | | | eliminate it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109270 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement loop splitting analysis.Jakob Stoklund Olesen2010-07-201-0/+6
| | | | | | | Determine which loop exit blocks need a 'pre-exit' block inserted. Recognize when this would be impossible. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108941 91177308-0d34-0410-b5e6-96231b3b80d8
* Switched to array_pod_sort as per Chris's suggestion.Lang Hames2010-07-171-1/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108616 91177308-0d34-0410-b5e6-96231b3b80d8
* LoopSplitter - intended to split live intervals over loop boundaries.Lang Hames2010-07-171-3/+6
| | | | | | | | | | Still very much under development. Comments and fixes will be forthcoming. (This commit includes some small tweaks to LiveIntervals & LoopInfo to support the splitter) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108615 91177308-0d34-0410-b5e6-96231b3b80d8
* two more cases of reuse result of operator*, found by inspectionGabor Greif2010-07-091-5/+8
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107961 91177308-0d34-0410-b5e6-96231b3b80d8
* another case of reuse result of operator*, it is expensive to recomputeGabor Greif2010-07-091-4/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107960 91177308-0d34-0410-b5e6-96231b3b80d8
* reuse result of operator*, it is expensive to recomputeGabor Greif2010-07-091-3/+5
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107959 91177308-0d34-0410-b5e6-96231b3b80d8
* Split out the code for finding a unique loop predecessor fromDan Gohman2010-06-221-7/+21
| | | | | | | | getLoopPreheader into a separate function, for clients which don't require a proper preheader. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106543 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a DominatorTree argument to isLCSSA so that it doesn't have toDan Gohman2010-03-101-1/+1
| | | | | | | | compute a set of reachable blocks for itself each time it is called, which is fairly frequently. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98179 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename a variable to avoid a -Wshadow warning.Dan Gohman2010-02-221-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96776 91177308-0d34-0410-b5e6-96231b3b80d8
* Mention IndVarSimplify in the comment by getSmallConstantTripCount, asDan Gohman2010-02-091-0/+4
| | | | | | | is done for getTripCount. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95666 91177308-0d34-0410-b5e6-96231b3b80d8
* Restore dump() methods to Loop and MachineLoop.Dan Gohman2010-01-051-1/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92772 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove dump routine and the associated Debug.h from a header. Patch upDavid Greene2009-12-231-5/+0
| | | | | | | other files to compensate. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92075 91177308-0d34-0410-b5e6-96231b3b80d8
* Convert debug messages to use dbgs(). Generally this meansDavid Greene2009-12-231-1/+2
| | | | | | | s/errs/dbgs/g except for certain special cases. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92006 91177308-0d34-0410-b5e6-96231b3b80d8
* Add Loop contains utility methods for testing whether a loopDan Gohman2009-12-181-1/+17
| | | | | | | | | contains another loop, or an instruction. The loop form is substantially more efficient on large loops than the typical code it replaces. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91654 91177308-0d34-0410-b5e6-96231b3b80d8
* Reapply LoopStrengthReduce and IVUsers cleanups, excluding the partDan Gohman2009-12-181-7/+0
| | | | | | | | | of 91296 that caused trouble -- the Processed list needs to be preserved for the livetime of the pass, as AddUsersIfInteresting is called from other passes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91641 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert 91280-91283, 91286-91289, 91291, 91293, 91295-91296. It apparently ↵Evan Cheng2009-12-171-0/+7
| | | | | | introduced a non-deterministic behavior in the optimizer somewhere. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91598 91177308-0d34-0410-b5e6-96231b3b80d8
* Drop Loop::isNotAlreadyContainedIn in favor of Loop::contains. TheDan Gohman2009-12-141-7/+0
| | | | | | | former was just exposing a LoopInfoBase implementation detail. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91286 91177308-0d34-0410-b5e6-96231b3b80d8
* Make getUniqueExitBlocks's precondition assert more precise, toDan Gohman2009-12-111-1/+1
| | | | | | | avoid spurious failures. This fixes PR5758. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91147 91177308-0d34-0410-b5e6-96231b3b80d8
* Make Loop::getLoopLatch() work on loops which don't have preheaders, asDan Gohman2009-11-201-15/+5
| | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89484 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix an 80-column violation.Dan Gohman2009-11-091-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86567 91177308-0d34-0410-b5e6-96231b3b80d8
* Factor out the predicate code for loopsimplify form exit blocks intoDan Gohman2009-11-051-0/+4
| | | | | | | a separate helper function. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86159 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename isLoopExit to isLoopExiting, for consistency with the wordingDan Gohman2009-10-241-3/+3
| | | | | | | | | used elsewhere - an exit block is a block outside the loop branched to from within the loop. An exiting block is a block inside the loop that branches out. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85019 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove a redundant assert.Dan Gohman2009-09-271-1/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82907 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a comment describing natural loops.Dan Gohman2009-09-261-1/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82859 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix apostrophos.Dan Gohman2009-09-151-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81856 91177308-0d34-0410-b5e6-96231b3b80d8
* Re-apply r80926, with fixes: keep the domtree informed of new blocksDan Gohman2009-09-081-5/+78
| | | | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81221 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r80926. It causes loop unswitch assertion and slow down some JIT ↵Evan Cheng2009-09-061-68/+4
| | | | | | tests significantly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81101 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a verifyAnalysis to LoopInfo, LoopSimplify, and LCSSA form that verifyDan Gohman2009-09-031-4/+68
| | | | | | | | | | that these passes are properly preserved. Fix several transformation passes that claimed to preserve LoopSimplify form but weren't. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80926 91177308-0d34-0410-b5e6-96231b3b80d8
* Move getUniqueExitBlocks from LoopBase to Loop, since they depend onDan Gohman2009-09-031-68/+10
| | | | | | | | LoopSimplify form, which is currently only available on Loops (and not MachineLoops). Also, move the code out of the header file. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80923 91177308-0d34-0410-b5e6-96231b3b80d8
* Minor code simplification.Dan Gohman2009-08-271-5/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80266 91177308-0d34-0410-b5e6-96231b3b80d8
* Implemented comments from Daniel Dunbar.Andreas Neustifter2009-08-261-1/+0
| | | | | | | (See http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20090817/084958.html) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80100 91177308-0d34-0410-b5e6-96231b3b80d8
* convert LoopInfo.h and GraphWriter.h to use raw_ostreamChris Lattner2009-08-231-2/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79836 91177308-0d34-0410-b5e6-96231b3b80d8
* Change Pass::print to take a raw ostream instead of std::ostream,Chris Lattner2009-08-231-1/+1
| | | | | | | update all code that this affects. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79830 91177308-0d34-0410-b5e6-96231b3b80d8
* eliminate the std::ostream form of WriteAsOperand and update clients.Chris Lattner2009-08-231-12/+6
| | | | | | | This also updates dominator related stuff. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79825 91177308-0d34-0410-b5e6-96231b3b80d8
* Some ProfileInfo cleanups.Daniel Dunbar2009-08-081-1/+1
| | | | | | | - Part of optimal static profiling patch sequence by Andreas Neustifter. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78485 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a basic static ProfileInfo provider (ProfileEstimatorPass).Daniel Dunbar2009-08-081-0/+19
| | | | | | | - Part of optimal static profiling patch sequence by Andreas Neustifter. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78484 91177308-0d34-0410-b5e6-96231b3b80d8
* Add an isLoopSimplifyForm() predicate, following the example ofDan Gohman2009-07-161-0/+5
| | | | | | | | isLCSSAForm(), to test whether a loop is in the form guaranteed by the LoopSimplify pass. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76077 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a typo in a comment that Duncan noticed.Dan Gohman2009-07-151-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75804 91177308-0d34-0410-b5e6-96231b3b80d8
* Make makeLoopInvariant report whether it made any changes or not,Dan Gohman2009-07-151-2/+4
| | | | | | | and use this to simplify more code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75722 91177308-0d34-0410-b5e6-96231b3b80d8
* Introduce a new LoopInfo utility function makeLoopInvariant, whichDan Gohman2009-07-141-0/+27
| | | | | | | | | | | | works similar to isLoopInvariant, except that it will do trivial hoisting to try to make the value loop invariant if it isn't already. This makes it easier for transformation passes to clear trivial instructions out of the way (the regular LICM pass doesn't run until relatively late). This is code factored out of LoopSimplify and other places. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75578 91177308-0d34-0410-b5e6-96231b3b80d8
* Move isLCSSAForm, isLoopInvariant, getCanonicalInductionVariable,Dan Gohman2009-07-131-183/+51
| | | | | | | | | and related functions out of LoopBase and into Loop, since they are specific to BasicBlock-based loops. This also allows the code to be moved out-of-line. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75523 91177308-0d34-0410-b5e6-96231b3b80d8
* Make Loop and MachineLoop be subclasses of LoopBase, rather than typedefs,Dan Gohman2009-07-131-78/+93
| | | | | | | | | | | using the Curiously Recurring Template Pattern with LoopBase. This will help further refactoring, and future functionality for Loop. Also, Headers can now foward-declare Loop, instead of pulling in LoopInfo.h or doing tricks. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75519 91177308-0d34-0410-b5e6-96231b3b80d8
* Eliminate a layer of indirection in LoopInfo and MachineLoopInfo.Dan Gohman2009-06-271-26/+26
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74394 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a getUniqueExitBlock utility function, similar to getExitBlock,Dan Gohman2009-06-251-0/+10
| | | | | | | but for getUniqueExitBlocks. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74145 91177308-0d34-0410-b5e6-96231b3b80d8
* Add some comments noting how IndVarSimplify facilitatesDan Gohman2009-05-191-0/+6
| | | | | | | LoopInfo functionality. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72091 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a getExitBlock utility function to LoopInfo which returns theDan Gohman2009-05-081-0/+10
| | | | | | | | exit block of a loop, if there is exactly one, similar to getExitingBlock. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71245 91177308-0d34-0410-b5e6-96231b3b80d8
* Make LoopInfo::print() identify header, exit, and latch blocks,Dan Gohman2009-02-271-2/+7
| | | | | | | and print the loop depth. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65593 91177308-0d34-0410-b5e6-96231b3b80d8