ΒΆbool isSafeToSpeculativelyExecuteWithOpcode(
    unsigned int Opcode,
    const llvm::Instruction* Inst,
    const llvm::Instruction* CtxI = nullptr,
    const llvm::DominatorTree* DT = nullptr,
    const llvm::TargetLibraryInfo* TLI = nullptr)

Description

This returns the same result as isSafeToSpeculativelyExecute if Opcode is the actual opcode of Inst. If the provided and actual opcode differ, the function (virtually) overrides the opcode of Inst with the provided Opcode. There are come constraints in this case: * If Opcode has a fixed number of operands (eg, as binary operators do), then Inst has to have at least as many leading operands. The function will ignore all trailing operands beyond that number. * If Opcode allows for an arbitrary number of operands (eg, as CallInsts do), then all operands are considered. * The virtual instruction has to satisfy all typing rules of the provided Opcode. * This function is pessimistic in the following sense: If one actually materialized the virtual instruction, then isSafeToSpeculativelyExecute may say that the materialized instruction is speculatable whereas this function may have said that the instruction wouldn't be speculatable. This behavior is a shortcoming in the current implementation and not intentional.

Declared at: llvm/include/llvm/Analysis/ValueTracking.h:483

Parameters

unsigned int Opcode
const llvm::Instruction* Inst
const llvm::Instruction* CtxI = nullptr
const llvm::DominatorTree* DT = nullptr
const llvm::TargetLibraryInfo* TLI = nullptr