LLVM API Documentation
#include <LoopInfo.h>
Public Types | |
typedef LoopInfoBase < BasicBlock, Loop >::iterator | iterator |
typedef LoopInfoBase < BasicBlock, Loop > ::reverse_iterator | reverse_iterator |
Public Member Functions | |
LoopInfo () | |
LoopInfoBase< BasicBlock, Loop > & | getBase () |
iterator | begin () const |
iterator | end () const |
reverse_iterator | rbegin () const |
reverse_iterator | rend () const |
bool | empty () const |
Loop * | getLoopFor (const BasicBlock *BB) const |
const Loop * | operator[] (const BasicBlock *BB) const |
unsigned | getLoopDepth (const BasicBlock *BB) const |
bool | isLoopHeader (BasicBlock *BB) const |
virtual bool | runOnFunction (Function &F) |
virtual void | verifyAnalysis () const |
virtual void | releaseMemory () |
virtual void | print (raw_ostream &O, const Module *M=0) const |
virtual void | getAnalysisUsage (AnalysisUsage &AU) const |
Loop * | removeLoop (iterator I) |
void | changeLoopFor (BasicBlock *BB, Loop *L) |
void | changeTopLevelLoop (Loop *OldLoop, Loop *NewLoop) |
void | addTopLevelLoop (Loop *New) |
void | removeBlock (BasicBlock *BB) |
void | updateUnloop (Loop *Unloop) |
bool | replacementPreservesLCSSAForm (Instruction *From, Value *To) |
![]() | |
FunctionPass (char &pid) | |
Pass * | createPrinterPass (raw_ostream &O, const std::string &Banner) const |
createPrinterPass - Get a function printer pass. More... | |
virtual void | assignPassManager (PMStack &PMS, PassManagerType T) |
virtual PassManagerType | getPotentialPassManagerType () const |
Return what kind of Pass Manager can manage this pass. More... | |
![]() | |
Pass (PassKind K, char &pid) | |
virtual | ~Pass () |
PassKind | getPassKind () const |
virtual const char * | getPassName () const |
AnalysisID | getPassID () const |
getPassID - Return the PassID number that corresponds to this pass. More... | |
virtual bool | doInitialization (Module &) |
virtual bool | doFinalization (Module &) |
void | dump () const |
virtual void | preparePassManager (PMStack &) |
Check if available pass managers are suitable for this pass or not. More... | |
void | setResolver (AnalysisResolver *AR) |
AnalysisResolver * | getResolver () const |
virtual void * | getAdjustedAnalysisPointer (AnalysisID ID) |
virtual ImmutablePass * | getAsImmutablePass () |
virtual PMDataManager * | getAsPMDataManager () |
virtual void | dumpPassStructure (unsigned Offset=0) |
template<typename AnalysisType > | |
AnalysisType * | getAnalysisIfAvailable () const |
bool | mustPreserveAnalysisID (char &AID) const |
template<typename AnalysisType > | |
AnalysisType & | getAnalysis () const |
template<typename AnalysisType > | |
AnalysisType & | getAnalysis (Function &F) |
template<typename AnalysisType > | |
AnalysisType & | getAnalysisID (AnalysisID PI) const |
template<typename AnalysisType > | |
AnalysisType & | getAnalysisID (AnalysisID PI, Function &F) |
Static Public Attributes | |
static char | ID = 0 |
Friends | |
class | LoopBase< BasicBlock, Loop > |
Additional Inherited Members | |
![]() | |
static const PassInfo * | lookupPassInfo (const void *TI) |
static const PassInfo * | lookupPassInfo (StringRef Arg) |
static Pass * | createPass (AnalysisID ID) |
Definition at line 589 of file LoopInfo.h.
typedef LoopInfoBase<BasicBlock, Loop>::iterator llvm::LoopInfo::iterator |
iterator/begin/end - The interface to the top-level loops in the current function.
Definition at line 607 of file LoopInfo.h.
Definition at line 608 of file LoopInfo.h.
|
inline |
Definition at line 598 of file LoopInfo.h.
References llvm::PassRegistry::getPassRegistry(), and llvm::initializeLoopInfoPass().
|
inline |
addTopLevelLoop - This adds the specified loop to the collection of top-level loops.
Definition at line 672 of file LoopInfo.h.
References llvm::LoopInfoBase< N, M >::addTopLevelLoop().
Referenced by llvm::LPPassManager::insertLoop().
|
inline |
Definition at line 609 of file LoopInfo.h.
References llvm::LoopInfoBase< N, M >::begin().
Referenced by verifyAnalysis().
|
inline |
changeLoopFor - Change the top-level loop that contains BB to the specified loop. This should be used by transformations that restructure the loop hierarchy tree.
Definition at line 660 of file LoopInfo.h.
References llvm::LoopInfoBase< N, M >::changeLoopFor().
changeTopLevelLoop - Replace the specified loop in the top-level loops list with the indicated loop.
Definition at line 666 of file LoopInfo.h.
References llvm::LoopInfoBase< N, M >::changeTopLevelLoop().
|
inline |
Definition at line 613 of file LoopInfo.h.
References llvm::LoopInfoBase< N, M >::empty().
|
inline |
Definition at line 610 of file LoopInfo.h.
References llvm::LoopInfoBase< N, M >::end().
Referenced by verifyAnalysis().
|
virtual |
getAnalysisUsage - This function should be overriden by passes that need analysis information to do their job. If a pass specifies that it uses a particular analysis result to this function, it can then use the getAnalysis<AnalysisType>() function, below.
Reimplemented from llvm::Pass.
Definition at line 706 of file LoopInfo.cpp.
References llvm::AnalysisUsage::addRequired(), and llvm::AnalysisUsage::setPreservesAll().
|
inline |
Definition at line 602 of file LoopInfo.h.
References LI.
Referenced by CloneLoop(), CloneLoopBlocks(), runOnFunction(), llvm::UnrollLoop(), llvm::UnrollRuntimeLoopProlog(), and UpdateAnalysisInformation().
|
inline |
getLoopDepth - Return the loop nesting level of the specified block. A depth of 0 means the block is not inside any loop.
Definition at line 631 of file LoopInfo.h.
References llvm::LoopInfoBase< N, M >::getLoopDepth().
|
inline |
getLoopFor - Return the inner most loop that BB lives in. If a basic block is in no loop (for example the entry node), null is returned.
Definition at line 618 of file LoopInfo.h.
References llvm::LoopInfoBase< N, M >::getLoopFor().
Referenced by llvm::IVUsers::AddUsersImpl(), CloneLoop(), FoldBlockIntoPredecessor(), getOutermostLoop(), isInteresting(), llvm::isPotentiallyReachable(), isSimplifiedLoopNest(), llvm::Region::outermostLoopInRegion(), llvm::simplifyUsersOfIV(), UpdateAnalysisInformation(), updateUnloop(), and llvm::LoopBlocksTraversal::visitPreorder().
|
inline |
Definition at line 636 of file LoopInfo.h.
References llvm::LoopInfoBase< N, M >::isLoopHeader().
|
inline |
operator[] - same as getLoopFor...
Definition at line 624 of file LoopInfo.h.
References llvm::LoopInfoBase< N, M >::getLoopFor().
|
virtual |
print - Print out the internal state of the pass. This is called by Analyze to print out the contents of an analysis. Otherwise it is not necessary to implement this method. Beware that the module pointer MAY be null. This automatically forwards to a virtual function that does not provide the Module* in case the analysis doesn't need it it can just be ignored.
Reimplemented from llvm::Pass.
Definition at line 711 of file LoopInfo.cpp.
|
inline |
Definition at line 611 of file LoopInfo.h.
References llvm::LoopInfoBase< N, M >::rbegin().
Referenced by llvm::LPPassManager::runOnFunction().
|
inlinevirtual |
releaseMemory() - This member can be implemented by a pass if it wants to be able to release its memory when it is no longer needed. The default behavior of passes is to hold onto memory for the entire duration of their lifetime (which is the entire compile time). For pipelined passes, this is not a big deal because that memory gets recycled every time the pass is invoked on another program unit. For IP passes, it is more important to free memory when it is unused.
Optionally implement this function to release pass memory when it is no longer used.
Reimplemented from llvm::Pass.
Definition at line 646 of file LoopInfo.h.
References llvm::LoopInfoBase< N, M >::releaseMemory().
Referenced by runOnFunction().
|
inline |
removeBlock - This method completely removes BB from all data structures, including all of the Loop objects it is nested in and our mapping from BasicBlocks to loops.
Definition at line 679 of file LoopInfo.h.
References llvm::LoopInfoBase< N, M >::removeBlock().
Referenced by FoldBlockIntoPredecessor().
removeLoop - This removes the specified top-level loop from this loop info object. The loop is not deleted, as it will presumably be inserted into another loop.
Definition at line 655 of file LoopInfo.h.
References llvm::LoopInfoBase< N, M >::removeLoop().
|
inline |
Definition at line 612 of file LoopInfo.h.
References llvm::LoopInfoBase< N, M >::rend().
Referenced by llvm::LPPassManager::runOnFunction().
|
inline |
replacementPreservesLCSSAForm - Returns true if replacing From with To everywhere is guaranteed to preserve LCSSA form.
Definition at line 691 of file LoopInfo.h.
References llvm::LoopBase< N, M >::contains(), llvm::dyn_cast(), llvm::Instruction::getParent(), and I.
Referenced by llvm::UnrollLoop().
runOnFunction - Calculate the natural loop information.
Implements llvm::FunctionPass.
Definition at line 615 of file LoopInfo.cpp.
References getBase(), and releaseMemory().
void LoopInfo::updateUnloop | ( | Loop * | Unloop | ) |
updateUnloop - Update LoopInfo after removing the last backedge from a loop–now the "unloop". This updates the loop forest and parent loops for each block so that Unloop is no longer referenced, but the caller must actually delete the Unloop object.
updateUnloop - The last backedge has been removed from a loop–now the "unloop". Find a new parent for the blocks contained within unloop and update the loop tree. We don't necessarily have valid dominators at this point, but LoopInfo is still valid except for the removal of this loop.
Note that Unloop may now be an empty loop. Calling Loop::getHeader without checking first is illegal.
Definition at line 628 of file LoopInfo.cpp.
References llvm::LoopBase< N, M >::begin(), llvm::LoopBase< N, M >::block_begin(), llvm::LoopBase< N, M >::block_end(), llvm::LoopBase< N, M >::empty(), llvm::LoopBase< N, M >::end(), getLoopFor(), llvm::LoopBase< N, M >::getParentLoop(), I, llvm::prior(), and llvm::LoopBase< N, M >::removeChildLoop().
Referenced by llvm::LPPassManager::deleteLoopFromQueue().
|
virtual |
verifyAnalysis() - This member can be implemented by a analysis pass to check state of analysis information.
Reimplemented from llvm::Pass.
Definition at line 683 of file LoopInfo.cpp.
References begin(), llvm::DenseSet< ValueT, ValueInfoT >::count(), end(), I, Loops, and VerifyLoopInfo.
|
friend |
Definition at line 591 of file LoopInfo.h.
|
static |
Definition at line 596 of file LoopInfo.h.