LLVM API Documentation
#include <LoopInfo.h>
Inheritance diagram for llvm::LoopBase< BlockT >:


Public Types | |
| typedef std::vector< LoopBase< BlockT > * >::const_iterator | iterator |
| typedef std::vector< BlockT * >::const_iterator | block_iterator |
Public Member Functions | |
| LoopBase () | |
| Loop ctor - This creates an empty loop. | |
| ~LoopBase () | |
| unsigned | getLoopDepth () const |
| BlockT * | getHeader () const |
| LoopBase< BlockT > * | getParentLoop () const |
| bool | contains (const BlockT *BB) const |
| const std::vector< LoopBase< BlockT > * > & | getSubLoops () const |
| iterator | begin () const |
| iterator | end () const |
| bool | empty () const |
| const std::vector< BlockT * > & | getBlocks () const |
| block_iterator | block_begin () const |
| block_iterator | block_end () const |
| bool | isLoopExit (const BlockT *BB) const |
| unsigned | getNumBackEdges () const |
| bool | isLoopInvariant (Value *V) const |
| void | getExitingBlocks (SmallVectorImpl< BlockT * > &ExitingBlocks) const |
| void | getExitBlocks (SmallVectorImpl< BlockT * > &ExitBlocks) const |
| void | getUniqueExitBlocks (SmallVectorImpl< BlockT * > &ExitBlocks) const |
| BlockT * | getLoopPreheader () const |
| BlockT * | getLoopLatch () const |
| PHINode * | getCanonicalInductionVariable () const |
| Instruction * | getCanonicalInductionVariableIncrement () const |
| Value * | getTripCount () const |
| unsigned | getSmallConstantTripCount () const |
| unsigned | getSmallConstantTripMultiple () const |
| bool | isLCSSAForm () const |
| isLCSSAForm - Return true if the Loop is in LCSSA form | |
| void | addBasicBlockToLoop (BlockT *NewBB, LoopInfoBase< BlockT > &LI) |
| void | replaceChildLoopWith (LoopBase< BlockT > *OldChild, LoopBase< BlockT > *NewChild) |
| void | addChildLoop (LoopBase< BlockT > *NewChild) |
| LoopBase< BlockT > * | removeChildLoop (iterator I) |
| void | addBlockEntry (BlockT *BB) |
| void | moveToHeader (BlockT *BB) |
| void | removeBlockFromLoop (BlockT *BB) |
| void | verifyLoop () const |
| verifyLoop - Verify loop structure | |
| void | print (std::ostream &OS, unsigned Depth=0) const |
| void | print (std::ostream *O, unsigned Depth=0) const |
| void | dump () const |
Friends | |
| class | LoopInfoBase<BlockT> |
Definition at line 69 of file LoopInfo.h.
|
|||||
|
Definition at line 117 of file LoopInfo.h. |
|
|||||
|
Definition at line 109 of file LoopInfo.h. |
|
|||||||||
|
Loop ctor - This creates an empty loop.
Definition at line 81 of file LoopInfo.h. |
|
|||||||||
|
Definition at line 82 of file LoopInfo.h. |
|
||||||||||||||||
|
addBasicBlockToLoop - This method is used by other analyses to update loop information. NewBB is set to be a new member of the current loop. Because of this, it is added as a member of all parent loops, and is added to the specified LoopInfo object as being in the current basic block. It is not valid to replace the loop header with this method. Definition at line 1049 of file LoopInfo.h. References llvm::LoopInfoBase< BlockT >::BBMap, llvm::LoopBase< BlockT >::Blocks, llvm::LoopBase< BlockT >::getHeader(), and llvm::LoopBase< BlockT >::getParentLoop(). Referenced by CloneLoop(), llvm::CloneLoop(), LoopRotate::preserveCanonicalLoopForm(), llvm::SplitBlock(), llvm::SplitCriticalEdge(), and llvm::UnrollLoop(). |
|
||||||||||
|
addBlockEntry - This adds a basic block directly to the basic block list. This should only be used by transformations that create new loops. Other transformations should use addBasicBlockToLoop. Definition at line 553 of file LoopInfo.h. |
|
||||||||||
|
addChildLoop - Add the specified loop to be a child of this loop. This updates the loop depth of the new child. Definition at line 532 of file LoopInfo.h. Referenced by llvm::LPPassManager::deleteLoopFromQueue(), and llvm::LPPassManager::insertLoop(). |
|
|||||||||
|
|||||||||
|
|||||||||
|
||||||||||
|
contains - Return true if the specified basic block is in this loop Definition at line 102 of file LoopInfo.h. Referenced by FindPHIToPartitionLoops(), getConstantEvolvingPHI(), ScalarEvolutionsImpl::getSCEVAtScope(), llvm::LoopInfoBase< MachineBasicBlock >::InsertLoopInto(), llvm::SCEVUnknown::isLoopInvariant(), llvm::SCEVAddRecExpr::isLoopInvariant(), LoopDeletion::IsLoopInvariantInst(), isTrivialLoopExitBlockHelper(), IVUseShouldUsePostIncValue(), BasedUser::RewriteInstructionToUseNewBase(), LoopRotate::rotateLoop(), llvm::SplitCriticalEdge(), llvm::UnrollLoop(), LoopRotate::usedOutsideOriginalHeader(), and llvm::SCEVExpander::visitAddRecExpr(). |
|
|||||||||
|
Definition at line 608 of file LoopInfo.h. Referenced by LoopStrengthReduce::runOnLoop(). |
|
|||||||||
|
Definition at line 112 of file LoopInfo.h. Referenced by llvm::LPPassManager::deleteLoopFromQueue(), llvm::LoopBase< MachineBasicBlock >::empty(), and LoopIndexSplit::runOnLoop(). |
|
|||||||||
|
|||||||||
|
getBlocks - Get a list of the basic blocks which make up this loop. Definition at line 116 of file LoopInfo.h. Referenced by llvm::LPPassManager::deleteLoopFromQueue(), llvm::ExtractLoop(), MSILWriter::printLoop(), LoopRotate::rotateLoop(), and llvm::UnrollLoop(). |
|
|||||||||
|
getCanonicalInductionVariable - Check to see if the loop has a canonical induction variable: an integer recurrence that starts at 0 and increments by one each time through the loop. If so, return the phi node that corresponds to it. Definition at line 339 of file LoopInfo.h. |
|
|||||||||
|
getCanonicalInductionVariableIncrement - Return the LLVM value that holds the canonical induction variable value for the "next" iteration of the loop. This always succeeds if getCanonicalInductionVariable succeeds. Definition at line 381 of file LoopInfo.h. |
|
||||||||||
|
getExitBlocks - Return all of the successor blocks of this loop. These are the blocks _outside of the current loop_ which are branched to. Definition at line 193 of file LoopInfo.h. Referenced by PrintLoopInfo(), LoopRotate::rotateLoop(), LoopExtractor::runOnFunction(), and LCSSA::runOnLoop(). |
|
||||||||||
|
getExitingBlocks - Return all blocks inside the loop that have successors outside of the loop. These are the blocks _inside of the current loop_ which branch out. The returned list is always unique. Definition at line 171 of file LoopInfo.h. Referenced by LoopDeletion::runOnLoop(). |
|
|||||||||
|
|||||||||
|
getLoopDepth - Return the nesting level of this loop. An outer-most loop has depth 1, for consistency with loop depth values used for basic blocks, where depth 0 is used for blocks not inside any loops. Definition at line 90 of file LoopInfo.h. Referenced by llvm::ScalarEvolution::getAddRecExpr(), llvm::LoopInfo::getLoopDepth(), llvm::LoopInfoBase< MachineBasicBlock >::getLoopDepth(), and llvm::LoopInfoBase< MachineBasicBlock >::print(). |
|
|||||||||
|
getLoopLatch - If there is a latch block for this loop, return it. A latch block is the canonical backedge for a loop. A loop header in normal form has two edges into it: one from a preheader and one from a latch block. Definition at line 309 of file LoopInfo.h. Referenced by llvm::CloneLoop(), IVUseShouldUsePostIncValue(), LoopRotate::preserveCanonicalLoopForm(), LoopRotate::rotateLoop(), LoopDeletion::SingleDominatingExit(), and llvm::UnrollLoop(). |
|
|||||||||
|
getLoopPreheader - If there is a preheader for this loop, return it. A loop has a preheader if there is only one edge to the header of the loop from outside of the loop. If this is the case, the block branching to the header of the loop is the preheader node. This method returns null if there is no preheader for the loop. Definition at line 276 of file LoopInfo.h. Referenced by IndVarSimplify::doInitialization(), BasedUser::InsertCodeForBaseAtPosition(), LoopRotate::preserveCanonicalLoopForm(), LoopRotate::rotateLoop(), LoopDeletion::runOnLoop(), LICM::runOnLoop(), llvm::UnrollLoop(), and llvm::SCEVExpander::visitAddRecExpr(). |
|
|||||||||
|
getNumBackEdges - Calculate the number of back edges to the loop header Definition at line 137 of file LoopInfo.h. |
|
|||||||||
|
|||||||||
|
getSmallConstantTripCount - Returns the trip count of this loop as a normal unsigned value, if possible. Returns 0 if the trip count is unknown of not constant. Will also return 0 if the trip count is very large (>= 2^32) Definition at line 425 of file LoopInfo.h. Referenced by LoopUnroll::runOnLoop(), and llvm::UnrollLoop(). |
|
|||||||||
|
getSmallConstantTripMultiple - Returns the largest constant divisor of the trip count of this loop as a normal unsigned value, if possible. This means that the actual trip count is always a multiple of the returned value (don't forget the trip count could very well be zero as well!). Returns 1 if the trip count is unknown or not guaranteed to be the multiple of a constant (which is also the case if the trip count is simply constant, use getSmallConstantTripCount for that case), Will also return 1 if the trip count is very large (>= 2^32). Definition at line 447 of file LoopInfo.h. Referenced by llvm::UnrollLoop(). |
|
|||||||||
|
iterator/begin/end - Return the loops contained entirely within this loop. Definition at line 108 of file LoopInfo.h. Referenced by LoopIndexSplit::runOnLoop(). |
|
|||||||||
|
getTripCount - Return a loop-invariant LLVM value indicating the number of times the loop will be executed. Note that this means that the backedge of the loop executes N-1 times. If the trip-count cannot be determined, this returns null. Definition at line 394 of file LoopInfo.h. |
|
||||||||||
|
getUniqueExitBlocks - Return all unique successor blocks of this loop. These are the blocks _outside of the current loop_ which are branched to. This assumes that loop is in canonical form. Definition at line 214 of file LoopInfo.h. Referenced by LoopDeletion::runOnLoop(). |
|
|||||||||
|
isLCSSAForm - Return true if the Loop is in LCSSA form
Definition at line 475 of file LoopInfo.h. Referenced by LoopUnswitch::runOnLoop(), LoopUnroll::runOnLoop(), LCSSA::runOnLoop(), IndVarSimplify::runOnLoop(), and llvm::UnrollLoop(). |
|
||||||||||
|
isLoopExit - True if terminator in the block can branch to another block that is outside of the current loop. Definition at line 124 of file LoopInfo.h. Referenced by LoopRotate::rotateLoop(). |
|
||||||||||
|
isLoopInvariant - Return true if the specified value is loop invariant Definition at line 153 of file LoopInfo.h. Referenced by FindLIVLoopCondition(), LoopDeletion::IsLoopInvariantInst(), and llvm::SCEVExpander::visitAddRecExpr(). |
|
||||||||||
|
moveToHeader - This method is used to move BB (which must be part of this loop) to be the loop header of the loop (the block that dominates all others). Definition at line 560 of file LoopInfo.h. Referenced by LoopRotate::rotateLoop(). |
|
||||||||||||||||
|
Definition at line 604 of file LoopInfo.h. |
|
||||||||||||||||
|
Definition at line 591 of file LoopInfo.h. Referenced by llvm::LoopInfoBase< MachineBasicBlock >::print(), and llvm::LoopBase< MachineBasicBlock >::print(). |
|
||||||||||
|
removeBlockFromLoop - This removes the specified basic block from the current loop, updating the Blocks as appropriate. This does not update the mapping in the LoopInfo class. Definition at line 575 of file LoopInfo.h. Referenced by llvm::LoopInfoBase< MachineBasicBlock >::removeBlock(). |
|
||||||||||
|
removeChildLoop - This removes the specified child from being a subloop of this loop. The loop is not deleted, as it will presumably be inserted into another loop. Definition at line 541 of file LoopInfo.h. Referenced by llvm::LPPassManager::deleteLoopFromQueue(). |
|
||||||||||||||||
|
replaceChildLoopWith - This is used when splitting loops up. It replaces the OldChild entry in our children list with NewChild, and updates the parent pointer of OldChild to be null and the NewChild to be this loop. This updates the loop depth of the new child. Definition at line 517 of file LoopInfo.h. |
|
|||||||||
|
verifyLoop - Verify loop structure
Definition at line 580 of file LoopInfo.h. Referenced by llvm::LoopBase< MachineBasicBlock >::verifyLoop(). |
|
|||||
|
Definition at line 613 of file LoopInfo.h. |