LLVM API Documentation
#include <LoopIterator.h>
Public Types | |
typedef std::vector < BasicBlock * > ::const_iterator | POIterator |
Postorder list iterators. | |
typedef std::vector < BasicBlock * > ::const_reverse_iterator | RPOIterator |
Public Member Functions | |
LoopBlocksDFS (Loop *Container) | |
Loop * | getLoop () const |
void | perform (LoopInfo *LI) |
Traverse the loop blocks and store the DFS result. | |
bool | isComplete () const |
Return true if postorder numbers are assigned to all loop blocks. | |
POIterator | beginPostorder () const |
Iterate over the cached postorder blocks. | |
POIterator | endPostorder () const |
RPOIterator | beginRPO () const |
Reverse iterate over the cached postorder blocks. | |
RPOIterator | endRPO () const |
bool | hasPreorder (BasicBlock *BB) const |
Return true if this block has been preorder visited. | |
bool | hasPostorder (BasicBlock *BB) const |
Return true if this block has a postorder number. | |
unsigned | getPostorder (BasicBlock *BB) const |
Get a block's postorder number. | |
unsigned | getRPO (BasicBlock *BB) const |
Get a block's reverse postorder number. | |
void | clear () |
Friends | |
class | LoopBlocksTraversal |
Store the result of a depth first search within basic blocks contained by a single loop.
TODO: This could be generalized for any CFG region, or the entire CFG.
Definition at line 38 of file LoopIterator.h.
typedef std::vector<BasicBlock*>::const_iterator llvm::LoopBlocksDFS::POIterator |
Postorder list iterators.
Definition at line 41 of file LoopIterator.h.
typedef std::vector<BasicBlock*>::const_reverse_iterator llvm::LoopBlocksDFS::RPOIterator |
Definition at line 42 of file LoopIterator.h.
llvm::LoopBlocksDFS::LoopBlocksDFS | ( | Loop * | Container | ) | [inline] |
Definition at line 56 of file LoopIterator.h.
References llvm::LoopBase< BlockT, LoopT >::getNumBlocks().
POIterator llvm::LoopBlocksDFS::beginPostorder | ( | ) | const [inline] |
Iterate over the cached postorder blocks.
Definition at line 70 of file LoopIterator.h.
References isComplete().
RPOIterator llvm::LoopBlocksDFS::beginRPO | ( | ) | const [inline] |
Reverse iterate over the cached postorder blocks.
Definition at line 77 of file LoopIterator.h.
References isComplete().
Referenced by CloneLoopBlocks(), and llvm::UnrollLoop().
void llvm::LoopBlocksDFS::clear | ( | ) | [inline] |
Definition at line 105 of file LoopIterator.h.
References llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT >::clear().
POIterator llvm::LoopBlocksDFS::endPostorder | ( | ) | const [inline] |
Definition at line 74 of file LoopIterator.h.
RPOIterator llvm::LoopBlocksDFS::endRPO | ( | ) | const [inline] |
Definition at line 81 of file LoopIterator.h.
Referenced by CloneLoopBlocks(), and llvm::UnrollLoop().
Loop* llvm::LoopBlocksDFS::getLoop | ( | ) | const [inline] |
Definition at line 61 of file LoopIterator.h.
unsigned llvm::LoopBlocksDFS::getPostorder | ( | BasicBlock * | BB | ) | const [inline] |
Get a block's postorder number.
Definition at line 93 of file LoopIterator.h.
References llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT >::end(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT >::find(), and I.
Referenced by getRPO().
unsigned llvm::LoopBlocksDFS::getRPO | ( | BasicBlock * | BB | ) | const [inline] |
Get a block's reverse postorder number.
Definition at line 101 of file LoopIterator.h.
References getPostorder().
bool llvm::LoopBlocksDFS::hasPostorder | ( | BasicBlock * | BB | ) | const [inline] |
Return true if this block has a postorder number.
Definition at line 87 of file LoopIterator.h.
References llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT >::end(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT >::find(), and I.
bool llvm::LoopBlocksDFS::hasPreorder | ( | BasicBlock * | BB | ) | const [inline] |
Return true if this block has been preorder visited.
Definition at line 84 of file LoopIterator.h.
References llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT >::count().
bool llvm::LoopBlocksDFS::isComplete | ( | ) | const [inline] |
Return true if postorder numbers are assigned to all loop blocks.
Definition at line 67 of file LoopIterator.h.
References llvm::LoopBase< BlockT, LoopT >::getNumBlocks().
Referenced by beginPostorder(), and beginRPO().
void LoopBlocksDFS::perform | ( | LoopInfo * | LI | ) |
Traverse the loop blocks and store the DFS result.
Traverse the loop blocks and store the DFS result. Useful for clients that just want the final DFS result and don't need to visit blocks during the initial traversal.
Definition at line 720 of file LoopInfo.cpp.
References llvm::LoopBlocksTraversal::begin(), and llvm::LoopBlocksTraversal::end().
Referenced by llvm::UnrollLoop(), and llvm::UnrollRuntimeLoopProlog().
friend class LoopBlocksTraversal [friend] |
Definition at line 44 of file LoopIterator.h.