ΒΆbool canCreateUndefOrPoison(
    const llvm::Operator* Op,
    bool ConsiderFlags = true)

Description

canCreateUndefOrPoison returns true if Op can create undef or poison from non-undef & non-poison operands. 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. \p ConsiderFlags controls whether poison producing flags 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 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.

Declared at: llvm/include/llvm/Analysis/ValueTracking.h:670

Parameters

const llvm::Operator* Op
bool ConsiderFlags = true