If VReg is defined by a statically evaluable chain of instructions rooted on a G_CONSTANT returns its APInt value and def register.

Synopsis

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

std::optional<ValueAndVReg>
getIConstantVRegValWithLookThrough(
    Register VReg,
    MachineRegisterInfo const& MRI,
    bool LookThroughInstrs = true);

Return Value

The constant value and def register, or std::nullopt.

Parameters

Name

Description

VReg

Virtual register to look through for a constant.

MRI

Register information for the function.

LookThroughInstrs

Whether to fold through trivial defining ops.

Created with MrDocs