LLVM: llvm::MachineLoop Class Reference (original) (raw)
Public Member Functions
getTopBlock ()
Return the "top" block in the loop, which is the first block in the linear layout, ignoring any parts of the loop not contiguous with the part that contains the header.
Return the "bottom" block in the loop, which is the last block in the linear layout, ignoring any parts of the loop not contiguous with the part that contains the header.
Find the block that contains the loop control variable and the loop test.
getStartLoc () const
Return the debug location of the start of this loop.
Find the llvm.loop metadata for this loop.
isLoopInvariant (MachineInstr &I, const Register ExcludeReg=0) const
Returns true if the instruction is loop invariant.
LLVM_ABI void
Public Member Functions inherited from llvm::LoopBase< MachineBasicBlock, MachineLoop >
Return the nesting level of this loop.
Return the parent loop if it exists or nullptr for top level loops.
Get the outermost loop in which this loop is contained.
void
setParentLoop (MachineLoop *L)
This is a raw interface for bypassing addChildLoop.
contains (const MachineLoop *L) const
Return true if the specified loop is contained within in this loop.
const std::vector< MachineLoop * > &
getSubLoops () const
Return the loops contained entirely within this loop.
std::vector< MachineLoop * > &
isInnermost () const
Return true if the loop does not contain any (natural) loops.
isOutermost () const
Return true if the loop does not have a parent (natural) loop.
ArrayRef< MachineBasicBlock * >
Get a list of the basic blocks which make up this loop.
block_begin () const
iterator_range< block_iterator >
Get the number of blocks in this loop in constant time.
std::vector< MachineBasicBlock * > &
Return a direct, mutable handle to the blocks vector so that we can mutate it efficiently with techniques like std::remove.
SmallPtrSetImpl< const MachineBasicBlock * > &
getBlocksSet ()
Return a direct, mutable handle to the blocks set so that we can mutate it efficiently.
Return true if this loop is no longer valid.
isLoopExiting (const MachineBasicBlock *BB) const
True if terminator in the block can branch to another block that is outside of the current loop.
isLoopLatch (const MachineBasicBlock *BB) const
Calculate the number of back edges to the loop header.
void
getExitingBlocks (SmallVectorImpl< MachineBasicBlock * > &ExitingBlocks) const
Return all blocks inside the loop that have successors outside of the loop.
If getExitingBlocks would return exactly one block, return that block.
void
getExitBlocks (SmallVectorImpl< MachineBasicBlock * > &ExitBlocks) const
Return all of the successor blocks of this loop.
If getExitBlocks would return exactly one block, return that block.
Return true if no exit block for the loop has a predecessor that is outside the loop.
void
getUniqueExitBlocks (SmallVectorImpl< MachineBasicBlock * > &ExitBlocks) const
Return all unique successor blocks of this loop.
void
getUniqueNonLatchExitBlocks (SmallVectorImpl< MachineBasicBlock * > &ExitBlocks) const
Return all unique successor blocks of this loop except successors from Latch block are not considered.
If getUniqueExitBlocks would return exactly one block, return that block.
getUniqueLatchExitBlock () const
Return the unique exit block for the latch, or null if there are multiple different exit blocks or the latch is not exiting.
Return true if this loop does not have any exit blocks.
void
getExitEdges (SmallVectorImpl< Edge > &ExitEdges) const
Return all pairs of (inside_block,outside_block).
If there is a preheader for this loop, return it.
If the given loop's header has exactly one unique predecessor outside the loop, return it.
If there is a single latch block for this loop, return it.
void
getLoopLatches (SmallVectorImpl< MachineBasicBlock * > &LoopLatches) const
Return all loop latch blocks of this loop.
SmallVector< const MachineLoop *, 4 >
Return all loops in the loop nest rooted by the loop in preorder, with siblings in forward program order.
void
addBasicBlockToLoop (MachineBasicBlock *NewBB, LoopInfoBase< MachineBasicBlock, MachineLoop > &LI)
This method is used by other analyses to update loop information.
void
replaceChildLoopWith (MachineLoop *OldChild, MachineLoop *NewChild)
This is used when splitting loops up.
void
addChildLoop (MachineLoop *NewChild)
Add the specified loop to be a child of this loop.
This removes the specified child from being a subloop of this loop.
void
addBlockEntry (MachineBasicBlock *BB)
This adds a basic block directly to the basic block list.
void
reverseBlock (unsigned from)
interface to reverse Blocks[from, end of loop] in this loop
void
interface to do reserve() for Blocks
void
moveToHeader (MachineBasicBlock *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).
void
removeBlockFromLoop (MachineBasicBlock *BB)
This removes the specified basic block from the current loop, updating the Blocks as appropriate.
void
verifyLoop () const
Verify loop structure.
void
verifyLoopNest (DenseSet< const MachineLoop * > *Loops) const
Verify loop structure of this loop and all nested loops.
Returns true if the loop is annotated parallel.
void
print (raw_ostream &OS, bool Verbose=false, bool PrintNested=true, unsigned Depth=0) const
Print loop with all the BBs inside it.
Definition at line 48 of file MachineLoopInfo.h.
| MDNode * MachineLoop::getLoopID | ( | ) | const |
|---|
Returns true if the instruction is loop invariant.
I.e., all virtual register operands are defined outside of the loop, physical registers aren't accessed explicitly, and there are no side effects that aren't captured by the operands or other flags. ExcludeReg can be used to exclude the given register from the check i.e. when we're considering hoisting it's definition but not hoisted it yet
Definition at line 233 of file MachineLoopInfo.cpp.
References assert(), llvm::LoopBase< MachineBasicBlock, MachineLoop >::contains(), llvm::LoopBase< MachineBasicBlock, MachineLoop >::getHeader(), llvm::MachineFunction::getRegInfo(), llvm::MachineFunction::getSubtarget(), I, MRI, TII, and TRI.