|
LLVM 24.0.0git
|
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. | |
| typedef std::vector< BasicBlock * >::const_reverse_iterator | RPOIterator |
Public Member Functions | |
| LoopBlocksDFS (Loop *Container) | |
| Loop * | getLoop () const |
| LLVM_ABI void | perform (const 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 37 of file LoopIterator.h.
| typedef std::vector<BasicBlock*>::const_iterator llvm::LoopBlocksDFS::POIterator |
Postorder list iterators.
Definition at line 40 of file LoopIterator.h.
| typedef std::vector<BasicBlock*>::const_reverse_iterator llvm::LoopBlocksDFS::RPOIterator |
Definition at line 41 of file LoopIterator.h.
|
inline |
Definition at line 55 of file LoopIterator.h.
References llvm::LoopBase< BlockT, LoopT >::getNumBlocks(), and llvm::NextPowerOf2().
|
inline |
Iterate over the cached postorder blocks.
Definition at line 69 of file LoopIterator.h.
References assert(), and isComplete().
|
inline |
Reverse iterate over the cached postorder blocks.
Definition at line 76 of file LoopIterator.h.
References assert(), and isComplete().
Referenced by CloneLoopBlocks(), cloneLoopBlocks(), llvm::LoopVectorizationCostModel::collectValuesToIgnore(), llvm::DataDependenceGraph::DataDependenceGraph(), llvm::UnrollAndJamLoop(), and llvm::UnrollLoop().
|
inline |
Definition at line 104 of file LoopIterator.h.
|
inline |
Definition at line 73 of file LoopIterator.h.
|
inline |
Definition at line 80 of file LoopIterator.h.
Referenced by CloneLoopBlocks(), cloneLoopBlocks(), llvm::LoopVectorizationCostModel::collectValuesToIgnore(), llvm::DataDependenceGraph::DataDependenceGraph(), llvm::UnrollAndJamLoop(), and llvm::UnrollLoop().
|
inline |
Definition at line 60 of file LoopIterator.h.
|
inline |
Get a block's postorder number.
Definition at line 92 of file LoopIterator.h.
Referenced by getRPO().
|
inline |
Get a block's reverse postorder number.
Definition at line 100 of file LoopIterator.h.
References getPostorder().
|
inline |
Return true if this block has a postorder number.
Definition at line 86 of file LoopIterator.h.
References I.
|
inline |
Return true if this block has been preorder visited.
Definition at line 83 of file LoopIterator.h.
|
inline |
Return true if postorder numbers are assigned to all loop blocks.
Definition at line 66 of file LoopIterator.h.
Referenced by beginPostorder(), and beginRPO().
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 1327 of file LoopInfo.cpp.
References LoopBlocksTraversal.
Referenced by llvm::LoopVectorizationCostModel::collectValuesToIgnore(), llvm::DataDependenceGraph::DataDependenceGraph(), llvm::peelLoop(), llvm::UnrollAndJamLoop(), llvm::UnrollLoop(), and llvm::UnrollRuntimeLoopRemainder().
|
friend |
Definition at line 43 of file LoopIterator.h.
References LoopBlocksTraversal.
Referenced by LoopBlocksTraversal, and perform().