class LPMUpdater
Declaration
class LPMUpdater { /* full declaration omitted */ };
Description
This class provides an interface for updating the loop pass manager based on mutations to the loop nest. A reference to an instance of this class is passed as an argument to each Loop pass, and Loop passes should use it to update LPM infrastructure if they modify the loop nest structure. \c LPMUpdater comes with two modes: the loop mode and the loop-nest mode. In loop mode, all the loops in the function will be pushed into the worklist and when new loops are added to the pipeline, their subloops are also inserted recursively. On the other hand, in loop-nest mode, only top-level loops are contained in the worklist and the addition of new (top-level) loops will not trigger the addition of their subloops.
Declared at: llvm/include/llvm/Transforms/Scalar/LoopPassManager.h:262
Member Variables
- private SmallPriorityWorklist<llvm::Loop*, 4>& Worklist
- The \c FunctionToLoopPassAdaptor's worklist of loops to process.
- private llvm::LoopAnalysisManager& LAM
- The analysis manager for use in the current loop nest.
- private llvm::Loop* CurrentL
- private bool SkipCurrentLoop
- private const bool LoopNestMode
- private llvm::Loop* ParentL
Method Overview
- private LPMUpdater(SmallPriorityWorklist<llvm::Loop *, 4> & Worklist, llvm::LoopAnalysisManager & LAM, bool LoopNestMode = false)
- public void addChildLoops(ArrayRef<llvm::Loop *> NewChildLoops)
- public void addSiblingLoops(ArrayRef<llvm::Loop *> NewSibLoops)
- public void markLoopAsDeleted(llvm::Loop & L, llvm::StringRef Name)
- public void revisitCurrentLoop()
- public void setParentLoop(llvm::Loop * L)
- public bool skipCurrentLoop() const
Methods
¶LPMUpdater(SmallPriorityWorklist<llvm::Loop*, 4>&
Worklist,
llvm::LoopAnalysisManager& LAM,
bool LoopNestMode = false)
LPMUpdater(SmallPriorityWorklist<llvm::Loop*, 4>&
Worklist,
llvm::LoopAnalysisManager& LAM,
bool LoopNestMode = false)
Declared at: llvm/include/llvm/Transforms/Scalar/LoopPassManager.h:378
Parameters
- SmallPriorityWorklist<llvm::Loop*, 4>& Worklist
- llvm::LoopAnalysisManager& LAM
- bool LoopNestMode = false
¶void addChildLoops(
ArrayRef<llvm::Loop*> NewChildLoops)
void addChildLoops(
ArrayRef<llvm::Loop*> NewChildLoops)
Description
Loop passes should use this method to indicate they have added new child loops of the current loop. \p NewChildLoops must contain only the immediate children. Any nested loops within them will be visited in postorder as usual for the loop pass manager.
Declared at: llvm/include/llvm/Transforms/Scalar/LoopPassManager.h:303
Parameters
- ArrayRef<llvm::Loop*> NewChildLoops
¶void addSiblingLoops(
ArrayRef<llvm::Loop*> NewSibLoops)
void addSiblingLoops(
ArrayRef<llvm::Loop*> NewSibLoops)
Description
Loop passes should use this method to indicate they have added new sibling loops to the current loop. \p NewSibLoops must only contain the immediate sibling loops. Any nested loops within them will be visited in postorder as usual for the loop pass manager.
Declared at: llvm/include/llvm/Transforms/Scalar/LoopPassManager.h:330
Parameters
- ArrayRef<llvm::Loop*> NewSibLoops
¶void markLoopAsDeleted(llvm::Loop& L,
llvm::StringRef Name)
void markLoopAsDeleted(llvm::Loop& L,
llvm::StringRef Name)
Description
Loop passes should use this method to indicate they have deleted a loop from the nest. Note that this loop must either be the current loop or a subloop of the current loop. This routine must be called prior to removing the loop from the loop nest. If this is called for the current loop, in addition to clearing any state, this routine will mark that the current loop should be skipped by the rest of the pass management infrastructure.
Declared at: llvm/include/llvm/Transforms/Scalar/LoopPassManager.h:282
Parameters
- llvm::Loop& L
- llvm::StringRef Name
¶void revisitCurrentLoop()
void revisitCurrentLoop()
Description
Restart the current loop. Loop passes should call this method to indicate the current loop has been sufficiently changed that it should be re-visited from the begining of the loop pass pipeline rather than continuing.
Declared at: llvm/include/llvm/Transforms/Scalar/LoopPassManager.h:351
¶void setParentLoop(llvm::Loop* L)
void setParentLoop(llvm::Loop* L)
Declared at: llvm/include/llvm/Transforms/Scalar/LoopPassManager.h:291
Parameters
- llvm::Loop* L
¶bool skipCurrentLoop() const
bool skipCurrentLoop() const
Description
This can be queried by loop passes which run other loop passes (like pass managers) to know whether the loop needs to be skipped due to updates to the loop nest. If this returns true, the loop object may have been deleted, so passes should take care not to touch the object.
Declared at: llvm/include/llvm/Transforms/Scalar/LoopPassManager.h:270