LLVM
8.0.1
|
Store the result of a depth first search within basic blocks contained by a single loop. More...
#include "llvm/Analysis/LoopIterator.h"
Public Types | |
typedef std::vector< BasicBlock * >::const_iterator | POIterator |
Postorder list iterators. More... | |
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. More... | |
bool | isComplete () const |
Return true if postorder numbers are assigned to all loop blocks. More... | |
POIterator | beginPostorder () const |
Iterate over the cached postorder blocks. More... | |
POIterator | endPostorder () const |
RPOIterator | beginRPO () const |
Reverse iterate over the cached postorder blocks. More... | |
RPOIterator | endRPO () const |
bool | hasPreorder (BasicBlock *BB) const |
Return true if this block has been preorder visited. More... | |
bool | hasPostorder (BasicBlock *BB) const |
Return true if this block has a postorder number. More... | |
unsigned | getPostorder (BasicBlock *BB) const |
Get a block's postorder number. More... | |
unsigned | getRPO (BasicBlock *BB) const |
Get a block's reverse postorder number. More... | |
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 98 of file LoopIterator.h.
typedef std::vector<BasicBlock*>::const_iterator llvm::LoopBlocksDFS::POIterator |
Postorder list iterators.
Definition at line 101 of file LoopIterator.h.
typedef std::vector<BasicBlock*>::const_reverse_iterator llvm::LoopBlocksDFS::RPOIterator |
Definition at line 102 of file LoopIterator.h.
|
inline |
Definition at line 116 of file LoopIterator.h.
References llvm::LoopBase< BlockT, LoopT >::getNumBlocks(), and llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::reserve().
|
inline |
Iterate over the cached postorder blocks.
Definition at line 130 of file LoopIterator.h.
References assert().
Referenced by getOnlyLiveSuccessor().
|
inline |
Reverse iterate over the cached postorder blocks.
Definition at line 137 of file LoopIterator.h.
References assert().
Referenced by llvm::LoopBlocksRPO::begin(), llvm::LoopVectorizationCostModel::calculateRegisterUsage(), CloneLoopBlocks(), cloneLoopBlocks(), llvm::concatenateVectors(), getOnlyLiveSuccessor(), llvm::VPRecipeBuilder::tryToCreateRecipe(), and llvm::UnrollLoop().
|
inline |
Definition at line 165 of file LoopIterator.h.
References llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::clear().
|
inline |
Definition at line 134 of file LoopIterator.h.
Referenced by getOnlyLiveSuccessor().
|
inline |
Definition at line 141 of file LoopIterator.h.
Referenced by llvm::LoopVectorizationCostModel::calculateRegisterUsage(), CloneLoopBlocks(), cloneLoopBlocks(), llvm::concatenateVectors(), llvm::LoopBlocksRPO::end(), getOnlyLiveSuccessor(), llvm::VPRecipeBuilder::tryToCreateRecipe(), and llvm::UnrollLoop().
|
inline |
Definition at line 121 of file LoopIterator.h.
|
inline |
Get a block's postorder number.
Definition at line 153 of file LoopIterator.h.
References assert(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::end(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::find(), and llvm::iterator_adaptor_base< WrappedSuccIterator, succ_iterator, std::iterator_traits< succ_iterator >::iterator_category, NodeRef, std::ptrdiff_t, NodeRef *, NodeRef >::I.
|
inline |
Get a block's reverse postorder number.
Definition at line 161 of file LoopIterator.h.
|
inline |
Return true if this block has a postorder number.
Definition at line 147 of file LoopIterator.h.
References llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::end(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::find(), and llvm::iterator_adaptor_base< WrappedSuccIterator, succ_iterator, std::iterator_traits< succ_iterator >::iterator_category, NodeRef, std::ptrdiff_t, NodeRef *, NodeRef >::I.
|
inline |
Return true if this block has been preorder visited.
Definition at line 144 of file LoopIterator.h.
References llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::count().
|
inline |
Return true if postorder numbers are assigned to all loop blocks.
Definition at line 127 of file LoopIterator.h.
References llvm::LoopBase< BlockT, LoopT >::getNumBlocks().
Referenced by getOnlyLiveSuccessor().
void LoopBlocksDFS::perform | ( | LoopInfo * | LI | ) |
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 817 of file LoopInfo.cpp.
References llvm::LoopBlocksTraversal::begin(), and llvm::LoopBlocksTraversal::end().
Referenced by llvm::LoopVectorizationCostModel::calculateRegisterUsage(), llvm::concatenateVectors(), getOnlyLiveSuccessor(), llvm::peelLoop(), llvm::LoopBlocksRPO::perform(), llvm::VPRecipeBuilder::tryToCreateRecipe(), llvm::UnrollLoop(), and llvm::UnrollRuntimeLoopRemainder().
|
friend |
Definition at line 104 of file LoopIterator.h.