llvm::getIConstantVRegVal

If VReg is defined by a G_CONSTANT, return the corresponding value.

Synopsis

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

std::optional<APInt>
getIConstantVRegVal(
    Register VReg,
    MachineRegisterInfo const& MRI);

Return Value

The constant value, or std::nullopt if VReg is not a G_CONSTANT.

Parameters

NameDescription
VRegVirtual register that may be defined by a G_CONSTANT.
MRIRegister information for the function.