llvm::isSafeToSpeculativelyExecute

isSafeToSpeculativelyExecute overloads

Synopses

Declared in <llvm/Analysis/ValueTracking.h>

Iterator-context overload of isSafeToSpeculativelyExecute.

bool
isSafeToSpeculativelyExecute(
    Instruction const* I,
    BasicBlock::iterator CtxI,
    AssumptionCache* AC = nullptr,
    DominatorTree const* DT = nullptr,
    TargetLibraryInfo const* TLI = nullptr,
    bool UseVariableInfo = true,
    bool IgnoreUBImplyingAttrs = true);
» more...

Return true if the instruction does not have any effects besides calculating the result and does not have undefined behavior.

bool
isSafeToSpeculativelyExecute(
    Instruction const* I,
    Instruction const* CtxI = nullptr,
    AssumptionCache* AC = nullptr,
    DominatorTree const* DT = nullptr,
    TargetLibraryInfo const* TLI = nullptr,
    bool UseVariableInfo = true,
    bool IgnoreUBImplyingAttrs = true);
» more...

Return Value

True if I is safe to speculate in the given context.

Parameters

NameDescription
IInstruction to test for speculative safety.
CtxIContext position expressed as a basic-block iterator.
ACOptional assumption cache for context-sensitive facts.
DTOptional dominator tree for context-sensitive analysis.
TLIOptional target library info.
UseVariableInfoWhether non-constant operand info may be used.
IgnoreUBImplyingAttrsWhether to ignore UB-implying attributes.