|
LLVM 24.0.0git
|
#include "llvm/Analysis/LoopInfo.h"
Public Member Functions | |
| LoopInfo ()=default | |
| LLVM_ABI | LoopInfo (const DominatorTreeBase< BasicBlock, false > &DomTree) |
| LoopInfo (LoopInfo &&Arg) | |
| LoopInfo & | operator= (LoopInfo &&RHS) |
| LLVM_ABI bool | invalidate (Function &F, const PreservedAnalyses &PA, FunctionAnalysisManager::Invalidator &) |
| Handle invalidation explicitly. | |
| LLVM_ABI void | erase (Loop *L) |
| Update LoopInfo after removing the last backedge from a loop. | |
| bool | replacementPreservesLCSSAForm (Instruction *From, Value *To) |
| Returns true if replacing From with To everywhere is guaranteed to preserve LCSSA form. | |
| bool | movementPreservesLCSSAForm (Instruction *Inst, Instruction *NewLoc) |
| Checks if moving a specific instruction can break LCSSA in any loop. | |
| LLVM_ABI bool | wouldBeOutOfLoopUseRequiringLCSSA (const Value *V, const BasicBlock *ExitBB) const |
| Public Member Functions inherited from llvm::LoopInfoBase< BasicBlock, Loop > | |
| LoopInfoBase ()=default | |
| ~LoopInfoBase () | |
| LoopInfoBase (LoopInfoBase &&Arg) | |
| LoopInfoBase & | operator= (LoopInfoBase &&RHS) |
| void | releaseMemory () |
| Loop * | AllocateLoop (ArgsTy &&...Args) |
| iterator | begin () const |
| iterator | end () const |
| reverse_iterator | rbegin () const |
| reverse_iterator | rend () const |
| bool | empty () const |
| SmallVector< Loop *, 4 > | getLoopsInPreorder () const |
| Return all of the loops in the function in preorder across the loop nests, with siblings in forward program order. | |
| SmallVector< Loop *, 4 > | getLoopsInReverseSiblingPreorder () const |
| Return all of the loops in the function in preorder across the loop nests, with siblings in reverse program order. | |
| Loop * | getLoopFor (const BasicBlock *BB) const |
| Return the inner most loop that BB lives in. | |
| const Loop * | operator[] (const BasicBlock *BB) const |
| Same as getLoopFor. | |
| unsigned | getLoopDepth (const BasicBlock *BB) const |
| Return the loop nesting level of the specified block. | |
| bool | hasNoExitBlocks (const Loop &L) const |
Return true if L does not have any exit blocks. | |
| void | getExitEdges (const Loop &L, SmallVectorImpl< Edge > &ExitEdges) const |
| Return all pairs of (inside_block,outside_block). | |
| BasicBlock * | getUniqueLatchExitBlock (const Loop &L) const |
Return the unique exit block for the latch of L, or null if there are multiple different exit blocks or the latch is not exiting. | |
| void | removeBlocksIf (Loop &L, PredicateT Pred) |
Remove every block satisfying Pred from L's block list, preserving the order of the remaining blocks. | |
| void | removeBlocksFromLoopAndAncestors (Loop *Start, Loop *Stop, PredicateT Pred) |
Remove every block satisfying Pred from Start and each of its ancestors up to but not including Stop, which must be null or an ancestor of Start; a null Stop walks to the top level. | |
| SmallVector< Loop *, 4 > | takeChildrenIf (Loop *Parent, PredicateT Pred) |
Detach and return the children of Parent (the top-level loops if Parent is null) that satisfy Pred, clearing their parent pointers. | |
| Loop * | getSmallestCommonLoop (Loop *A, Loop *B) const |
| Find the innermost loop containing both given loops. | |
| Loop * | getSmallestCommonLoop (BasicBlock *A, BasicBlock *B) const |
| Find the innermost loop containing both given blocks. | |
| bool | isLoopHeader (const BasicBlock *BB) const |
| const std::vector< Loop * > & | getTopLevelLoops () const |
| Return the top-level loops. | |
| Loop * | removeLoop (iterator I) |
| This removes the specified top-level loop from this loop info object. | |
| void | changeLoopFor (const BasicBlock *BB, Loop *L) |
| Change the top-level loop that contains BB to the specified loop. | |
| void | changeTopLevelLoop (Loop *OldLoop, Loop *NewLoop) |
| Replace the specified loop in the top-level loops list with the indicated loop. | |
| void | addTopLevelLoop (Loop *New) |
| This adds the specified loop to the collection of top-level loops. | |
| void | removeBlock (BasicBlock *BB) |
| This method completely removes BB from all data structures, including all of the Loop objects it is nested in and our mapping from BasicBlocks to loops. | |
| void | analyze (const DominatorTreeBase< BasicBlock, false > &DomTree) |
| Create the loop forest using a stable algorithm. | |
| void | print (raw_ostream &OS) const |
| void | verify (const DominatorTreeBase< BasicBlock, false > &DomTree) const |
| void | destroy (Loop *L) |
| Destroy a loop that has been removed from the LoopInfo nest. | |
Friends | |
| class | LoopBase< BasicBlock, Loop > |
Additional Inherited Members | |
| Public Types inherited from llvm::LoopInfoBase< BasicBlock, Loop > | |
| using | iterator |
| iterator/begin/end - The interface to the top-level loops in the current function. | |
| using | reverse_iterator |
| using | Edge |
| Edge type. | |
| Static Public Member Functions inherited from llvm::LoopInfoBase< BasicBlock, Loop > | |
| static bool | isNotAlreadyContainedIn (const Loop *SubLoop, const Loop *ParentLoop) |
Definition at line 427 of file LoopInfo.h.
|
default |
|
explicit |
References LLVM_ABI.
|
inline |
Definition at line 440 of file LoopInfo.h.
References llvm::move().
| void LoopInfo::erase | ( | Loop * | L | ) |
Update LoopInfo after removing the last backedge from a loop.
This updates the loop forest and parent loops for each block so that L is no longer referenced, but does not actually delete L immediately. The pointer will remain valid until this LoopInfo's memory is released.
Definition at line 924 of file LoopInfo.cpp.
References llvm::LoopInfoBase< BasicBlock, Loop >::addTopLevelLoop(), assert(), llvm::LoopBase< BlockT, LoopT >::begin(), llvm::LoopBase< BasicBlock, Loop >::begin(), llvm::LoopBase< BlockT, LoopT >::blocks(), llvm::LoopInfoBase< BasicBlock, Loop >::changeLoopFor(), llvm::LoopInfoBase< BasicBlock, Loop >::destroy(), llvm::LoopBase< BlockT, LoopT >::end(), llvm::LoopBase< BasicBlock, Loop >::end(), llvm::LoopInfoBase< BasicBlock, Loop >::getLoopFor(), llvm::LoopBase< BlockT, LoopT >::getParentLoop(), I, llvm::LoopBase< BlockT, LoopT >::isInnermost(), llvm::LoopBase< BlockT, LoopT >::isInvalid(), llvm::LoopBase< BlockT, LoopT >::isOutermost(), llvm::LoopBase< BlockT, LoopT >::removeChildLoop(), and llvm::LoopInfoBase< BasicBlock, Loop >::removeLoop().
Referenced by llvm::breakLoopBackedge(), DoFlattenLoopPair(), llvm::UnrollAndJamLoop(), llvm::UnrollLoop(), and UpdateAnalysisInformation().
| bool LoopInfo::invalidate | ( | Function & | F, |
| const PreservedAnalyses & | PA, | ||
| FunctionAnalysisManager::Invalidator & | ) |
Handle invalidation explicitly.
Definition at line 915 of file LoopInfo.cpp.
References F, and llvm::PreservedAnalyses::getChecker().
|
inline |
Checks if moving a specific instruction can break LCSSA in any loop.
Return true if moving Inst to before NewLoc will break LCSSA, assuming that the function containing Inst and NewLoc is currently in LCSSA form.
Definition at line 486 of file LoopInfo.h.
References assert(), llvm::cast(), Contains(), llvm::dyn_cast(), llvm::Instruction::getFunction(), llvm::LoopInfoBase< BasicBlock, Loop >::getLoopFor(), llvm::ilist_detail::node_parent_access< NodeTy, ParentTy >::getParent(), llvm::isa(), llvm::User::operands(), and llvm::Value::uses().
Definition at line 441 of file LoopInfo.h.
References RHS.
|
inline |
Returns true if replacing From with To everywhere is guaranteed to preserve LCSSA form.
Definition at line 460 of file LoopInfo.h.
References llvm::LoopBase< BlockT, LoopT >::contains(), llvm::dyn_cast(), llvm::LoopInfoBase< BasicBlock, Loop >::getLoopFor(), llvm::ilist_detail::node_parent_access< NodeTy, ParentTy >::getParent(), and I.
Referenced by loadCSE(), replaceLoopPHINodesWithPreheaderValues(), llvm::rewriteLoopExitValues(), llvm::simplifyLoopAfterUnroll(), simplifyLoopInst(), simplifyOneLoop(), and llvm::UnrollRuntimeLoopRemainder().
| bool LoopInfo::wouldBeOutOfLoopUseRequiringLCSSA | ( | const Value * | V, |
| const BasicBlock * | ExitBB ) const |
Definition at line 980 of file LoopInfo.cpp.
References llvm::dyn_cast(), llvm::LoopInfoBase< BasicBlock, Loop >::getLoopFor(), and I.
Referenced by cloneInstructionInExitBlock().
|
friend |
Definition at line 428 of file LoopInfo.h.