LLVM  14.0.0git
Public Member Functions | Friends | List of all members
llvm::LoopInfo Class Reference

#include "llvm/Analysis/LoopInfo.h"

Inheritance diagram for llvm::LoopInfo:
Inheritance graph
[legend]
Collaboration diagram for llvm::LoopInfo:
Collaboration graph
[legend]

Public Member Functions

 LoopInfo ()
 
 LoopInfo (const DominatorTreeBase< BasicBlock, false > &DomTree)
 
 LoopInfo (LoopInfo &&Arg)
 
LoopInfooperator= (LoopInfo &&RHS)
 
bool invalidate (Function &F, const PreservedAnalyses &PA, FunctionAnalysisManager::Invalidator &)
 Handle invalidation explicitly. More...
 
void erase (Loop *L)
 Update LoopInfo after removing the last backedge from a loop. More...
 
bool replacementPreservesLCSSAForm (Instruction *From, Value *To)
 Returns true if replacing From with To everywhere is guaranteed to preserve LCSSA form. More...
 
bool movementPreservesLCSSAForm (Instruction *Inst, Instruction *NewLoc)
 Checks if moving a specific instruction can break LCSSA in any loop. More...
 
bool wouldBeOutOfLoopUseRequiringLCSSA (const Value *V, const BasicBlock *ExitBB) const
 
- Public Member Functions inherited from llvm::LoopInfoBase< BasicBlock, Loop >
LoopInfoBaseoperator= (LoopInfoBase &&RHS)
 
 LoopInfoBase ()
 
 LoopInfoBase (LoopInfoBase &&Arg)
 
 ~LoopInfoBase ()
 
void releaseMemory ()
 
LoopAllocateLoop (ArgsTy &&... Args)
 
iterator begin () const
 
iterator end () const
 
reverse_iterator rbegin () const
 
reverse_iterator rend () const
 
bool empty () const
 
SmallVector< Loop *, 4 > getLoopsInPreorder ()
 Return all of the loops in the function in preorder across the loop nests, with siblings in forward program order. More...
 
SmallVector< Loop *, 4 > getLoopsInReverseSiblingPreorder ()
 Return all of the loops in the function in preorder across the loop nests, with siblings in reverse program order. More...
 
LoopgetLoopFor (const BasicBlock *BB) const
 Return the inner most loop that BB lives in. More...
 
const Loopoperator[] (const BasicBlock *BB) const
 Same as getLoopFor. More...
 
unsigned getLoopDepth (const BasicBlock *BB) const
 Return the loop nesting level of the specified block. More...
 
bool isLoopHeader (const BasicBlock *BB) const
 
const std::vector< Loop * > & getTopLevelLoops () const
 Return the top-level loops. More...
 
std::vector< Loop * > & getTopLevelLoopsVector ()
 Return the top-level loops. More...
 
LoopremoveLoop (iterator I)
 This removes the specified top-level loop from this loop info object. More...
 
void changeLoopFor (BasicBlock *BB, Loop *L)
 Change the top-level loop that contains BB to the specified loop. More...
 
void changeTopLevelLoop (Loop *OldLoop, Loop *NewLoop)
 Replace the specified loop in the top-level loops list with the indicated loop. More...
 
void addTopLevelLoop (Loop *New)
 This adds the specified loop to the collection of top-level loops. More...
 
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. More...
 
void analyze (const DominatorTreeBase< BasicBlock, false > &DomTree)
 Create the loop forest using a stable algorithm. More...
 
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. More...
 

Friends

class LoopBase< BasicBlock, Loop >
 

Additional Inherited Members

- Public Types inherited from llvm::LoopInfoBase< BasicBlock, Loop >
typedef std::vector< Loop * >::const_iterator iterator
 iterator/begin/end - The interface to the top-level loops in the current function. More...
 
typedef std::vector< Loop * >::const_reverse_iterator reverse_iterator
 
- Static Public Member Functions inherited from llvm::LoopInfoBase< BasicBlock, Loop >
static bool isNotAlreadyContainedIn (const Loop *SubLoop, const Loop *ParentLoop)
 

Detailed Description

Definition at line 1083 of file LoopInfo.h.

Constructor & Destructor Documentation

◆ LoopInfo() [1/3]

llvm::LoopInfo::LoopInfo ( )
inline

Definition at line 1092 of file LoopInfo.h.

◆ LoopInfo() [2/3]

llvm::LoopInfo::LoopInfo ( const DominatorTreeBase< BasicBlock, false > &  DomTree)
explicit

◆ LoopInfo() [3/3]

llvm::LoopInfo::LoopInfo ( LoopInfo &&  Arg)
inline

Definition at line 1095 of file LoopInfo.h.

Member Function Documentation

◆ erase()

void LoopInfo::erase ( Loop L)

◆ invalidate()

bool LoopInfo::invalidate ( Function F,
const PreservedAnalyses PA,
FunctionAnalysisManager::Invalidator  
)

Handle invalidation explicitly.

Definition at line 869 of file LoopInfo.cpp.

References llvm::PreservedAnalyses::getChecker().

◆ movementPreservesLCSSAForm()

bool llvm::LoopInfo::movementPreservesLCSSAForm ( Instruction Inst,
Instruction NewLoc 
)
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 1141 of file LoopInfo.h.

References assert(), llvm::Instruction::getFunction(), llvm::Instruction::getParent(), llvm::User::operands(), and llvm::Value::uses().

◆ operator=()

LoopInfo& llvm::LoopInfo::operator= ( LoopInfo &&  RHS)
inline

Definition at line 1096 of file LoopInfo.h.

References move.

◆ replacementPreservesLCSSAForm()

bool llvm::LoopInfo::replacementPreservesLCSSAForm ( Instruction From,
Value To 
)
inline

Returns true if replacing From with To everywhere is guaranteed to preserve LCSSA form.

Definition at line 1115 of file LoopInfo.h.

References llvm::LoopBase< BlockT, LoopT >::contains(), From, and I.

Referenced by llvm::rewriteLoopExitValues(), llvm::simplifyLoopAfterUnroll(), simplifyLoopInst(), and simplifyOneLoop().

◆ wouldBeOutOfLoopUseRequiringLCSSA()

bool LoopInfo::wouldBeOutOfLoopUseRequiringLCSSA ( const Value V,
const BasicBlock ExitBB 
) const

Friends And Related Function Documentation

◆ LoopBase< BasicBlock, Loop >

friend class LoopBase< BasicBlock, Loop >
friend

Definition at line 1086 of file LoopInfo.h.


The documentation for this class was generated from the following files: