Return true if I may legally be sunk or hoisted, ignoring faults.

Synopsis

Declared in <llvm/Transforms/Utils/LoopUtils.h>

bool
canSinkOrHoistInst(
    Instruction& I,
    AAResults* AA,
    DominatorTree* DT,
    Loop* CurLoop,
    MemorySSAUpdater& MSSAU,
    bool TargetExecutesOncePerLoop,
    SinkAndHoistLICMFlags& LICMFlags,
    OptimizationRemarkEmitter* ORE = nullptr);

Description

Returns true if is legal to hoist or sink this instruction disregarding the possible introduction of faults. Reasoning about potential faulting instructions is the responsibility of the caller since it is challenging to do efficiently from within this routine. TargetExecutesOncePerLoop is true only when it is guaranteed that the target executes at most once per execution of the loop body. This is used to assess the legality of duplicating atomic loads. Generally, this is true when moving out of loop and not true when moving into loops. If ORE is set use it to emit optimization remarks.

Return Value

True if I may legally be sunk or hoisted, ignoring faults.

Parameters

Name

Description

I

Instruction considered for sinking or hoisting.

AA

Alias analysis results.

DT

Dominator tree for the function.

CurLoop

Loop containing I.

MSSAU

MemorySSA updater used for memory dependence checks.

TargetExecutesOncePerLoop

Whether the move target runs once per loop.

LICMFlags

Caps controlling MemorySSA query cost.

ORE

Optional remark emitter for diagnostics.

Created with MrDocs