llvm::ConstantFoldIntToFloat

Constant-fold an integer-to-float conversion opcode.

Synopsis

Declared in <llvm/CodeGen/GlobalISel/Utils.h>

std::optional<APFloat>
ConstantFoldIntToFloat(
    unsigned int Opcode,
    LLT DstTy,
    Register Src,
    MachineRegisterInfo const& MRI);

Return Value

The folded APFloat, or std::nullopt on failure.

Parameters

NameDescription
OpcodeInteger-to-float conversion opcode to fold.
DstTyDestination floating-point type.
SrcSource integer register.
MRIRegister information for the function.