llvm::canCreateUndefOrPoison

Returns true if Reg can create undef or poison from safe operands.

Synopsis

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

bool
canCreateUndefOrPoison(
    Register Reg,
    MachineRegisterInfo const& MRI,
    bool ConsiderFlagsAndMetadata = true);

Description

ConsiderFlagsAndMetadata controls whether poison producing flags and metadata on the instruction are considered. This can be used to see if the instruction could still introduce undef or poison even without poison generating flags and metadata which might be on the instruction.

Return Value

True if Reg can create undef or poison from safe operands.

Parameters

NameDescription
RegVirtual register whose defining instruction is tested.
MRIRegister information for the function.
ConsiderFlagsAndMetadataWhether poison flags/metadata count.