llvm::getOpcodeDef

See if Reg is defined by an single def instruction of type T Also try to do trivial folding if it's a COPY with same types. Returns null otherwise.

Synopsis

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

template<class T>
T*
getOpcodeDef(
    Register Reg,
    MachineRegisterInfo const& MRI);

Return Value

The defining instruction cast to T, or nullptr.

Parameters

NameDescription
RegVirtual register whose defining instruction is inspected.
MRIRegister information for the function.