Return true if Op can create undef or poison from clean operands.
Declared in <llvm/Analysis/ValueTracking.h>
bool
canCreateUndefOrPoison(
Operator const* Op,
bool ConsiderFlagsAndMetadata = true);
For vectors, canCreateUndefOrPoison returns true if there is potential poison or undef in any element of the result when vectors without undef/poison poison are given as operands. For example, given Op = shl <2 x i32> %x, <0, 32>, this function returns true. If Op raises immediate UB but never creates poison or undef (e.g. sdiv I, 0), canCreatePoison returns false.
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. (i.e. could the result of Op->dropPoisonGeneratingFlags() still create poison or undef)
canCreatePoison returns true if Op can create poison from non-poison operands.
True if Op can create undef or poison.
| Name | Description |
|---|---|
| Op | Operator that may introduce undef or poison. |
| ConsiderFlagsAndMetadata | Whether poison-generating flags/metadata count. |