llvm::MachineLoopInfo

Synopsis

Declared in <llvm/CodeGen/MachineLoopInfo.h>

class MachineLoopInfo
    : public LoopInfoBase<MachineBasicBlock, MachineLoop>

Base Classes

NameDescription
LoopInfoBase<MachineBasicBlock, MachineLoop>This class builds and contains all of the top-level loop structures in the specified function.

Type Aliases

NameDescription
Edge Edge type.
iterator iterator/begin/end - The interface to the top-level loops in the current function.
reverse_iterator

Member Functions

NameDescription
MachineLoopInfo [constructor]Constructors
operator= Assignment operators
AllocateLoop
addTopLevelLoop This adds the specified loop to the collection of top-level loops.
analyze analyze overloads
begin
calculate calculate overloads
changeLoopFor Change the top-level loop that contains BB to the specified loop. This should be used by transformations that restructure the loop hierarchy tree.
changeTopLevelLoop Replace the specified loop in the top-level loops list with the indicated loop.
destroy Destroy a loop that has been removed from the LoopInfo nest.
empty
end
findLoopPreheader 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.
getExitEdges Return all pairs of (inside_block,outside_block).
getLoopDepth Return the loop nesting level of the specified block. A depth of 0 means the block is not inside any loop.
getLoopFor Return the inner most loop that BB lives in. If a basic block is in no loop (for example the entry node), null is returned.
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 if there are multiple different exit blocks or the latch is not exiting.
hasNoExitBlocks Return true if L does not have any exit blocks.
invalidate Handle invalidation explicitly.
isLoopHeader
operator[] Same as getLoopFor.
print @}
rbegin
releaseMemory
removeBlock 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.
removeBlocksFromLoopAndAncestors 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.
removeBlocksIf Remove every block satisfying Pred from L's block list, preserving the order of the remaining blocks. Only L itself is updated, not its ancestors or descendants, and not the block-to-loop mapping.
removeLoop This removes the specified top-level loop from this loop info object. The loop is not deleted, as it will presumably be inserted into another loop.
rend
takeChildrenIf Detach and return the children of Parent (the top-level loops if Parent is null) that satisfy Pred, clearing their parent pointers. Both the remaining and the returned children keep their relative order.
verify

Static Member Functions

Name
isNotAlreadyContainedIn

Friends

NameDescription
llvm::MachineLoopInfoWrapperPass
llvm::LoopBaseInstances of this class are used to represent loops that are detected in the flow graph.