LLVM
10.0.0svn
|
Instances of this class are used to represent loops that are detected in the flow graph. More...
#include "llvm/Analysis/LoopInfo.h"
Public Types | |
typedef std::vector< LoopT * >::const_iterator | iterator |
typedef std::vector< LoopT * >::const_reverse_iterator | reverse_iterator |
typedef ArrayRef< BlockT * >::const_iterator | block_iterator |
typedef std::pair< BlockT *, BlockT * > | Edge |
Edge type. More... | |
Public Member Functions | |
unsigned | getLoopDepth () const |
Return the nesting level of this loop. More... | |
BlockT * | getHeader () const |
LoopT * | getParentLoop () const |
void | setParentLoop (LoopT *L) |
This is a raw interface for bypassing addChildLoop. More... | |
bool | contains (const LoopT *L) const |
Return true if the specified loop is contained within in this loop. More... | |
bool | contains (const BlockT *BB) const |
Return true if the specified basic block is in this loop. More... | |
template<class InstT > | |
bool | contains (const InstT *Inst) const |
Return true if the specified instruction is in this loop. More... | |
const std::vector< LoopT * > & | getSubLoops () const |
Return the loops contained entirely within this loop. More... | |
std::vector< LoopT * > & | getSubLoopsVector () |
iterator | begin () const |
iterator | end () const |
reverse_iterator | rbegin () const |
reverse_iterator | rend () const |
bool | empty () const |
ArrayRef< BlockT * > | getBlocks () const |
Get a list of the basic blocks which make up this loop. More... | |
block_iterator | block_begin () const |
block_iterator | block_end () const |
iterator_range< block_iterator > | blocks () const |
unsigned | getNumBlocks () const |
Get the number of blocks in this loop in constant time. More... | |
std::vector< BlockT * > & | getBlocksVector () |
Return a direct, mutable handle to the blocks vector so that we can mutate it efficiently with techniques like std::remove . More... | |
SmallPtrSetImpl< const BlockT * > & | getBlocksSet () |
Return a direct, mutable handle to the blocks set so that we can mutate it efficiently. More... | |
const SmallPtrSetImpl< const BlockT * > & | getBlocksSet () const |
Return a direct, immutable handle to the blocks set. More... | |
bool | isInvalid () const |
Return true if this loop is no longer valid. More... | |
bool | isLoopExiting (const BlockT *BB) const |
True if terminator in the block can branch to another block that is outside of the current loop. More... | |
bool | isLoopLatch (const BlockT *BB) const |
unsigned | getNumBackEdges () const |
Calculate the number of back edges to the loop header. More... | |
void | getExitingBlocks (SmallVectorImpl< BlockT *> &ExitingBlocks) const |
Return all blocks inside the loop that have successors outside of the loop. More... | |
BlockT * | getExitingBlock () const |
If getExitingBlocks would return exactly one block, return that block. More... | |
void | getExitBlocks (SmallVectorImpl< BlockT *> &ExitBlocks) const |
Return all of the successor blocks of this loop. More... | |
BlockT * | getExitBlock () const |
If getExitBlocks would return exactly one block, return that block. More... | |
bool | hasDedicatedExits () const |
Return true if no exit block for the loop has a predecessor that is outside the loop. More... | |
void | getUniqueExitBlocks (SmallVectorImpl< BlockT *> &ExitBlocks) const |
Return all unique successor blocks of this loop. More... | |
void | getUniqueNonLatchExitBlocks (SmallVectorImpl< BlockT *> &ExitBlocks) const |
Return all unique successor blocks of this loop except successors from Latch block are not considered. More... | |
BlockT * | getUniqueExitBlock () const |
If getUniqueExitBlocks would return exactly one block, return that block. More... | |
void | getExitEdges (SmallVectorImpl< Edge > &ExitEdges) const |
Return all pairs of (inside_block,outside_block). More... | |
BlockT * | getLoopPreheader () const |
If there is a preheader for this loop, return it. More... | |
BlockT * | getLoopPredecessor () const |
If the given loop's header has exactly one unique predecessor outside the loop, return it. More... | |
BlockT * | getLoopLatch () const |
If there is a single latch block for this loop, return it. More... | |
void | getLoopLatches (SmallVectorImpl< BlockT *> &LoopLatches) const |
Return all loop latch blocks of this loop. More... | |
SmallVector< const LoopT *, 4 > | getLoopsInPreorder () const |
Return all loops in the loop nest rooted by the loop in preorder, with siblings in forward program order. More... | |
SmallVector< LoopT *, 4 > | getLoopsInPreorder () |
void | addBasicBlockToLoop (BlockT *NewBB, LoopInfoBase< BlockT, LoopT > &LI) |
This method is used by other analyses to update loop information. More... | |
void | replaceChildLoopWith (LoopT *OldChild, LoopT *NewChild) |
This is used when splitting loops up. More... | |
void | addChildLoop (LoopT *NewChild) |
Add the specified loop to be a child of this loop. More... | |
LoopT * | removeChildLoop (iterator I) |
This removes the specified child from being a subloop of this loop. More... | |
LoopT * | removeChildLoop (LoopT *Child) |
This removes the specified child from being a subloop of this loop. More... | |
void | addBlockEntry (BlockT *BB) |
This adds a basic block directly to the basic block list. More... | |
void | reverseBlock (unsigned from) |
interface to reverse Blocks[from, end of loop] in this loop More... | |
void | reserveBlocks (unsigned size) |
interface to do reserve() for Blocks More... | |
void | moveToHeader (BlockT *BB) |
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). More... | |
void | removeBlockFromLoop (BlockT *BB) |
This removes the specified basic block from the current loop, updating the Blocks as appropriate. More... | |
void | verifyLoop () const |
Verify loop structure. More... | |
void | verifyLoopNest (DenseSet< const LoopT *> *Loops) const |
Verify loop structure of this loop and all nested loops. More... | |
bool | isAnnotatedParallel () const |
Returns true if the loop is annotated parallel. More... | |
void | print (raw_ostream &OS, unsigned Depth=0, bool Verbose=false) const |
Print loop with all the BBs inside it. More... | |
Static Public Member Functions | |
template<class Type > | |
static void | getInnerLoopsInPreorder (const LoopT &L, SmallVectorImpl< Type > &PreOrderLoops) |
Return all inner loops in the loop nest rooted by the loop in preorder, with siblings in forward program order. More... | |
Protected Member Functions | |
LoopBase () | |
This creates an empty loop. More... | |
LoopBase (BlockT *BB) | |
~LoopBase () | |
Friends | |
class | LoopInfoBase< BlockT, LoopT > |
Instances of this class are used to represent loops that are detected in the flow graph.
Definition at line 68 of file LoopInfo.h.
typedef ArrayRef<BlockT *>::const_iterator llvm::LoopBase< BlockT, LoopT >::block_iterator |
Definition at line 158 of file LoopInfo.h.
typedef std::pair<BlockT *, BlockT *> llvm::LoopBase< BlockT, LoopT >::Edge |
Edge type.
Definition at line 289 of file LoopInfo.h.
typedef std::vector<LoopT *>::const_iterator llvm::LoopBase< BlockT, LoopT >::iterator |
Definition at line 144 of file LoopInfo.h.
typedef std::vector<LoopT *>::const_reverse_iterator llvm::LoopBase< BlockT, LoopT >::reverse_iterator |
Definition at line 146 of file LoopInfo.h.
|
inlineprotected |
This creates an empty loop.
Definition at line 468 of file LoopInfo.h.
|
inlineexplicitprotected |
Definition at line 470 of file LoopInfo.h.
|
inlineprotected |
Definition at line 484 of file LoopInfo.h.
void llvm::LoopBase< BlockT, LoopT >::addBasicBlockToLoop | ( | BlockT * | NewBB, |
LoopInfoBase< BlockT, LoopT > & | LIB | ||
) |
This method is used by other analyses to update loop information.
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 235 of file LoopInfoImpl.h.
Referenced by llvm::addClonedBlockToLoopInfo(), buildClonedLoops(), CloneLoop(), cloneLoopBlocks(), llvm::cloneLoopWithPreheader(), createFFSIntrinsic(), llvm::InnerLoopVectorizer::createVectorizedLoopSkeleton(), llvm::InnerLoopVectorizer::emitMemRuntimeChecks(), llvm::InnerLoopVectorizer::emitMinimumIterationCountCheck(), llvm::InnerLoopVectorizer::emitSCEVChecks(), llvm::VPBasicBlock::execute(), llvm::VPlan::execute(), llvm::LoopBase< BasicBlock, Loop >::getLoopsInPreorder(), insertUniqueBackedgeBlock(), mayLoopAccessLocation(), llvm::sinkRegion(), turnGuardIntoBranch(), llvm::UnrollAndJamLoop(), and UpdateAnalysisInformation().
|
inline |
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 403 of file LoopInfo.h.
Referenced by isProfitableForVectorization(), and separateNestedLoop().
|
inline |
Add the specified loop to be a child of this loop.
This updates the loop depth of the new child.
Definition at line 375 of file LoopInfo.h.
Referenced by llvm::addClonedBlockToLoopInfo(), CloneLoop(), cloneLoopNest(), llvm::cloneLoopWithPreheader(), createFFSIntrinsic(), llvm::InnerLoopVectorizer::createVectorizedLoopSkeleton(), getInnermostLoopFor(), hoistLoopToNewParent(), isProfitableForVectorization(), rebuildLoopAfterUnswitch(), and separateNestedLoop().
|
inline |
Definition at line 147 of file LoopInfo.h.
Referenced by llvm::internal::appendLoopsToWorklist(), appendLoopsToWorklist(), llvm::PPCTTIImpl::canSaveCmp(), llvm::GraphTraits< const MachineLoop * >::child_begin(), llvm::GraphTraits< MachineLoop * >::child_begin(), llvm::GraphTraits< const Loop * >::child_begin(), llvm::GraphTraits< Loop * >::child_begin(), llvm::createCodeGenPreparePass(), deleteLoopIfDead(), llvm::LoopInfo::erase(), INITIALIZE_PASS(), isProfitableForVectorization(), LoopIsOuterMostWithPredecessor(), pointerInvalidatedByLoop(), llvm::LoopBase< BasicBlock, Loop >::removeChildLoop(), llvm::LoopInfoBase< BasicBlock, Loop >::removeLoop(), llvm::LoopFullUnrollPass::run(), llvm::LoopSimplifyPass::run(), llvm::simplifyLoop(), llvm::UnrollAndJamLoop(), and llvm::ScalarEvolution::verify().
|
inline |
Definition at line 159 of file LoopInfo.h.
Referenced by llvm::LoopBase< BasicBlock, Loop >::blocks(), CloneLoop(), llvm::SimpleLoopSafetyInfo::computeLoopSafetyInfo(), llvm::deleteDeadLoop(), detectPopcountIdiom(), detectShiftUntilZeroIdiom(), EqualityPropUnSafe(), llvm::LoopInfo::erase(), getLayoutSuccessorProbThreshold(), llvm::PPCTargetLowering::getPrefLoopAlignment(), llvm::BasicTTIImplBase< AMDGPUTTIImpl >::getUnrollingPreferences(), llvm::PPCTTIImpl::isHardwareLoopProfitable(), mayLoopAccessLocation(), partitionOuterLoopBlocks(), separateNestedLoop(), and simplifyOneLoop().
|
inline |
Definition at line 160 of file LoopInfo.h.
Referenced by llvm::LoopBase< BasicBlock, Loop >::blocks(), CloneLoop(), llvm::SimpleLoopSafetyInfo::computeLoopSafetyInfo(), llvm::deleteDeadLoop(), EqualityPropUnSafe(), llvm::LoopInfo::erase(), getLayoutSuccessorProbThreshold(), llvm::PPCTargetLowering::getPrefLoopAlignment(), llvm::BasicTTIImplBase< AMDGPUTTIImpl >::getUnrollingPreferences(), llvm::PPCTTIImpl::isHardwareLoopProfitable(), mayLoopAccessLocation(), partitionOuterLoopBlocks(), separateNestedLoop(), and simplifyOneLoop().
|
inline |
Definition at line 161 of file LoopInfo.h.
Referenced by llvm::ApproximateLoopSize(), areLoopExitPHIsSupported(), buildClonedLoopBlocks(), buildClonedLoops(), Cleanup(), cloneLoopNest(), llvm::ICFLoopSafetyInfo::computeLoopSafetyInfo(), countToEliminateCompares(), llvm::createFalkorMarkStridedAccessesPass(), llvm::DataDependenceGraph::DataDependenceGraph(), deleteDeadBlocksFromLoop(), deleteDeadClonedBlocks(), llvm::deleteDeadLoop(), EqualityPropUnSafe(), llvm::formDedicatedExitBlocks(), getFalkorUnrollingPreferences(), getInnermostLoopFor(), getMaxBackedgeTakenCount(), GetPointerOperand(), llvm::SITargetLowering::getPrefLoopAlignment(), llvm::SystemZTTIImpl::getUnrollingPreferences(), hoistLoopToNewParent(), llvm::PPCTTIImpl::isHardwareLoopProfitable(), isLoopDead(), isProfitableForVectorization(), mayLoopAccessLocation(), mergeBlocksIntoPredecessors(), normalizePredicate(), partitionOuterLoopBlocks(), populateDependencyMatrix(), llvm::MemoryDepChecker::Dependence::print(), llvm::printLoop(), llvm::promoteLoopAccessesToScalars(), rebuildLoopAfterUnswitch(), llvm::LoopDataPrefetchPass::run(), sinkLoopInvariantInstructions(), llvm::VPRecipeBuilder::tryToCreateRecipe(), llvm::UnrollLoop(), llvm::UnrollRuntimeLoopRemainder(), and unswitchBestCondition().
|
inline |
Return true if the specified loop is contained within in this loop.
Definition at line 115 of file LoopInfo.h.
Referenced by llvm::DivergenceAnalysis::addUniformOverride(), llvm::LoopSafetyInfo::allLoopPathsLeadToBlock(), allPhiOperandsUndefined(), analyzeLoopUnrollCost(), llvm::PredicatedScalarEvolution::areAddRecsEqualWithPreds(), llvm::LoopAccessInfo::blockNeedsPredication(), buildClonedLoops(), BuildConstantFromSCEV(), calculateUnswitchCostMultiplier(), canConstantEvolve(), canFoldIVIncExpr(), CanGenerateTest(), CanProveNotTakenFirstIteration(), llvm::canSinkOrHoistInst(), cloneLoopBlocks(), collectCastsToIgnore(), llvm::collectChildrenInLoop(), llvm::CodeMetrics::collectEphemeralValues(), collectTransitivePredecessors(), computeBlocksDominatingExits(), llvm::DivergencePropagator::computeJoinPoints(), computeUnlikelySuccessors(), ConnectEpilog(), ConnectProlog(), llvm::LoopBase< BasicBlock, Loop >::contains(), ConvertToSInt(), llvm::VPRecipeBuilder::createBlockInMask(), llvm::deleteDeadLoop(), llvm::ICFLoopSafetyInfo::doesNotWriteMemoryBefore(), llvm::Loop::dumpVerbose(), expandBounds(), llvm::findDefsUsedOutsideOfLoop(), findPHIToPartitionLoops(), llvm::InnerLoopVectorizer::fixupIVUsers(), llvm::ScalarEvolution::forgetValue(), llvm::formDedicatedExitBlocks(), genLoopLimit(), llvm::ScalarEvolution::getAddRecExpr(), getInnermostLoopFor(), getLayoutSuccessorProbThreshold(), llvm::ScalarEvolution::getLoopDisposition(), llvm::LoopBase< BasicBlock, Loop >::getLoopLatches(), getMaxBackedgeTakenCount(), llvm::LoopBase< BasicBlock, Loop >::getNumBackEdges(), getSetupCost(), getSingleSchedPred(), llvm::AMDGPUTTIImpl::getUnrollingPreferences(), llvm::hasOutsideLoopUser(), hasUsesOutsideLoop(), hoistLoopToNewParent(), llvm::DivergenceAnalysis::inRegion(), llvm::InsertPreheaderForLoop(), inSubLoop(), IsAvailableOnEntry(), isBlockInLCSSAForm(), isCopyFeedingInvariantStore(), isExitingLoop(), llvm::RecurrenceDescriptor::isFirstOrderRecurrence(), llvm::InductionDescriptor::isFPInductionPHI(), isFreeInLoop(), llvm::PPCTTIImpl::isHardwareLoopProfitable(), IsIncrementNUW(), isInteresting(), llvm::LoopBase< BasicBlock, Loop >::isLoopExiting(), llvm::LoopBase< BasicBlock, Loop >::isLoopLatch(), isNotUsedOrFreeInLoop(), isProfitableForVectorization(), isSafeToExecuteUnconditionally(), llvm::isSafeToUnrollAndJam(), isSupportedGuardInstruction(), isTrivialLoopExitBlockHelper(), llvm::isUniformLoop(), IVUseShouldUsePostIncValue(), llvm::LPPassManager::markLoopAsDeleted(), llvm::LPMUpdater::markLoopAsDeleted(), mayUsePostIncMode(), llvm::LoopInfo::movementPreservesLCSSAForm(), llvm::InnerLoopVectorizer::needsScalarInduction(), needToInsertPhisForLCSSA(), llvm::LoopBodyTraits::LoopBodyFilter::operator()(), llvm::slpvectorizer::BoUpSLP::optimizeGatherSequence(), partitionOuterLoopBlocks(), llvm::peelLoop(), PickMostRelevantLoop(), placeSplitBlockCarefully(), pointerInvalidatedByLoopWithMSSA(), llvm::promoteLoopAccessesToScalars(), pushIVUsers(), PushLoopPHIs(), rebuildLoopAfterUnswitch(), recomputeLoopBlockSet(), removeBlockFromLoops(), replaceLoopInvariantUses(), llvm::LoopInfo::replacementPreservesLCSSAForm(), ReplaceUsesOfWith(), llvm::GuardWideningPass::run(), separateNestedLoop(), shouldRotateLoopExitingLatch(), simplifyLoopInst(), simplifyOneLoop(), sink(), sinkInstruction(), llvm::sinkRegion(), splitPredecessorsOfLoopExit(), truncateIVUse(), llvm::UnrollAndJamLoop(), llvm::UnrollLoop(), llvm::UnrollRuntimeLoopRemainder(), unswitchAllTrivialConditions(), unswitchNontrivialInvariants(), unswitchTrivialBranch(), unswitchTrivialSwitch(), UpdateAnalysisInformation(), llvm::LoopVersioning::versionLoop(), llvm::LoopBlocksTraversal::visitPreorder(), llvm::DivergencePropagator::visitSuccessor(), and willNotOverflow().
|
inline |
Return true if the specified basic block is in this loop.
Definition at line 125 of file LoopInfo.h.
|
inline |
Return true if the specified instruction is in this loop.
Definition at line 131 of file LoopInfo.h.
|
inline |
Definition at line 151 of file LoopInfo.h.
Referenced by analyzeLoopUnrollCost(), llvm::LoopVectorizationLegality::blockNeedsPredication(), cloneLoopNest(), collectSupportedLoops(), llvm::computePeelCount(), llvm::createFalkorMarkStridedAccessesPass(), eliminateLoadsAcrossLoops(), emitBasicBlockLoopComments(), llvm::LoopInfo::erase(), GetPointerOperand(), getTag(), llvm::HexagonTTIImpl::getUnrollingPreferences(), isExplicitVecOuterLoop(), isProfitableForVectorization(), mayUsePostIncMode(), llvm::LoopVectorizationPlanner::plan(), llvm::LoopVectorizationPlanner::planInVPlanNativePath(), llvm::MemoryDepChecker::Dependence::print(), llvm::LoopVectorizePass::processLoop(), llvm::LoopDataPrefetchPass::run(), runImpl(), and llvm::VPRecipeBuilder::tryToCreateRecipe().
|
inline |
Definition at line 148 of file LoopInfo.h.
Referenced by llvm::internal::appendLoopsToWorklist(), appendLoopsToWorklist(), llvm::PPCTTIImpl::canSaveCmp(), llvm::GraphTraits< const MachineLoop * >::child_end(), llvm::GraphTraits< MachineLoop * >::child_end(), llvm::GraphTraits< const Loop * >::child_end(), llvm::GraphTraits< Loop * >::child_end(), llvm::createCodeGenPreparePass(), deleteLoopIfDead(), llvm::LoopInfo::erase(), INITIALIZE_PASS(), LoopIsOuterMostWithPredecessor(), pointerInvalidatedByLoop(), llvm::promoteLoopAccessesToScalars(), llvm::LoopInfoBase< BasicBlock, Loop >::removeLoop(), llvm::LoopFullUnrollPass::run(), llvm::LoopSimplifyPass::run(), llvm::simplifyLoop(), and llvm::ScalarEvolution::verify().
|
inline |
Get a list of the basic blocks which make up this loop.
Definition at line 154 of file LoopInfo.h.
Referenced by llvm::LoopBase< BasicBlock, Loop >::block_begin(), llvm::LoopBase< BasicBlock, Loop >::block_end(), llvm::canSinkOrHoistInst(), llvm::cloneLoopWithPreheader(), llvm::SimpleLoopSafetyInfo::computeLoopSafetyInfo(), computeUnrollAndJamCount(), llvm::createLICMPass(), llvm::findDefsUsedOutsideOfLoop(), llvm::CacheCost::getCacheCost(), llvm::LoopBase< BasicBlock, Loop >::getHeader(), getLayoutSuccessorProbThreshold(), getRangeForAffineARHelper(), getTag(), llvm::AMDGPUTTIImpl::getUnrollingPreferences(), llvm::ARMTTIImpl::getUnrollingPreferences(), getVectorType(), InstructionStoresToFI(), llvm::ARMTTIImpl::isHardwareLoopProfitable(), isLoadInvariantInLoop(), IsMasked(), pointerInvalidatedByLoop(), pointerInvalidatedByLoopWithMSSA(), llvm::PredicatedScalarEvolution::print(), llvm::IRCEPass::run(), llvm::MachinePipeliner::runOnMachineFunction(), separateNestedLoop(), shouldRotateLoopExitingLatch(), llvm::simplifyLoopAfterUnroll(), truncateIVUse(), llvm::UnrollAndJamLoop(), and llvm::UnrollLoop().
|
inline |
Return a direct, mutable handle to the blocks set so that we can mutate it efficiently.
Definition at line 181 of file LoopInfo.h.
Referenced by rebuildLoopAfterUnswitch().
|
inline |
Return a direct, immutable handle to the blocks set.
Definition at line 187 of file LoopInfo.h.
|
inline |
Return a direct, mutable handle to the blocks vector so that we can mutate it efficiently with techniques like std::remove
.
Definition at line 175 of file LoopInfo.h.
Referenced by rebuildLoopAfterUnswitch().
BlockT * llvm::LoopBase< BlockT, LoopT >::getExitBlock | ( | ) | const |
If getExitBlocks would return exactly one block, return that block.
getExitBlock - If getExitBlocks would return exactly one block, return that block.
Otherwise return null.
Definition at line 75 of file LoopInfoImpl.h.
Referenced by containsSafePHI(), llvm::InnerLoopVectorizer::createVectorizedLoopSkeleton(), llvm::InnerLoopVectorizer::fixupIVUsers(), getInductionVariable(), llvm::LoopBase< BasicBlock, Loop >::getNumBackEdges(), llvm::SITargetLowering::getPrefLoopAlignment(), llvm::LoopVersioning::LoopVersioning(), moveLCSSAPhis(), and llvm::LoopVersioning::versionLoop().
void llvm::LoopBase< BlockT, LoopT >::getExitBlocks | ( | SmallVectorImpl< BlockT *> & | ExitBlocks | ) | const |
Return all of the successor blocks of this loop.
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 62 of file LoopInfoImpl.h.
Referenced by llvm::formLCSSAForInstructions(), getInnermostLoopFor(), llvm::LoopBase< BasicBlock, Loop >::getNumBackEdges(), hoistLoopToNewParent(), INITIALIZE_PASS(), llvm::isPotentiallyReachableFromMany(), llvm::SyncDependenceAnalysis::join_blocks(), LoopIsOuterMostWithPredecessor(), llvm::printLoop(), and llvm::UnrollLoop().
void llvm::LoopBase< BlockT, LoopT >::getExitEdges | ( | SmallVectorImpl< Edge > & | ExitEdges | ) | const |
Return all pairs of (inside_block,outside_block).
getExitEdges - Return all pairs of (inside_block,outside_block).
Definition at line 141 of file LoopInfoImpl.h.
Referenced by normalizePredicate(), and llvm::peelLoop().
BlockT * llvm::LoopBase< BlockT, LoopT >::getExitingBlock | ( | ) | const |
If getExitingBlocks would return exactly one block, return that block.
getExitingBlock - If getExitingBlocks would return exactly one block, return that block.
Otherwise return null.
Definition at line 49 of file LoopInfoImpl.h.
Referenced by llvm::LoopVectorizationLegality::blockNeedsPredication(), llvm::canPeel(), containsSafePHI(), llvm::ScalarEvolution::forgetValue(), getInductionVariable(), llvm::LoopBase< BasicBlock, Loop >::getNumBackEdges(), getRangeForAffineARHelper(), llvm::SCEVExpander::getRelatedExistingExpansion(), llvm::ScalarEvolution::getSmallConstantTripCount(), llvm::ScalarEvolution::getSmallConstantTripMultiple(), llvm::isSafeToUnrollAndJam(), llvm::MemoryDepChecker::Dependence::print(), tryToUnrollAndJamLoop(), tryToUnrollLoop(), llvm::UnrollAndJamLoop(), llvm::UnrollLoop(), llvm::UnrollRuntimeLoopRemainder(), and llvm::LoopVersioning::versionLoop().
void llvm::LoopBase< BlockT, LoopT >::getExitingBlocks | ( | SmallVectorImpl< BlockT *> & | ExitingBlocks | ) | const |
Return all blocks inside the loop that have successors outside of the loop.
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 34 of file LoopInfoImpl.h.
Referenced by canProfitablyUnrollMultiExitLoop(), deleteLoopIfDead(), llvm::ScalarEvolution::forgetValue(), getMaxBackedgeTakenCount(), llvm::LoopBase< BasicBlock, Loop >::getNumBackEdges(), llvm::SCEVExpander::getRelatedExistingExpansion(), llvm::ARMTTIImpl::getUnrollingPreferences(), InstructionStoresToFI(), llvm::PPCTTIImpl::isHardwareLoopProfitable(), mayUsePostIncMode(), llvm::LoopSimplifyPass::run(), and simplifyOneLoop().
|
inline |
Definition at line 105 of file LoopInfo.h.
Referenced by llvm::addClonedBlockToLoopInfo(), llvm::RecurrenceDescriptor::AddReductionVar(), llvm::LoopAccessInfo::addRuntimeChecks(), AddRuntimeUnrollDisableMetaData(), llvm::LoopSafetyInfo::allLoopPathsLeadToBlock(), llvm::LoopVectorizeHints::allowVectorization(), allPhiOperandsUndefined(), analyzeLoopUnrollCost(), llvm::LoopVersioning::annotateInstWithNoAlias(), llvm::PredicatedScalarEvolution::areAddRecsEqualWithPreds(), areLoopExitPHIsSupported(), llvm::LoopBlocksTraversal::begin(), llvm::LoopAccessInfo::blockNeedsPredication(), buildClonedLoops(), BuildConstantFromSCEV(), calculateIterationsToInvariance(), canConstantEvolve(), canFoldIVIncExpr(), CanGenerateTest(), Cleanup(), CloneLoopBlocks(), cloneLoopBlocks(), llvm::cloneLoopWithPreheader(), collectTransitivePredecessors(), llvm::LoopSafetyInfo::computeBlockColors(), computeBlocksDominatingExits(), llvm::DivergencePropagator::computeJoinPoints(), llvm::SimpleLoopSafetyInfo::computeLoopSafetyInfo(), llvm::computePeelCount(), computeUnlikelySuccessors(), llvm::computeUnrollCount(), containsSafePHI(), ConvertToSInt(), llvm::VPRecipeBuilder::createBlockInMask(), llvm::createHexagonHardwareLoops(), llvm::createLICMPass(), createLVAnalysis(), createStringMetadata(), llvm::InnerLoopVectorizer::createVectorizedLoopSkeleton(), deleteDeadInstruction(), llvm::deleteDeadLoop(), DisableAllLoopOptsOnLoop(), llvm::LoopVectorizationRequirements::doesNotMeet(), llvm::ICFLoopSafetyInfo::doesNotWriteMemoryBefore(), DoInitialMatch(), emitBasicBlockLoopComments(), llvm::InnerLoopVectorizer::emitMemRuntimeChecks(), llvm::LoopBlocksTraversal::end(), llvm::SystemZPostRASchedStrategy::enterMBB(), EqualityPropUnSafe(), EvaluateConstantChrecAtConstant(), llvm::SCEVExpander::expandCodeFor(), findInnerReductionPhi(), llvm::MachineLoopInfo::findLoopPreheader(), findPHIToPartitionLoops(), llvm::InnerLoopVectorizer::fixCrossIterationPHIs(), llvm::InnerLoopVectorizer::fixupIVUsers(), llvm::gatherUnrollingPreferences(), llvm::ScalarEvolution::getAddExpr(), llvm::ScalarEvolution::getAddRecExpr(), llvm::ScalarEvolution::getBlockDisposition(), getDebugLocString(), llvm::LoopBodyTraits::getEntryNode(), getInductionVariable(), getInnermostLoopFor(), getLayoutSuccessorProbThreshold(), llvm::ScalarEvolution::getLoopDisposition(), llvm::getLoopEstimatedTripCount(), llvm::LoopBase< BasicBlock, Loop >::getLoopLatches(), getLoopPhiForCounter(), getMaxBackedgeTakenCount(), llvm::Loop::getName(), llvm::LoopBase< BasicBlock, Loop >::getNumBackEdges(), llvm::InnerLoopVectorizer::getOrCreateTripCount(), llvm::SCEVExpander::getOrInsertCanonicalInductionVariable(), getOtherIncomingValue(), GetPointerOperand(), llvm::SITargetLowering::getPrefLoopAlignment(), llvm::getPtrStride(), getRangeForAffineARHelper(), llvm::SCEVExpander::getRelatedExistingExpansion(), getScalarEpilogueLowering(), getSingleSchedPred(), GetSortedValueDataFromCallTargets(), getUnderlyingObjects(), llvm::ARMTTIImpl::getUnrollingPreferences(), getVectorType(), hasUsesOutsideLoop(), INITIALIZE_PASS(), llvm::DivergenceAnalysis::inRegion(), llvm::InsertPreheaderForLoop(), insertUniqueBackedgeBlock(), InstructionStoresToFI(), llvm::ScalarEvolution::isAvailableAtLoopEntry(), llvm::VPBlockUtils::isBackEdge(), isCopyFeedingInvariantStore(), llvm::isDereferenceableAndAlignedInLoop(), isEpilogProfitable(), isExistingPhi(), isExitingLoop(), isExplicitVecOuterLoop(), llvm::RecurrenceDescriptor::isFirstOrderRecurrence(), llvm::InductionDescriptor::isFPInductionPHI(), llvm::SimpleLoopSafetyInfo::isGuaranteedToExecute(), llvm::isGuaranteedToExecuteForEveryIteration(), llvm::PPCTTIImpl::isHardwareLoopProfitable(), isIgnorableInst(), isImmValidForOpcode(), IsIncrementNUW(), isIntegerLoopHeaderPHI(), llvm::ScalarEvolution::isKnownViaInduction(), isLoadConditional(), isLoadInvariantInLoop(), llvm::ScalarEvolution::isLoopBackedgeGuardedByCond(), isLoopCounter(), llvm::ScalarEvolution::isLoopEntryGuardedByCond(), isLoopIncrement(), llvm::LoopBase< BasicBlock, Loop >::isLoopLatch(), IsMasked(), isNoWrap(), isProfitableChain(), isProfitableForVectorization(), llvm::RecurrenceDescriptor::isReductionPHI(), llvm::isSafeToUnrollAndJam(), isSimplifiedLoopNest(), isTrivialLoopExitBlock(), llvm::IVUsers::IVUsers(), llvm::SyncDependenceAnalysis::join_blocks(), LoopIsOuterMostWithPredecessor(), mayLoopAccessLocation(), mayUsePostIncMode(), mergeOperations(), moveLCSSAPhis(), normalizePredicate(), llvm::LoopBodyTraits::LoopBodyFilter::operator()(), llvm::peelLoop(), PickMostRelevantLoop(), llvm::LoopVectorizationPlanner::plan(), populateWorklist(), preheader(), llvm::LoopVersioning::prepareNoAliasMetadata(), llvm::IVUsers::print(), llvm::SCEV::print(), llvm::MemoryDepChecker::Dependence::print(), llvm::printLoop(), PrintParentLoopComment(), llvm::LoopVectorizePass::processLoop(), processLoopInVPlanNativePath(), profitImm(), PushDefUseChildren(), pushDepHeight(), PushLoopPHIs(), recomputeLoopBlockSet(), ReduceLoopStrength(), removeBlockFromLoops(), llvm::SCEVExpander::replaceCongruentIVs(), ReplaceUsesOfWith(), llvm::IRCEPass::run(), llvm::LoopAccessInfoPrinterPass::run(), llvm::LoopRotatePass::run(), llvm::IndVarSimplifyPass::run(), llvm::LoopDataPrefetchPass::run(), llvm::GuardWideningPass::run(), llvm::LoopIdiomRecognizePass::run(), llvm::LoopSimplifyPass::run(), llvm::SimpleLoopUnswitchPass::run(), llvm::LoopCachePrinterPass::run(), llvm::DDGAnalysis::run(), llvm::DDGAnalysisPrinterPass::run(), llvm::LPPassManager::runOnFunction(), llvm::IVUsersWrapperPass::runOnLoop(), llvm::MachinePipeliner::runOnMachineFunction(), separateNestedLoop(), llvm::LoopVectorizeHints::setAlreadyVectorized(), llvm::ARMTTIImpl::shouldFavorBackedgeIndex(), shouldRotateLoopExitingLatch(), llvm::ScalarEvolution::SimplifyICmpOperands(), llvm::simplifyLoopAfterUnroll(), simplifyLoopInst(), llvm::simplifyLoopIVs(), simplifyOneLoop(), llvm::sinkRegion(), llvm::LoopPass::skipLoop(), truncateIVUse(), llvm::VPRecipeBuilder::tryToBlend(), tryToUnrollAndJamLoop(), tryToUnrollLoop(), llvm::UnrollAndJamLoop(), llvm::UnrollLoop(), llvm::UnrollRuntimeLoopRemainder(), unswitchAllTrivialConditions(), unswitchBestCondition(), unswitchNontrivialInvariants(), unswitchTrivialBranch(), unswitchTrivialSwitch(), llvm::LoopVersioning::versionLoop(), visitIVCast(), warnAboutLeftoverTransformations(), llvm::InnerLoopVectorizer::widenIntOrFpInduction(), and llvm::InnerLoopVectorizer::widenPHIInstruction().
|
inlinestatic |
Return all inner loops in the loop nest rooted by the loop in preorder, with siblings in forward program order.
Definition at line 325 of file LoopInfo.h.
Referenced by llvm::LoopBase< BasicBlock, Loop >::getLoopsInPreorder().
|
inline |
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 97 of file LoopInfo.h.
Referenced by buildClonedLoops(), checkDependencies(), emitBasicBlockLoopComments(), llvm::ScalarEvolution::getAddRecExpr(), getInnerMostLoop(), getInnermostLoopFor(), llvm::PPCTargetLowering::getPrefLoopAlignment(), llvm::AMDGPUTTIImpl::getUnrollingPreferences(), llvm::AArch64TTIImpl::getUnrollingPreferences(), llvm::IndexedReference::hasTemporalReuse(), isLoadOrStore(), mayUsePostIncMode(), PrintParentLoopComment(), and UpdateAnalysisInformation().
BlockT * llvm::LoopBase< BlockT, LoopT >::getLoopLatch | ( | ) | const |
If there is a single latch block for this loop, return it.
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.
Definition at line 209 of file LoopInfoImpl.h.
Referenced by analyzeLoopUnrollCost(), areLoopExitPHIsSupported(), llvm::LoopVectorizationLegality::blockNeedsPredication(), llvm::LoopAccessInfo::blockNeedsPredication(), calculateIterationsToInvariance(), calculateUnswitchCostMultiplier(), llvm::canPeel(), Cleanup(), CloneLoopBlocks(), cloneLoopBlocks(), llvm::LoopVectorizationPlanner::collectTriviallyDeadInstructions(), llvm::computePeelCount(), ConnectEpilog(), ConnectProlog(), constantFoldTerminators(), containsSafePHI(), ConvertToSInt(), countToEliminateCompares(), llvm::createHexagonHardwareLoops(), llvm::InnerLoopVectorizer::createVectorizedLoopSkeleton(), EvaluateConstantChrecAtConstant(), findInnerReductionPhi(), llvm::MachineLoopInfo::findLoopPreheader(), llvm::InnerLoopVectorizer::fixFirstOrderRecurrence(), llvm::InnerLoopVectorizer::fixReduction(), llvm::InnerLoopVectorizer::fixupIVUsers(), llvm::ScalarEvolution::forgetValue(), genLoopLimit(), getInductionVariable(), getInnermostLoopFor(), getLatchCmpInst(), llvm::getLoopEstimatedTripCount(), getMaxBackedgeTakenCount(), getOtherIncomingValue(), GetPointerOperand(), getRangeForAffineARHelper(), getReductionValue(), llvm::hasIterationCountInvariantInParent(), llvm::RecurrenceDescriptor::isFirstOrderRecurrence(), isImmValidForOpcode(), IsIncrementNUW(), llvm::InductionDescriptor::isInductionPHI(), isLoadConditional(), llvm::ScalarEvolution::isLoopBackedgeGuardedByCond(), isLoopCounter(), IsMasked(), isProfitableChain(), isProfitableForVectorization(), llvm::isSafeToUnrollAndJam(), llvm::isUniformLoop(), IVUseShouldUsePostIncValue(), mayUsePostIncMode(), moveLCSSAPhis(), needsLFTR(), normalizePredicate(), partitionOuterLoopBlocks(), llvm::peelLoop(), llvm::MemoryDepChecker::Dependence::print(), profitImm(), PushDefUseChildren(), llvm::SCEVExpander::replaceCongruentIVs(), ReplaceUsesOfWith(), llvm::LoopSimplifyPass::run(), shouldRotateLoopExitingLatch(), truncateIVUse(), llvm::VPRecipeBuilder::tryToCreateRecipe(), tryToUnrollAndJamLoop(), tryToUnrollLoop(), llvm::UnrollAndJamLoop(), llvm::UnrollLoop(), llvm::UnrollRuntimeLoopRemainder(), and llvm::InnerLoopVectorizer::updateAnalysis().
|
inline |
Return all loop latch blocks of this loop.
A latch block is a block that contains a branch back to the header.
Definition at line 314 of file LoopInfo.h.
Referenced by doesStoreDominatesAllLatches().
BlockT * llvm::LoopBase< BlockT, LoopT >::getLoopPredecessor | ( | ) | const |
If the given loop's header has exactly one unique predecessor outside the loop, return it.
getLoopPredecessor - If the given loop's header has exactly one unique predecessor outside the loop, return it.
Otherwise return null. This is less strict that the loop "preheader" concept, which requires the predecessor to have exactly one successor.
Definition at line 188 of file LoopInfoImpl.h.
Referenced by EvaluateConstantChrecAtConstant(), findInnerReductionPhi(), getInductionVariable(), GetPointerOperand(), isCopyFeedingInvariantStore(), llvm::ScalarEvolution::isLoopEntryGuardedByCond(), and llvm::GuardWideningPass::run().
BlockT * llvm::LoopBase< BlockT, LoopT >::getLoopPreheader | ( | ) | const |
If there is a preheader for this loop, return it.
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.
A loop has a preheader if there is only one edge to the header of the loop from outside of the loop and it is legal to hoist instructions into the predecessor. 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 160 of file LoopInfoImpl.h.
Referenced by llvm::RecurrenceDescriptor::AddReductionVar(), analyzeLoopUnrollCost(), llvm::LoopVectorizationLegality::blockNeedsPredication(), buildClonedLoops(), CanGenerateTest(), Cleanup(), cloneLoopBlocks(), llvm::cloneLoopWithPreheader(), containsSafePHI(), llvm::createCodeGenPreparePass(), llvm::createLICMPass(), llvm::InnerLoopVectorizer::createVectorizedLoopSkeleton(), deleteDeadInstruction(), llvm::deleteDeadLoop(), deleteLoopIfDead(), detectPopcountIdiom(), detectShiftUntilZeroIdiom(), llvm::InnerLoopVectorizer::emitMemRuntimeChecks(), llvm::InnerLoopVectorizer::emitMinimumIterationCountCheck(), llvm::InnerLoopVectorizer::emitSCEVChecks(), llvm::SCEVExpander::expandCodeFor(), findBBsToSinkInto(), llvm::MachineLoopInfo::findLoopPreheader(), llvm::InnerLoopVectorizer::fixFirstOrderRecurrence(), getInductionVariable(), getInnermostLoopFor(), GetLoopInvariantInsertPosition(), getMaxBackedgeTakenCount(), llvm::InnerLoopVectorizer::getOrCreateTripCount(), llvm::InnerLoopVectorizer::getOrCreateVectorTripCount(), llvm::SITargetLowering::getPrefLoopAlignment(), getVectorType(), llvm::SCEVExpander::hoistIVInc(), llvm::hoistRegion(), isCopyFeedingInvariantStore(), isEpilogProfitable(), llvm::RecurrenceDescriptor::isFirstOrderRecurrence(), IsIncrementNUW(), llvm::InductionDescriptor::isInductionPHI(), isLoadConditional(), isLoopNeverExecuted(), IsMasked(), isProfitableForVectorization(), mayLoopAccessLocation(), mayUsePostIncMode(), moveLCSSAPhis(), normalizePredicate(), llvm::slpvectorizer::BoUpSLP::optimizeGatherSequence(), partitionOuterLoopBlocks(), llvm::peelLoop(), preheader(), llvm::printLoop(), llvm::promoteLoopAccessesToScalars(), rebuildLoopAfterUnswitch(), recomputeLoopBlockSet(), llvm::IRCEPass::run(), llvm::LoopSimplifyPass::run(), llvm::MachinePipeliner::runOnMachineFunction(), shouldRotateLoopExitingLatch(), sinkLoopInvariantInstructions(), llvm::sinkRegion(), llvm::UnrollAndJamLoop(), llvm::UnrollLoop(), llvm::UnrollRuntimeLoopRemainder(), unswitchNontrivialInvariants(), unswitchTrivialBranch(), unswitchTrivialSwitch(), llvm::LoopVersioning::versionLoop(), and visitIVCast().
|
inline |
Return all loops in the loop nest rooted by the loop in preorder, with siblings in forward program order.
Definition at line 341 of file LoopInfo.h.
Referenced by llvm::cloneLoopWithPreheader(), and llvm::LoopInfoBase< BasicBlock, Loop >::empty().
|
inline |
Definition at line 348 of file LoopInfo.h.
|
inline |
Calculate the number of back edges to the loop header.
Definition at line 233 of file LoopInfo.h.
Referenced by llvm::LoopVectorizationLegality::blockNeedsPredication(), getInductionVariable(), insertUniqueBackedgeBlock(), and llvm::MemoryDepChecker::Dependence::print().
|
inline |
Get the number of blocks in this loop in constant time.
Invalidate the loop, indicating that it is no longer a loop.
Definition at line 168 of file LoopInfo.h.
Referenced by llvm::LoopBlocksTraversal::begin(), buildClonedLoopBlocks(), cloneLoopNest(), getInnermostLoopFor(), getLayoutSuccessorProbThreshold(), llvm::ARMTTIImpl::getUnrollingPreferences(), llvm::LoopBlocksDFS::isComplete(), llvm::LoopBlocksDFS::LoopBlocksDFS(), llvm::MachinePipeliner::runOnMachineFunction(), and llvm::ARMTTIImpl::shouldFavorBackedgeIndex().
|
inline |
Definition at line 106 of file LoopInfo.h.
Referenced by llvm::addClonedBlockToLoopInfo(), llvm::LPPassManager::addLoop(), llvm::DivergenceAnalysis::addUniformOverride(), buildClonedLoops(), BuildConstantFromSCEV(), calculateUnswitchCostMultiplier(), canSafelyUnrollMultiExitLoop(), CloneLoopBlocks(), cloneLoopBlocks(), llvm::cloneLoopWithPreheader(), llvm::IndexedReference::computeRefCost(), ConvertToSInt(), createFFSIntrinsic(), llvm::createLICMPass(), llvm::InnerLoopVectorizer::createVectorizedLoopSkeleton(), deleteDeadBlocksFromLoop(), llvm::Loop::dumpVerbose(), emitBasicBlockLoopComments(), llvm::InnerLoopVectorizer::emitMemRuntimeChecks(), llvm::InnerLoopVectorizer::emitMinimumIterationCountCheck(), llvm::InnerLoopVectorizer::emitSCEVChecks(), llvm::LoopInfo::erase(), llvm::SCEVExpander::expandCodeFor(), llvm::ScalarEvolution::forgetTopmostLoop(), llvm::CacheCost::getCacheCost(), getInductionVariable(), getInnerMostLoop(), getInnermostLoopFor(), getOutermostLoop(), llvm::SITargetLowering::getPrefLoopAlignment(), llvm::hasIterationCountInvariantInParent(), hoistLoopToNewParent(), INITIALIZE_PASS(), llvm::DivergenceAnalysis::inRegion(), isLoadOrStore(), isMustExecuteIn(), isProfitableForVectorization(), llvm::SyncDependenceAnalysis::join_blocks(), LoopIsOuterMostWithPredecessor(), mayLoopAccessLocation(), llvm::peelLoop(), llvm::ScalarEvolution::print(), PrintParentLoopComment(), rebuildLoopAfterUnswitch(), removeBlockFromLoops(), llvm::LoopUnrollPass::run(), llvm::FunctionToLoopPassAdaptor< LoopPassT >::run(), separateNestedLoop(), llvm::sinkRegion(), SolveQuadraticAddRecRange(), llvm::UnrollAndJamLoop(), llvm::UnrollLoop(), unswitchNontrivialInvariants(), UpdateAnalysisInformation(), and visitIVCast().
|
inline |
Return the loops contained entirely within this loop.
Definition at line 136 of file LoopInfo.h.
Referenced by llvm::LoopBase< BasicBlock, Loop >::begin(), llvm::LoopBase< BasicBlock, Loop >::empty(), llvm::LoopBase< BasicBlock, Loop >::end(), llvm::formLCSSARecursively(), llvm::PPCTargetLowering::getPrefLoopAlignment(), llvm::AMDGPUTTIImpl::getUnrollingPreferences(), isProfitableForVectorization(), llvm::isSafeToUnrollAndJam(), populateWorklist(), llvm::promoteLoopAccessesToScalars(), llvm::LoopBase< BasicBlock, Loop >::rbegin(), llvm::LoopBase< BasicBlock, Loop >::rend(), separateNestedLoop(), tryToUnrollAndJamLoop(), and llvm::UnrollAndJamLoop().
|
inline |
Definition at line 140 of file LoopInfo.h.
Referenced by deleteDeadBlocksFromLoop(), and rebuildLoopAfterUnswitch().
BlockT * llvm::LoopBase< BlockT, LoopT >::getUniqueExitBlock | ( | ) | const |
If getUniqueExitBlocks would return exactly one block, return that block.
Otherwise return null.
Definition at line 131 of file LoopInfoImpl.h.
Referenced by areLoopExitPHIsSupported(), llvm::canPeel(), Cleanup(), llvm::deleteDeadLoop(), deleteLoopIfDead(), and llvm::LoopBase< BasicBlock, Loop >::getNumBackEdges().
void llvm::LoopBase< BlockT, LoopT >::getUniqueExitBlocks | ( | SmallVectorImpl< BlockT *> & | ExitBlocks | ) | const |
Return all unique successor blocks of this loop.
These are the blocks outside of the current loop which are branched to.
Definition at line 115 of file LoopInfoImpl.h.
Referenced by ConvertToSInt(), llvm::createLICMPass(), llvm::LoopBase< BasicBlock, Loop >::getNumBackEdges(), mayLoopAccessLocation(), sink(), and splitPredecessorsOfLoopExit().
void llvm::LoopBase< BlockT, LoopT >::getUniqueNonLatchExitBlocks | ( | SmallVectorImpl< BlockT *> & | ExitBlocks | ) | const |
Return all unique successor blocks of this loop except successors from Latch block are not considered.
If the exit comes from Latch has also non Latch predecessor in a loop it will be added to ExitBlocks. These are the blocks outside of the current loop which are branched to.
Definition at line 122 of file LoopInfoImpl.h.
Referenced by llvm::canPeel(), llvm::getLoopEstimatedTripCount(), llvm::LoopBase< BasicBlock, Loop >::getNumBackEdges(), and llvm::UnrollRuntimeLoopRemainder().
bool llvm::LoopBase< BlockT, LoopT >::hasDedicatedExits | ( | ) | const |
Return true if no exit block for the loop has a predecessor that is outside the loop.
Definition at line 85 of file LoopInfoImpl.h.
Referenced by llvm::createLICMPass(), llvm::deleteDeadLoop(), deleteLoopIfDead(), EqualityPropUnSafe(), llvm::LoopBase< BasicBlock, Loop >::getNumBackEdges(), llvm::peelLoop(), llvm::LoopSimplifyPass::run(), and shouldRotateLoopExitingLatch().
|
inline |
Returns true if the loop is annotated parallel.
Derived classes can override this method using static template polymorphism.
Definition at line 459 of file LoopInfo.h.
Referenced by llvm::Loop::isGuarded().
|
inline |
Return true if this loop is no longer valid.
The only valid use of this helper is "assert(L.isInvalid())" or equivalent, since IsInvalid is set to true by the destructor. In other words, if this accessor returns true, the caller has already triggered UB by calling this accessor; and so it can only be called in a context where a return value of true indicates a programmer error.
Definition at line 198 of file LoopInfo.h.
Referenced by llvm::LoopBase< BasicBlock, Loop >::addBlockEntry(), llvm::LoopBase< BasicBlock, Loop >::addChildLoop(), llvm::LoopBase< BasicBlock, Loop >::blocks(), llvm::LoopBase< BasicBlock, Loop >::contains(), llvm::LoopInfo::erase(), llvm::LoopBase< BasicBlock, Loop >::getBlocks(), llvm::LoopBase< BasicBlock, Loop >::getBlocksSet(), llvm::LoopBase< BasicBlock, Loop >::getBlocksVector(), llvm::LoopBase< BasicBlock, Loop >::getLoopDepth(), llvm::LoopBase< BasicBlock, Loop >::getLoopLatches(), llvm::LoopBase< BasicBlock, Loop >::getNumBackEdges(), llvm::LoopBase< BasicBlock, Loop >::getNumBlocks(), llvm::LoopBase< BasicBlock, Loop >::getSubLoops(), llvm::LoopBase< BasicBlock, Loop >::getSubLoopsVector(), llvm::LoopBase< BasicBlock, Loop >::isLoopExiting(), llvm::LoopBase< BasicBlock, Loop >::isLoopLatch(), llvm::LoopBase< BasicBlock, Loop >::moveToHeader(), llvm::LoopBase< BasicBlock, Loop >::removeBlockFromLoop(), llvm::LoopBase< BasicBlock, Loop >::removeChildLoop(), llvm::LoopBase< BasicBlock, Loop >::reserveBlocks(), llvm::LoopBase< BasicBlock, Loop >::reverseBlock(), and llvm::LoopBase< BasicBlock, Loop >::setParentLoop().
|
inline |
True if terminator in the block can branch to another block that is outside of the current loop.
BB
must be inside the loop.
Definition at line 208 of file LoopInfo.h.
Referenced by llvm::canPeel(), llvm::getLoopEstimatedTripCount(), llvm::ScalarEvolution::getSmallConstantTripCount(), llvm::ScalarEvolution::getSmallConstantTripMultiple(), llvm::AMDGPUTTIImpl::getUnrollingPreferences(), mustBeFiniteCountedLoop(), shouldRotateLoopExitingLatch(), tryToUnrollLoop(), llvm::UnrollLoop(), and llvm::VirtRegAuxInfo::weightCalcHelper().
|
inline |
Definition at line 222 of file LoopInfo.h.
Referenced by llvm::VPBlockUtils::isBackEdge().
|
inline |
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 423 of file LoopInfo.h.
Referenced by llvm::cloneLoopWithPreheader(), separateNestedLoop(), shouldRotateLoopExitingLatch(), and UpdateAnalysisInformation().
void llvm::LoopBase< BlockT, LoopT >::print | ( | raw_ostream & | OS, |
unsigned | Depth = 0 , |
||
bool | Verbose = false |
||
) | const |
Print loop with all the BBs inside it.
Definition at line 377 of file LoopInfoImpl.h.
Referenced by llvm::LoopBase< BasicBlock, Loop >::isAnnotatedParallel(), llvm::LoopInfoBase< BasicBlock, Loop >::isNotAlreadyContainedIn(), llvm::operator<<(), llvm::LoopInfoWrapperPass::releaseMemory(), and llvm::IRCEPass::run().
|
inline |
Definition at line 149 of file LoopInfo.h.
|
inline |
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 440 of file LoopInfo.h.
Referenced by isProfitableForVectorization(), and separateNestedLoop().
|
inline |
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 384 of file LoopInfo.h.
Referenced by llvm::Loop::dumpVerbose(), llvm::LoopInfo::erase(), hoistLoopToNewParent(), isProfitableForVectorization(), rebuildLoopAfterUnswitch(), llvm::LoopBase< BasicBlock, Loop >::removeChildLoop(), and separateNestedLoop().
|
inline |
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 396 of file LoopInfo.h.
|
inline |
Definition at line 150 of file LoopInfo.h.
void llvm::LoopBase< BlockT, LoopT >::replaceChildLoopWith | ( | LoopT * | OldChild, |
LoopT * | NewChild | ||
) |
This is used when splitting loops up.
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 265 of file LoopInfoImpl.h.
Referenced by llvm::LoopBase< BasicBlock, Loop >::getLoopsInPreorder(), and separateNestedLoop().
|
inline |
interface to do reserve() for Blocks
Definition at line 416 of file LoopInfo.h.
Referenced by buildClonedLoops().
|
inline |
interface to reverse Blocks[from, end of loop] in this loop
Definition at line 410 of file LoopInfo.h.
|
inline |
This is a raw interface for bypassing addChildLoop.
Definition at line 109 of file LoopInfo.h.
void llvm::LoopBase< BlockT, LoopT >::verifyLoop | ( | ) | const |
Verify loop structure.
verifyLoop - Verify loop structure
Definition at line 279 of file LoopInfoImpl.h.
Referenced by llvm::LoopBase< BasicBlock, Loop >::removeBlockFromLoop(), llvm::LoopFullUnrollPass::run(), llvm::LoopUnrollPass::run(), llvm::FunctionToLoopPassAdaptor< LoopPassT >::run(), and llvm::LPPassManager::runOnFunction().
void llvm::LoopBase< BlockT, LoopT >::verifyLoopNest | ( | DenseSet< const LoopT *> * | Loops | ) | const |
Verify loop structure of this loop and all nested loops.
verifyLoop - Verify loop structure of this loop and all nested loops.
Definition at line 365 of file LoopInfoImpl.h.
Referenced by llvm::LoopBase< BasicBlock, Loop >::removeBlockFromLoop().
|
friend |
Definition at line 465 of file LoopInfo.h.