LLVM API Documentation
#include <LoopInfo.h>


Public Types | |
| typedef std::vector< Loop * > ::const_iterator | iterator |
Public Member Functions | |
| LoopInfo () | |
| ~LoopInfo () | |
| LoopInfoBase< BasicBlock > & | getBase () |
| iterator | begin () const |
| iterator | end () 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 | releaseMemory () |
| virtual void | print (std::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) |
Static Public Attributes | |
| static char | ID = 0 |
Friends | |
| class | LoopBase< BasicBlock > |
Definition at line 930 of file LoopInfo.h.
| typedef std::vector<Loop*>::const_iterator llvm::LoopInfo::iterator |
iterator/begin/end - The interface to the top-level loops in the current function.
Definition at line 948 of file LoopInfo.h.
| llvm::LoopInfo::LoopInfo | ( | ) | [inline] |
| llvm::LoopInfo::~LoopInfo | ( | ) | [inline] |
| LoopInfoBase<BasicBlock>& llvm::LoopInfo::getBase | ( | ) | [inline] |
Definition at line 943 of file LoopInfo.h.
References LI.
Referenced by CloneLoop(), llvm::CloneLoop(), runOnFunction(), llvm::SplitBlock(), llvm::SplitCriticalEdge(), and llvm::UnrollLoop().
| iterator llvm::LoopInfo::begin | ( | ) | const [inline] |
Definition at line 949 of file LoopInfo.h.
Referenced by llvm::MachineLoopInfo::begin(), begin(), llvm::LiveIntervals::computeNumbering(), llvm::LPPassManager::deleteLoopFromQueue(), llvm::ScalarEvolution::print(), and llvm::LPPassManager::runOnFunction().
| iterator llvm::LoopInfo::end | ( | ) | const [inline] |
Definition at line 950 of file LoopInfo.h.
Referenced by llvm::LiveIntervals::computeNumbering(), llvm::LPPassManager::deleteLoopFromQueue(), llvm::MachineLoopInfo::end(), end(), llvm::ScalarEvolution::print(), and llvm::LPPassManager::runOnFunction().
| bool llvm::LoopInfo::empty | ( | ) | const [inline] |
Definition at line 951 of file LoopInfo.h.
Referenced by llvm::MachineLoopInfo::empty(), and empty().
| Loop* llvm::LoopInfo::getLoopFor | ( | const BasicBlock * | BB | ) | const [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 956 of file LoopInfo.h.
References getLoopFor(), and LI.
Referenced by CloneLoop(), llvm::LPPassManager::deleteLoopFromQueue(), llvm::MachineLoopInfo::getLoopFor(), getLoopFor(), llvm::MachineLoopInfo::operator[](), operator[](), llvm::ScalarEvolution::print(), llvm::SplitBlock(), llvm::SplitCriticalEdge(), and llvm::SCEVExpander::visitAddRecExpr().
| const Loop* llvm::LoopInfo::operator[] | ( | const BasicBlock * | BB | ) | const [inline] |
operator[] - same as getLoopFor...
Definition at line 962 of file LoopInfo.h.
References getLoopFor(), and LI.
| unsigned llvm::LoopInfo::getLoopDepth | ( | const BasicBlock * | BB | ) | const [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 969 of file LoopInfo.h.
References getLoopDepth(), and LI.
Referenced by llvm::MachineLoopInfo::getLoopDepth(), and getLoopDepth().
| bool llvm::LoopInfo::isLoopHeader | ( | BasicBlock * | BB | ) | const [inline] |
Definition at line 974 of file LoopInfo.h.
References isLoopHeader(), and LI.
Referenced by llvm::MachineLoopInfo::isLoopHeader(), and isLoopHeader().
| bool LoopInfo::runOnFunction | ( | Function & | F | ) | [virtual] |
runOnFunction - Calculate the natural loop information.
getNumBackEdges - Calculate the number of back edges to the loop header.
Implements llvm::FunctionPass.
Definition at line 44 of file LoopInfo.cpp.
References getBase(), and releaseMemory().
| virtual void llvm::LoopInfo::releaseMemory | ( | ) | [inline, virtual] |
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 982 of file LoopInfo.h.
References LI, and releaseMemory().
Referenced by llvm::MachineLoopInfo::releaseMemory(), releaseMemory(), and runOnFunction().
| virtual void llvm::LoopInfo::print | ( | std::ostream & | O, | |
| const Module * | M = 0 | |||
| ) | const [inline, 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 984 of file LoopInfo.h.
References LI, M, and print().
Referenced by print().
| void LoopInfo::getAnalysisUsage | ( | AnalysisUsage & | ) | const [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 50 of file LoopInfo.cpp.
References llvm::AnalysisUsage::addRequired(), and llvm::AnalysisUsage::setPreservesAll().
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 993 of file LoopInfo.h.
References LI, and removeLoop().
Referenced by llvm::LPPassManager::deleteLoopFromQueue(), llvm::MachineLoopInfo::removeLoop(), and removeLoop().
| void llvm::LoopInfo::changeLoopFor | ( | BasicBlock * | BB, | |
| Loop * | L | |||
| ) | [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 998 of file LoopInfo.h.
References changeLoopFor(), and LI.
Referenced by llvm::MachineLoopInfo::changeLoopFor(), changeLoopFor(), and llvm::LPPassManager::deleteLoopFromQueue().
changeTopLevelLoop - Replace the specified loop in the top-level loops list with the indicated loop.
Definition at line 1004 of file LoopInfo.h.
References changeTopLevelLoop(), and LI.
Referenced by llvm::MachineLoopInfo::changeTopLevelLoop(), and changeTopLevelLoop().
| void llvm::LoopInfo::addTopLevelLoop | ( | Loop * | New | ) | [inline] |
addTopLevelLoop - This adds the specified loop to the collection of top-level loops.
Definition at line 1010 of file LoopInfo.h.
References addTopLevelLoop(), and LI.
Referenced by llvm::MachineLoopInfo::addTopLevelLoop(), addTopLevelLoop(), llvm::LPPassManager::deleteLoopFromQueue(), and llvm::LPPassManager::insertLoop().
| void llvm::LoopInfo::removeBlock | ( | BasicBlock * | BB | ) | [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 1017 of file LoopInfo.h.
References LI, and removeBlock().
Referenced by llvm::LPPassManager::deleteLoopFromQueue(), FoldBlockIntoPredecessor(), llvm::MachineLoopInfo::removeBlock(), and removeBlock().
friend class LoopBase< BasicBlock > [friend] |
Definition at line 932 of file LoopInfo.h.
char LoopInfo::ID = 0 [static] |
Definition at line 935 of file LoopInfo.h.