LLVM 24.0.0git
llvm::MachineLoopInfo Class Reference

#include "llvm/CodeGen/MachineLoopInfo.h"

Inheritance diagram for llvm::MachineLoopInfo:
[legend]

Public Member Functions

 MachineLoopInfo ()=default
 MachineLoopInfo (MachineDominatorTree &MDT)
 MachineLoopInfo (MachineLoopInfo &&)=default
 MachineLoopInfo (const MachineLoopInfo &)=delete
MachineLoopInfooperator= (const MachineLoopInfo &)=delete
LLVM_ABI bool invalidate (MachineFunction &, const PreservedAnalyses &PA, MachineFunctionAnalysisManager::Invalidator &)
 Handle invalidation explicitly.
LLVM_ABI MachineBasicBlockfindLoopPreheader (MachineLoop *L, bool SpeculativePreheader=false, bool FindMultiLoopPreheader=false) const
 Find the block that either is the loop preheader, or could speculatively be used as the preheader.
LLVM_ABI void calculate (MachineDominatorTree &MDT)
 Calculate the natural loop information.
Public Member Functions inherited from llvm::LoopInfoBase< MachineBasicBlock, MachineLoop >
 ~LoopInfoBase ()
void releaseMemory ()
MachineLoopAllocateLoop ()
iterator begin () const
iterator end () const
reverse_iterator rbegin () const
reverse_iterator rend () const
bool empty () const
SmallVector< MachineLoop *, 4 > getLoopsInPreorder () const
 Return all of the loops in the function in preorder across the loop nests, with siblings in forward program order.
SmallVector< MachineLoop *, 4 > getLoopsInReverseSiblingPreorder () const
 Return all of the loops in the function in preorder across the loop nests, with siblings in reverse program order.
MachineLoopgetLoopFor (const MachineBasicBlock *BB) const
 Return the inner most loop that BB lives in.
const MachineLoopoperator[] (const MachineBasicBlock *BB) const
 Same as getLoopFor.
unsigned getLoopDepth (const MachineBasicBlock *BB) const
 Return the loop nesting level of the specified block.
bool hasNoExitBlocks (const MachineLoop &L) const
 Return true if L does not have any exit blocks.
void getExitEdges (const MachineLoop &L, SmallVectorImpl< Edge > &ExitEdges) const
 Return all pairs of (inside_block,outside_block).
MachineBasicBlockgetUniqueLatchExitBlock (const MachineLoop &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 (MachineLoop &L, PredicateT Pred)
 Remove every block satisfying Pred from L's block list, preserving the order of the remaining blocks.
void removeBlocksFromLoopAndAncestors (MachineLoop *Start, MachineLoop *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< MachineLoop *, 4 > takeChildrenIf (MachineLoop *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.
MachineLoopgetSmallestCommonLoop (MachineLoop *A, MachineLoop *B) const
 Find the innermost loop containing both given loops.
bool isLoopHeader (const MachineBasicBlock *BB) const
const std::vector< MachineLoop * > & getTopLevelLoops () const
 Return the top-level loops.
MachineLoopremoveLoop (iterator I)
 This removes the specified top-level loop from this loop info object.
void changeLoopFor (const MachineBasicBlock *BB, MachineLoop *L)
 Change the top-level loop that contains BB to the specified loop.
void changeTopLevelLoop (MachineLoop *OldLoop, MachineLoop *NewLoop)
 Replace the specified loop in the top-level loops list with the indicated loop.
void addTopLevelLoop (MachineLoop *New)
 This adds the specified loop to the collection of top-level loops.
void removeBlock (MachineBasicBlock *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< MachineBasicBlock, false > &DomTree)
 Create the loop forest using a stable algorithm.
void print (raw_ostream &OS) const
void verify (const DominatorTreeBase< MachineBasicBlock, false > &DomTree) const
void destroy (MachineLoop *L)
 Destroy a loop that has been removed from the LoopInfo nest.

Friends

class LoopBase< MachineBasicBlock, MachineLoop >
class MachineLoopInfoWrapperPass

Additional Inherited Members

Public Types inherited from llvm::LoopInfoBase< MachineBasicBlock, MachineLoop >
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< MachineBasicBlock, MachineLoop >
static bool isNotAlreadyContainedIn (const MachineLoop *SubLoop, const MachineLoop *ParentLoop)

Detailed Description

Definition at line 106 of file MachineLoopInfo.h.

Constructor & Destructor Documentation

◆ MachineLoopInfo() [1/4]

llvm::MachineLoopInfo::MachineLoopInfo ( )
default

◆ MachineLoopInfo() [2/4]

llvm::MachineLoopInfo::MachineLoopInfo ( MachineDominatorTree & MDT)
inlineexplicit

Definition at line 112 of file MachineLoopInfo.h.

References calculate().

◆ MachineLoopInfo() [3/4]

llvm::MachineLoopInfo::MachineLoopInfo ( MachineLoopInfo && )
default

References MachineLoopInfo().

◆ MachineLoopInfo() [4/4]

llvm::MachineLoopInfo::MachineLoopInfo ( const MachineLoopInfo & )
delete

References MachineLoopInfo().

Member Function Documentation

◆ calculate()

◆ findLoopPreheader()

MachineBasicBlock * MachineLoopInfo::findLoopPreheader ( MachineLoop * L,
bool SpeculativePreheader = false,
bool FindMultiLoopPreheader = false ) const

Find the block that either is the loop preheader, or could speculatively be used as the preheader.

This is e.g. useful to place loop setup code. Code that cannot be speculated should not be placed here. SpeculativePreheader is controlling whether it also tries to find the speculative preheader if the regular preheader is not present. With FindMultiLoopPreheader = false, nullptr will be returned if the found preheader is the preheader of multiple loops.

Definition at line 146 of file MachineLoopInfo.cpp.

References llvm::LoopInfoBase< MachineBasicBlock, MachineLoop >::getLoopFor(), llvm::MachineBasicBlock::hasAddressTaken(), P, PB(), llvm::MachineBasicBlock::pred_size(), llvm::MachineBasicBlock::predecessors(), llvm::MachineBasicBlock::successors(), and T.

Referenced by operator=().

◆ invalidate()

bool MachineLoopInfo::invalidate ( MachineFunction & ,
const PreservedAnalyses & PA,
MachineFunctionAnalysisManager::Invalidator &  )

Handle invalidation explicitly.

Definition at line 67 of file MachineLoopInfo.cpp.

References llvm::PreservedAnalyses::getChecker().

Referenced by operator=().

◆ operator=()

MachineLoopInfo & llvm::MachineLoopInfo::operator= ( const MachineLoopInfo & )
delete

◆ LoopBase< MachineBasicBlock, MachineLoop >

friend class LoopBase< MachineBasicBlock, MachineLoop >
friend

Definition at line 99 of file MachineLoopInfo.h.

◆ MachineLoopInfoWrapperPass

friend class MachineLoopInfoWrapperPass
friend

Definition at line 108 of file MachineLoopInfo.h.

References MachineLoopInfoWrapperPass.

Referenced by MachineLoopInfoWrapperPass.


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