LLVM API Documentation
#include <LoopInfo.h>
Collaboration diagram for llvm::Loop:
Public Types | |
typedef std::vector< Loop * >::const_iterator | iterator |
typedef std::vector< BasicBlock * >::const_iterator | block_iterator |
Public Member Functions | |
Loop () | |
Loop ctor - This creates an empty loop. | |
~Loop () | |
unsigned | getLoopDepth () const |
BasicBlock * | getHeader () const |
Loop * | getParentLoop () const |
bool | contains (const BasicBlock *BB) const |
iterator | begin () const |
iterator | end () const |
const std::vector< BasicBlock * > & | getBlocks () const |
block_iterator | block_begin () const |
block_iterator | block_end () const |
bool | isLoopExit (const BasicBlock *BB) const |
unsigned | getNumBackEdges () const |
bool | isLoopInvariant (Value *V) const |
void | getExitBlocks (std::vector< BasicBlock * > &Blocks) const |
BasicBlock * | getLoopPreheader () const |
PHINode * | getCanonicalInductionVariable () const |
Instruction * | getCanonicalInductionVariableIncrement () const |
Value * | getTripCount () const |
void | addBasicBlockToLoop (BasicBlock *NewBB, LoopInfo &LI) |
void | replaceChildLoopWith (Loop *OldChild, Loop *NewChild) |
void | addChildLoop (Loop *NewChild) |
Loop * | removeChildLoop (iterator OldChild) |
void | addBlockEntry (BasicBlock *BB) |
void | removeBlockFromLoop (BasicBlock *BB) |
void | print (std::ostream &O, unsigned Depth=0) const |
void | dump () const |
Friends | |
class | LoopInfo |
Definition at line 47 of file LoopInfo.h.
|
Definition at line 84 of file LoopInfo.h. |
|
iterator/begin/end - Return the loops contained entirely within this loop. Definition at line 77 of file LoopInfo.h. |
|
Loop ctor - This creates an empty loop.
Definition at line 56 of file LoopInfo.h. |
|
Definition at line 57 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 471 of file LoopInfo.cpp. References llvm::LoopInfo::BBMap, Blocks, getHeader(), and getParentLoop(). |
|
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 174 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 504 of file LoopInfo.cpp. References ParentLoop. Referenced by CloneLoop(). |
|
Definition at line 78 of file LoopInfo.h. Referenced by llvm::GraphTraits< Loop * >::child_begin(), llvm::GraphTraits< const Loop * >::child_begin(), CloneLoop(), print(), PrintLoopInfo(), and removeChildLoop(). |
|
Definition at line 85 of file LoopInfo.h. Referenced by CloneLoop(). |
|
Definition at line 86 of file LoopInfo.h. Referenced by CloneLoop(). |
|
contains - Return true of the specified basic block is in this loop Definition at line 35 of file LoopInfo.cpp. Referenced by FindPHIToPartitionLoops(), getCanonicalInductionVariable(), getCanonicalInductionVariableIncrement(), getConstantEvolvingPHI(), getExitBlocks(), getLoopPreheader(), getNumBackEdges(), getTripCount(), InsertPHINodesForUsesOutsideLoop(), isLoopExit(), llvm::SCEVUnknown::isLoopInvariant(), llvm::SCEVAddRecExpr::isLoopInvariant(), and isLoopInvariant(). |
|
Definition at line 82 of file LoopInfo.cpp. References print(). |
|
Definition at line 79 of file LoopInfo.h. Referenced by llvm::GraphTraits< Loop * >::child_end(), llvm::GraphTraits< const Loop * >::child_end(), CloneLoop(), print(), and PrintLoopInfo(). |
|
getBlocks - Get a list of the basic blocks which make up this loop. Definition at line 83 of file LoopInfo.h. Referenced by ApproximateLoopSize(), llvm::ExtractLoop(), and print(). |
|
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 388 of file LoopInfo.cpp. References Add(), llvm::BasicBlock::begin(), contains(), getHeader(), llvm::PHINode::getIncomingValueForBlock(), llvm::Constant::getOperand(), H, llvm::pred_begin(), and llvm::pred_end(). Referenced by getCanonicalInductionVariableIncrement(). |
|
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 423 of file LoopInfo.cpp. References contains(), and getCanonicalInductionVariable(). Referenced by getTripCount(). |
|
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 341 of file LoopInfo.cpp. References contains(), E, llvm::succ_begin(), and llvm::succ_end(). Referenced by PrintLoopInfo(). |
|
|
Definition at line 62 of file LoopInfo.h. References D. Referenced by llvm::LoopInfo::getLoopDepth(). |
|
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 357 of file LoopInfo.cpp. References contains(), getHeader(), Out, llvm::pred_begin(), llvm::pred_end(), llvm::succ_begin(), and llvm::succ_end(). |
|
getNumBackEdges - Calculate the number of back edges to the loop header Definition at line 50 of file LoopInfo.cpp. References contains(), E, getHeader(), H, I, llvm::pred_begin(), and llvm::pred_end(). |
|
Definition at line 69 of file LoopInfo.h. Referenced by addBasicBlockToLoop(), llvm::LoopInfo::addTopLevelLoop(), isNotAlreadyContainedIn(), llvm::ScalarEvolution::print(), llvm::LoopInfo::removeBlock(), and llvm::LoopInfo::removeLoop(). |
|
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 436 of file LoopInfo.cpp. References contains(), getCanonicalInductionVariableIncrement(), getHeader(), llvm::PHINode::getIncomingBlock(), llvm::User::getOperand(), llvm::BasicBlock::getTerminator(), llvm::ISD::SetEQ, and llvm::ISD::SetNE. |
|
isLoopExit - True if terminator in the block can branch to another block that is outside of the current loop. Definition at line 39 of file LoopInfo.cpp. References contains(), llvm::succ_begin(), and llvm::succ_end(). |
|
isLoopInvariant - Return true if the specified value is loop invariant Definition at line 63 of file LoopInfo.cpp. References contains(), and I. |
|
Definition at line 69 of file LoopInfo.cpp. References begin(), E, end(), getBlocks(), I, and llvm::WriteAsOperand(). Referenced by dump(). |
|
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 533 of file LoopInfo.cpp. References RemoveFromVector(). Referenced by llvm::LoopInfo::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 520 of file LoopInfo.cpp. References begin(), and ParentLoop. |
|
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 491 of file LoopInfo.cpp. References ParentLoop. |
|
Definition at line 186 of file LoopInfo.h. |