llvm::ConstantFoldFPBinOp

Constant-fold a generic floating-point binary opcode on two registers.

Synopsis

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

std::optional<APFloat>
ConstantFoldFPBinOp(
    unsigned int Opcode,
    Register const Op1,
    Register const Op2,
    MachineRegisterInfo const& MRI);

Return Value

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

Parameters

NameDescription
OpcodeGeneric floating-point binary opcode to fold.
Op1First operand register.
Op2Second operand register.
MRIRegister information for the function.