LLVM API Documentation
#include <LoopInfo.h>
Public Types | |
| typedef std::vector< LoopT * > ::const_iterator | iterator |
| typedef std::vector< BlockT * > ::const_iterator | block_iterator |
| typedef std::pair< const BlockT *, const BlockT * > | Edge |
Public Member Functions | |
| LoopBase () | |
| Loop ctor - This creates an empty loop. | |
| ~LoopBase () | |
| unsigned | getLoopDepth () const |
| BlockT * | getHeader () const |
| LoopT * | getParentLoop () const |
| bool | contains (const BlockT *BB) const |
| const std::vector< LoopT * > & | getSubLoops () const |
| iterator | begin () const |
| iterator | end () const |
| bool | empty () const |
| const std::vector< BlockT * > & | getBlocks () const |
| block_iterator | block_begin () const |
| block_iterator | block_end () const |
| bool | isLoopExit (const BlockT *BB) const |
| unsigned | getNumBackEdges () const |
| void | getExitingBlocks (SmallVectorImpl< BlockT * > &ExitingBlocks) const |
| BlockT * | getExitingBlock () const |
| void | getExitBlocks (SmallVectorImpl< BlockT * > &ExitBlocks) const |
| BlockT * | getExitBlock () const |
| void | getExitEdges (SmallVectorImpl< Edge > &ExitEdges) const |
| void | getUniqueExitBlocks (SmallVectorImpl< BlockT * > &ExitBlocks) const |
| BlockT * | getUniqueExitBlock () const |
| BlockT * | getLoopPreheader () const |
| BlockT * | getLoopLatch () const |
| void | addBasicBlockToLoop (BlockT *NewBB, LoopInfoBase< BlockT, LoopT > &LI) |
| void | replaceChildLoopWith (LoopT *OldChild, LoopT *NewChild) |
| void | addChildLoop (LoopT *NewChild) |
| LoopT * | removeChildLoop (iterator I) |
| void | addBlockEntry (BlockT *BB) |
| void | moveToHeader (BlockT *BB) |
| void | removeBlockFromLoop (BlockT *BB) |
| void | verifyLoop () const |
| verifyLoop - Verify loop structure | |
| void | print (std::ostream &OS, unsigned Depth=0) const |
| void | print (std::ostream *O, unsigned Depth=0) const |
| void | dump () const |
Protected Member Functions | |
| LoopBase (BlockT *BB) | |
Friends | |
| class | LoopInfoBase< BlockT, LoopT > |
Definition at line 63 of file LoopInfo.h.
| typedef std::vector<LoopT *>::const_iterator llvm::LoopBase< BlockT, LoopT >::iterator |
Definition at line 105 of file LoopInfo.h.
| typedef std::vector<BlockT*>::const_iterator llvm::LoopBase< BlockT, LoopT >::block_iterator |
Definition at line 113 of file LoopInfo.h.
| typedef std::pair<const BlockT*,const BlockT*> llvm::LoopBase< BlockT, LoopT >::Edge |
getExitEdges - Return all pairs of (_inside_block_,_outside_block_). (Modelled after getExitingBlocks().)
Definition at line 218 of file LoopInfo.h.
| llvm::LoopBase< BlockT, LoopT >::LoopBase | ( | ) | [inline] |
| llvm::LoopBase< BlockT, LoopT >::~LoopBase | ( | ) | [inline] |
Definition at line 78 of file LoopInfo.h.
| llvm::LoopBase< BlockT, LoopT >::LoopBase | ( | BlockT * | BB | ) | [inline, explicit, protected] |
Definition at line 485 of file LoopInfo.h.
| unsigned llvm::LoopBase< BlockT, LoopT >::getLoopDepth | ( | ) | const [inline] |
getLoopDepth - Return the nesting level of this loop. An outer-most loop has depth 1, for consistency with loop depth values used for basic blocks, where depth 0 is used for blocks not inside any loops.
Definition at line 86 of file LoopInfo.h.
Referenced by llvm::AsmPrinter::EmitComments(), llvm::ScalarEvolution::getAddRecExpr(), llvm::LoopBase< llvm::MachineBasicBlock, llvm::MachineLoop >::print(), and PrintLoopInfo().
| BlockT* llvm::LoopBase< BlockT, LoopT >::getHeader | ( | ) | const [inline] |
Definition at line 93 of file LoopInfo.h.
Referenced by llvm::LoopBase< BlockT, LoopT >::addBasicBlockToLoop(), ApproximateLoopSize(), llvm::CloneLoop(), llvm::AsmPrinter::EmitComments(), FindPHIToPartitionLoops(), llvm::Loop::getCanonicalInductionVariable(), getConstantEvolvingPHI(), llvm::LoopBase< llvm::MachineBasicBlock, llvm::MachineLoop >::getLoopLatch(), llvm::LoopBase< llvm::MachineBasicBlock, llvm::MachineLoop >::getLoopPreheader(), llvm::LoopBase< llvm::MachineBasicBlock, llvm::MachineLoop >::getNumBackEdges(), llvm::SCEVExpander::getOrInsertCanonicalInductionVariable(), llvm::ScalarEvolution::getSCEVAtScope(), getSCEVStartAndStride(), llvm::Loop::getTripCount(), InsertAffinePhi(), llvm::ScalarEvolution::isLoopBackedgeGuardedByCond(), llvm::ScalarEvolution::isLoopGuardedByCond(), llvm::SCEVAddRecExpr::isLoopInvariant(), isTrivialLoopExitBlock(), llvm::SCEVAddRecExpr::print(), llvm::LoopBase< llvm::MachineBasicBlock, llvm::MachineLoop >::print(), llvm::IVUsers::print(), llvm::MSILWriter::printFunctionBody(), llvm::MSILWriter::printLoop(), PrintLoopInfo(), PushLoopPHIs(), llvm::LPPassManager::runOnFunction(), llvm::UnrollLoop(), llvm::LoopBase< llvm::MachineBasicBlock, llvm::MachineLoop >::verifyLoop(), and llvm::LoopDependencies::VisitLoop().
| LoopT* llvm::LoopBase< BlockT, LoopT >::getParentLoop | ( | ) | const [inline] |
Definition at line 94 of file LoopInfo.h.
Referenced by llvm::CloneLoop(), llvm::LPPassManager::deleteLoopFromQueue(), llvm::AsmPrinter::EmitComments(), llvm::IVUsers::getReplacementExpr(), llvm::ScalarEvolution::getSCEVAtScope(), LoopIsOuterMostWithPreheader(), llvm::ScalarEvolution::print(), llvm::MSILWriter::printFunctionBody(), llvm::MSILWriter::printLoop(), and llvm::LoopInfoBase< llvm::MachineBasicBlock, llvm::MachineLoop >::removeBlock().
| bool llvm::LoopBase< BlockT, LoopT >::contains | ( | const BlockT * | BB | ) | const [inline] |
contains - Return true if the specified basic block is in this loop
Definition at line 98 of file LoopInfo.h.
Referenced by FindIVIncInsertPt(), FindPHIToPartitionLoops(), llvm::Loop::getCanonicalInductionVariable(), llvm::Loop::getCanonicalInductionVariableIncrement(), getConstantEvolvingPHI(), llvm::LoopBase< llvm::MachineBasicBlock, llvm::MachineLoop >::getLoopLatch(), llvm::LoopBase< llvm::MachineBasicBlock, llvm::MachineLoop >::getLoopPreheader(), llvm::LoopBase< llvm::MachineBasicBlock, llvm::MachineLoop >::getNumBackEdges(), llvm::IVUsers::getReplacementExpr(), llvm::ScalarEvolution::getSCEVAtScope(), llvm::Loop::getTripCount(), llvm::LoopBase< llvm::MachineBasicBlock, llvm::MachineLoop >::isLoopExit(), llvm::SCEVAddRecExpr::isLoopInvariant(), llvm::SCEVUnknown::isLoopInvariant(), llvm::Loop::isLoopInvariant(), llvm::Loop::isLoopSimplifyForm(), isTrivialLoopExitBlockHelper(), isUsedOutsideLoop(), IVUseShouldUsePostIncValue(), RemoveCommonExpressionsFromUseBases(), llvm::UnrollLoop(), and llvm::LoopDependencies::VisitLoop().
| const std::vector<LoopT *>& llvm::LoopBase< BlockT, LoopT >::getSubLoops | ( | ) | const [inline] |
iterator/begin/end - Return the loops contained entirely within this loop.
Definition at line 104 of file LoopInfo.h.
| iterator llvm::LoopBase< BlockT, LoopT >::begin | ( | ) | const [inline] |
Definition at line 106 of file LoopInfo.h.
Referenced by addLoopIntoQueue(), llvm::GraphTraits< MachineLoop * >::child_begin(), llvm::GraphTraits< const Loop * >::child_begin(), llvm::GraphTraits< Loop * >::child_begin(), llvm::GraphTraits< const MachineLoop * >::child_begin(), CloneLoop(), llvm::CloneLoop(), llvm::LoopBase< llvm::MachineBasicBlock, llvm::MachineLoop >::print(), PrintChildLoopComment(), PrintLoopInfo(), and llvm::LoopBase< llvm::MachineBasicBlock, llvm::MachineLoop >::removeChildLoop().
| iterator llvm::LoopBase< BlockT, LoopT >::end | ( | ) | const [inline] |
Definition at line 107 of file LoopInfo.h.
Referenced by addLoopIntoQueue(), llvm::GraphTraits< MachineLoop * >::child_end(), llvm::GraphTraits< const MachineLoop * >::child_end(), llvm::GraphTraits< Loop * >::child_end(), llvm::GraphTraits< const Loop * >::child_end(), CloneLoop(), llvm::CloneLoop(), llvm::LPPassManager::deleteLoopFromQueue(), llvm::LoopBase< llvm::MachineBasicBlock, llvm::MachineLoop >::print(), PrintChildLoopComment(), and PrintLoopInfo().
| bool llvm::LoopBase< BlockT, LoopT >::empty | ( | ) | const [inline] |
Definition at line 108 of file LoopInfo.h.
Referenced by llvm::LPPassManager::deleteLoopFromQueue(), llvm::AsmPrinter::EmitComments(), and PrintLoopInfo().
| const std::vector<BlockT*>& llvm::LoopBase< BlockT, LoopT >::getBlocks | ( | ) | const [inline] |
getBlocks - Get a list of the basic blocks which make up this loop.
Definition at line 112 of file LoopInfo.h.
Referenced by llvm::LPPassManager::deleteLoopFromQueue(), llvm::ExtractLoop(), llvm::LoopBase< llvm::MachineBasicBlock, llvm::MachineLoop >::print(), llvm::MSILWriter::printLoop(), and llvm::UnrollLoop().
| block_iterator llvm::LoopBase< BlockT, LoopT >::block_begin | ( | ) | const [inline] |
Definition at line 114 of file LoopInfo.h.
Referenced by ApproximateLoopSize(), CloneLoop(), llvm::CloneLoop(), llvm::LoopBase< llvm::MachineBasicBlock, llvm::MachineLoop >::contains(), llvm::LPPassManager::deleteLoopFromQueue(), llvm::LoopBase< llvm::MachineBasicBlock, llvm::MachineLoop >::getExitBlocks(), llvm::LoopBase< llvm::MachineBasicBlock, llvm::MachineLoop >::getExitEdges(), llvm::LoopBase< llvm::MachineBasicBlock, llvm::MachineLoop >::getExitingBlocks(), GetMemRefInstrs(), llvm::LoopBase< llvm::MachineBasicBlock, llvm::MachineLoop >::getUniqueExitBlocks(), and llvm::Loop::isLCSSAForm().
| block_iterator llvm::LoopBase< BlockT, LoopT >::block_end | ( | ) | const [inline] |
Definition at line 115 of file LoopInfo.h.
Referenced by ApproximateLoopSize(), CloneLoop(), llvm::CloneLoop(), llvm::LoopBase< llvm::MachineBasicBlock, llvm::MachineLoop >::contains(), llvm::LPPassManager::deleteLoopFromQueue(), llvm::LoopBase< llvm::MachineBasicBlock, llvm::MachineLoop >::getExitBlocks(), llvm::LoopBase< llvm::MachineBasicBlock, llvm::MachineLoop >::getExitEdges(), llvm::LoopBase< llvm::MachineBasicBlock, llvm::MachineLoop >::getExitingBlocks(), GetMemRefInstrs(), llvm::LoopBase< llvm::MachineBasicBlock, llvm::MachineLoop >::getUniqueExitBlocks(), and llvm::Loop::isLCSSAForm().
| bool llvm::LoopBase< BlockT, LoopT >::isLoopExit | ( | const BlockT * | BB | ) | const [inline] |
isLoopExit - True if terminator in the block can branch to another block that is outside of the current loop.
Definition at line 120 of file LoopInfo.h.
Referenced by llvm::LoopBase< llvm::MachineBasicBlock, llvm::MachineLoop >::print().
| unsigned llvm::LoopBase< BlockT, LoopT >::getNumBackEdges | ( | ) | const [inline] |
getNumBackEdges - Calculate the number of back edges to the loop header
Definition at line 133 of file LoopInfo.h.
| void llvm::LoopBase< BlockT, LoopT >::getExitingBlocks | ( | SmallVectorImpl< BlockT * > & | ExitingBlocks | ) | const [inline] |
getExitingBlocks - Return all blocks inside the loop that have successors outside of the loop. These are the blocks _inside of the current loop_ which branch out. The returned list is always unique.
Definition at line 159 of file LoopInfo.h.
Referenced by llvm::LoopBase< llvm::MachineBasicBlock, llvm::MachineLoop >::getExitingBlock().
| BlockT* llvm::LoopBase< BlockT, LoopT >::getExitingBlock | ( | ) | const [inline] |
getExitingBlock - If getExitingBlocks would return exactly one block, return that block. Otherwise return null.
Definition at line 179 of file LoopInfo.h.
| void llvm::LoopBase< BlockT, LoopT >::getExitBlocks | ( | SmallVectorImpl< BlockT * > & | ExitBlocks | ) | const [inline] |
getExitBlocks - Return all of the successor blocks of this loop. These are the blocks _outside of the current loop_ which are branched to.
Definition at line 190 of file LoopInfo.h.
Referenced by llvm::LoopBase< llvm::MachineBasicBlock, llvm::MachineLoop >::getExitBlock(), llvm::Loop::isLoopSimplifyForm(), and PrintLoopInfo().
| BlockT* llvm::LoopBase< BlockT, LoopT >::getExitBlock | ( | ) | const [inline] |
getExitBlock - If getExitBlocks would return exactly one block, return that block. Otherwise return null.
Definition at line 208 of file LoopInfo.h.
| void llvm::LoopBase< BlockT, LoopT >::getExitEdges | ( | SmallVectorImpl< Edge > & | ExitEdges | ) | const [inline] |
Definition at line 219 of file LoopInfo.h.
| void llvm::LoopBase< BlockT, LoopT >::getUniqueExitBlocks | ( | SmallVectorImpl< BlockT * > & | ExitBlocks | ) | const [inline] |
getUniqueExitBlocks - Return all unique successor blocks of this loop. These are the blocks _outside of the current loop_ which are branched to. This assumes that loop is in canonical form.
Definition at line 239 of file LoopInfo.h.
Referenced by llvm::LoopBase< llvm::MachineBasicBlock, llvm::MachineLoop >::getUniqueExitBlock().
| BlockT* llvm::LoopBase< BlockT, LoopT >::getUniqueExitBlock | ( | ) | const [inline] |
getUniqueExitBlock - If getUniqueExitBlocks would return exactly one block, return that block. Otherwise return null.
Definition at line 295 of file LoopInfo.h.
| BlockT* llvm::LoopBase< BlockT, LoopT >::getLoopPreheader | ( | ) | const [inline] |
getLoopPreheader - If there is a preheader for this loop, return it. A loop has a preheader if there is only one edge to the header of the loop from outside of the loop. If this is the case, the block branching to the header of the loop is the preheader node.
This method returns null if there is no preheader for the loop.
Definition at line 310 of file LoopInfo.h.
Referenced by getSCEVStartAndStride(), InsertAffinePhi(), llvm::Loop::isLoopSimplifyForm(), LoopIsOuterMostWithPreheader(), llvm::Loop::makeLoopInvariant(), llvm::UnrollLoop(), and llvm::LoopBase< llvm::MachineBasicBlock, llvm::MachineLoop >::verifyLoop().
| BlockT* llvm::LoopBase< BlockT, LoopT >::getLoopLatch | ( | ) | const [inline] |
getLoopLatch - If there is a single latch block for this loop, return it. A latch block is a block that contains a branch back to the header. A loop header in normal form has two edges into it: one from a preheader and one from a latch block.
Definition at line 343 of file LoopInfo.h.
Referenced by llvm::CloneLoop(), FindIVIncInsertPt(), InsertAffinePhi(), llvm::ScalarEvolution::isLoopBackedgeGuardedByCond(), llvm::Loop::isLoopSimplifyForm(), IVUseShouldUsePostIncValue(), llvm::LoopBase< llvm::MachineBasicBlock, llvm::MachineLoop >::print(), llvm::UnrollLoop(), and llvm::LoopBase< llvm::MachineBasicBlock, llvm::MachineLoop >::verifyLoop().
| void llvm::LoopBase< BlockT, LoopT >::addBasicBlockToLoop | ( | BlockT * | NewBB, | |
| LoopInfoBase< BlockT, LoopT > & | LI | |||
| ) | [inline] |
addBasicBlockToLoop - This method is used by other analyses to update loop information. NewBB is set to be a new member of the current loop. Because of this, it is added as a member of all parent loops, and is added to the specified LoopInfo object as being in the current basic block. It is not valid to replace the loop header with this method.
Definition at line 1020 of file LoopInfo.h.
References llvm::LoopInfoBase< BlockT, LoopT >::BBMap, llvm::LoopBase< BlockT, LoopT >::getHeader(), and L.
Referenced by CloneLoop(), llvm::CloneLoop(), llvm::SplitBlock(), and llvm::UnrollLoop().
| void llvm::LoopBase< BlockT, LoopT >::replaceChildLoopWith | ( | LoopT * | OldChild, | |
| LoopT * | NewChild | |||
| ) | [inline] |
replaceChildLoopWith - This is used when splitting loops up. It replaces the OldChild entry in our children list with NewChild, and updates the parent pointer of OldChild to be null and the NewChild to be this loop. This updates the loop depth of the new child.
Definition at line 384 of file LoopInfo.h.
| void llvm::LoopBase< BlockT, LoopT >::addChildLoop | ( | LoopT * | NewChild | ) | [inline] |
addChildLoop - Add the specified loop to be a child of this loop. This updates the loop depth of the new child.
Definition at line 399 of file LoopInfo.h.
Referenced by llvm::LPPassManager::insertLoop().
| LoopT* llvm::LoopBase< BlockT, LoopT >::removeChildLoop | ( | iterator | I | ) | [inline] |
removeChildLoop - This removes the specified child from being a subloop of this loop. The loop is not deleted, as it will presumably be inserted into another loop.
Definition at line 408 of file LoopInfo.h.
Referenced by llvm::LPPassManager::deleteLoopFromQueue().
| void llvm::LoopBase< BlockT, LoopT >::addBlockEntry | ( | BlockT * | BB | ) | [inline] |
addBlockEntry - This adds a basic block directly to the basic block list. This should only be used by transformations that create new loops. Other transformations should use addBasicBlockToLoop.
Definition at line 420 of file LoopInfo.h.
| void llvm::LoopBase< BlockT, LoopT >::moveToHeader | ( | BlockT * | BB | ) | [inline] |
moveToHeader - This method is used to move BB (which must be part of this loop) to be the loop header of the loop (the block that dominates all others).
Definition at line 427 of file LoopInfo.h.
| void llvm::LoopBase< BlockT, LoopT >::removeBlockFromLoop | ( | BlockT * | BB | ) | [inline] |
removeBlockFromLoop - This removes the specified basic block from the current loop, updating the Blocks as appropriate. This does not update the mapping in the LoopInfo class.
Definition at line 442 of file LoopInfo.h.
Referenced by llvm::LoopInfoBase< llvm::MachineBasicBlock, llvm::MachineLoop >::removeBlock().
| void llvm::LoopBase< BlockT, LoopT >::verifyLoop | ( | ) | const [inline] |
| void llvm::LoopBase< BlockT, LoopT >::print | ( | std::ostream & | OS, | |
| unsigned | Depth = 0 | |||
| ) | const [inline] |
Definition at line 457 of file LoopInfo.h.
Referenced by llvm::LoopBase< llvm::MachineBasicBlock, llvm::MachineLoop >::dump(), and llvm::LoopBase< llvm::MachineBasicBlock, llvm::MachineLoop >::print().
| void llvm::LoopBase< BlockT, LoopT >::print | ( | std::ostream * | O, | |
| unsigned | Depth = 0 | |||
| ) | const [inline] |
Definition at line 475 of file LoopInfo.h.
| void llvm::LoopBase< BlockT, LoopT >::dump | ( | ) | const [inline] |
Definition at line 479 of file LoopInfo.h.
friend class LoopInfoBase< BlockT, LoopT > [friend] |
Definition at line 484 of file LoopInfo.h.