Return true if load LI may legally be hoisted out of CurLoop.
Declared in <llvm/Transforms/Utils/LoopUtils.h>
bool
canHoistLoad(
LoadInst& LI,
AAResults* AA,
DominatorTree* DT,
Loop* CurLoop,
MemorySSA& MSSA,
bool TargetExecutesOncePerLoop,
SinkAndHoistLICMFlags& LICMFlags,
OptimizationRemarkEmitter* ORE = nullptr);
This is the load-specific subset of canSinkOrHoistInst it rejects volatile or ordered loads, allows constant-memory / invariant.load / invariant.start-dominated loads unconditionally, and otherwise queries MSSA for an in-loop clobber. TargetExecutesOncePerLoop has the same meaning as in canSinkOrHoistInst (set to true when hoisting to the preheader).
True if LI may legally be hoisted out of CurLoop.
| Name | Description |
|---|---|
| LI | Load considered for hoisting. |
| AA | Alias analysis results. |
| DT | Dominator tree for the function. |
| CurLoop | Loop containing LI. |
| MSSA | MemorySSA used to find in-loop clobbers. |
| TargetExecutesOncePerLoop | Whether the hoist target runs once per loop. |
| LICMFlags | Caps controlling MemorySSA query cost. |
| ORE | Optional remark emitter for diagnostics. |