Sink invariant instructions out of a loop region in reverse DFS order.
Declared in <llvm/Transforms/Utils/LoopUtils.h>
bool
sinkRegion(
DomTreeNode* N,
AAResults* AA,
LoopInfo* LI,
DominatorTree* DT,
TargetLibraryInfo* TLI,
TargetTransformInfo* TTI,
Loop* CurLoop,
MemorySSAUpdater& MSSAU,
ICFLoopSafetyInfo* SafetyInfo,
SinkAndHoistLICMFlags& Flags,
OptimizationRemarkEmitter* ORE,
Loop* OutermostLoop = nullptr);
Walk the specified region of the CFG (defined by all blocks dominated by the specified block, and that are in the current loop) in reverse depth first order w.r.t the DominatorTree. This allows us to visit uses before definitions, allowing us to sink a loop body in one pass without iteration. Takes DomTreeNode, AAResults, LoopInfo, DominatorTree, TargetLibraryInfo, Loop, AliasSet information for all instructions of the loop and loop safety information as arguments. Diagnostics is emitted via ORE. It returns changed status. CurLoop is a loop to do sinking on. OutermostLoop is used only when this function is called by sinkRegionForLoopNest.
True if any instructions were sunk.
| Name | Description |
|---|---|
| N | Dominator-tree node defining the region to walk. |
| AA | Alias analysis results. |
| LI | Loop info for the function. |
| DT | Dominator tree for the function. |
| TLI | Target library info. |
| TTI | Target transform info. |
| CurLoop | Loop whose body may be sunk. |
| MSSAU | MemorySSA updater for the transform. |
| SafetyInfo | Loop safety information for faulting ops. |
| Flags | Caps controlling MemorySSA query cost. |
| ORE | Optional remark emitter for diagnostics. |
| OutermostLoop | Outermost loop when called from nest sinking. |