llvm::LoopBase

Instances of this class are used to represent loops that are detected in the flow graph.

Synopsis

Declared in <llvm/Support/GenericLoopInfo.h>

template<
    class BlockT,
    class LoopT>
class LoopBase;

Type Aliases

NameDescription
block_iterator Iterator over the basic blocks in this loop.
iterator Iterator over immediate child loops.
reverse_iterator Reverse iterator over immediate child loops.

Member Functions

NameDescription
addBasicBlockToLoop Add NewBB as a member of this loop and all parent loops.
addBlockEntry Add BB directly to this loop's basic block list.
addChildLoop Add NewChild as a child of this loop.
begin Return an iterator to the first child loop.
block_begin Return an iterator to the first block in this loop.
block_end Return an iterator past the last block in this loop.
blocks Return a range over the basic blocks in this loop.
contains contains overloads
end Return an iterator past the last child loop.
getBlocks Get a list of the basic blocks which make up this loop.
getExitBlock If getExitBlocks would return exactly one block, return that block. Otherwise return null.
getExitBlocks Return all of the successor blocks of this loop.
getExitingBlock If getExitingBlocks would return exactly one block, return that block. Otherwise return null.
getExitingBlocks Return all blocks inside the loop that have successors outside the loop.
getHeader Return the header block of this loop.
getLoopDepth Return the nesting level of this loop.
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.
getLoopLatches Return all loop latch blocks of this loop.
getLoopPredecessor Return the unique predecessor of the loop header outside the loop, or null.
getLoopPreheader Return the preheader block for this loop, or null if there is none.
getLoopsInPreorder Return all loops in this nest in preorder, siblings in program order.
getNumBackEdges Calculate the number of back edges to the loop header.
getNumBlocks Get the number of blocks in this loop in constant time. Invalidate the loop, indicating that it is no longer a loop.
getOutermostLoop Return the outermost loop containing this loop (possibly itself).
getParentLoop Return the parent loop, or nullptr for top-level loops.
getSubLoops Return the loops contained entirely within this loop.
getUniqueExitBlock If getUniqueExitBlocks would return exactly one block, return that block. Otherwise return null.
getUniqueExitBlocks Return all unique successor blocks of this loop.
getUniqueNonLatchExitBlocks Return unique exit blocks of this loop, ignoring exits from the latch.
hasDedicatedExits Return true if no exit block for the loop has a predecessor that is outside the loop.
isAnnotatedParallel Returns true if the loop is annotated parallel.
isInnermost Return true if the loop does not contain any (natural) loops.
isInvalid Return true if this loop is no longer valid.
isLoopExiting Return true if BB can branch to a block outside this loop.
isLoopLatch Return true if BB is a latch of this loop.
isOutermost Return true if the loop does not have a parent (natural) loop.
moveToHeader Move BB to be the header of this loop.
print Print this loop and optionally its nested loops.
rbegin Return a reverse iterator to the last child loop.
removeBlockFromLoop Remove BB from this loop's block list.
removeChildLoop removeChildLoop overloads
rend Return a reverse iterator past the first child loop.
replaceChildLoopWith Replace child loop OldChild with NewChild in this loop's children.
reserveBlocks Reserve capacity for at least Size blocks in this loop's block list.
setParentLoop Set the parent loop pointer without updating child lists.
verifyLoop Verify loop structure
verifyLoopNest Verify loop structure of this loop and all nested loops.

Static Member Functions

NameDescription
getInnerLoopsInPreorder Append inner loops of L to PreOrderLoops in preorder.

Data Members

NameDescription
BlockData [variant member]Contiguous block list for this loop; first entry is the header.
PendingHeader [variant member]Header stashed while the loop is under construction.

Protected Member Functions

NameDescription
LoopBase [constructor]This creates an empty loop.
~LoopBase [destructor]Destroy this loop and its subloops without reclaiming allocator storage.

Friends

NameDescription
llvm::LoopInfoBaseAnalysis that builds and owns the loop forest for a function.

Non-Member Functions

NameDescription
getExitBlockHelperFind an exit block of L, optionally requiring uniqueness.

Derived Classes

NameDescription
Loop Represents a single loop in the control flow graph. Note that not all SCCs in the CFG are necessarily loops.
MachineLoop Represents a single natural loop in a machine-function CFG.