Analysis that identifies natural loops in a function's CFG.

Synopsis

Declared in <llvm/Analysis/LoopInfo.h>

class LoopInfo
    : public LoopInfoBase<BasicBlock, Loop>

Base Classes

Name

Description

LoopInfoBase<BasicBlock, Loop>

Analysis that builds and owns the loop forest for a function.

Type Aliases

Name

Description

Edge

Edge type.

iterator

Iterator over the top‐level loops in the current function.

reverse_iterator

Reverse iterator over the top‐level loops in the current function.

Member Functions

Name

Description

LoopInfo [constructor]

Constructors

operator=

Assignment operators

AllocateLoop

Allocate and construct a new empty loop owned by this LoopInfo.

addTopLevelLoop

Add New to the collection of top‐level loops.

analyze

analyze overloads

begin

Return an iterator to the first top‐level loop.

changeLoopFor

Change the innermost loop that contains BB to L.

changeTopLevelLoop

Replace OldLoop with NewLoop in the top‐level loops list.

destroy

Destroy a loop that has been removed from the LoopInfo nest.

empty

Return true if there are no top‐level loops.

end

Return an iterator past the last top‐level loop.

erase

Update LoopInfo after removing the last backedge from a loop.

getExitEdges

Return all pairs of (inside_block,outside_block).

getLoopDepth

Return the loop nesting level of the specified block.

getLoopFor

Return the innermost loop that BB lives in.

getLoopsInPreorder

Return all of the loops in the function in preorder across the loop nests, with siblings in forward program order.

getLoopsInReverseSiblingPreorder

Return all of the loops in the function in preorder across the loop nests, with siblings in reverse program order.

getSmallestCommonLoop

getSmallestCommonLoop overloads

getTopLevelLoops

Return the top‐level loops.

getUniqueLatchExitBlock

Return the unique exit block for the latch of L, or null.

hasNoExitBlocks

Return true if L does not have any exit blocks.

invalidate

Handle invalidation explicitly.

isLoopHeader

Return true if BB is a loop header.

movementPreservesLCSSAForm

Checks if moving a specific instruction can break LCSSA in any loop.

operator[]

Same as getLoopFor.

print

Print the top‐level loops and their nests to OS.

rbegin

Return a reverse iterator to the last top‐level loop.

releaseMemory

Destroy all loops and clear block maps and layout storage.

removeBlock

Completely remove BB from all loop data structures.

removeBlocksFromLoopAndAncestors

Remove blocks satisfying Pred from Start and its ancestors.

removeBlocksIf

Remove blocks satisfying Pred from L's block list.

removeLoop

Remove the specified top‐level loop from this loop info object.

rend

Return a reverse iterator past the first top‐level loop.

replacementPreservesLCSSAForm

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

takeChildrenIf

Detach and return children of Parent that satisfy Pred.

verify

Verify the loop forest and block‐to‐loop mapping for consistency.

wouldBeOutOfLoopUseRequiringLCSSA

Return true if a use of V in ExitBB would need an LCSSA PHI.

Static Member Functions

Name

Description

isNotAlreadyContainedIn

Return true if SubLoop is not already contained in ParentLoop.

Friends

Name

Description

llvm::LoopBase

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

Non-Member Functions

Name

Description

appendLoopsToWorklist

Append all loops from LI onto a worklist in CFG‐forward order.

Created with MrDocs