llvm::isImpliedCondition

Return whether a compare is implied true or false by LHS, if known.

Synopsis

Declared in <llvm/Analysis/ValueTracking.h>

std::optional<bool>
isImpliedCondition(
    Value const* LHS,
    CmpPredicate RHSPred,
    Value const* RHSOp0,
    Value const* RHSOp1,
    DataLayout const& DL,
    bool LHSIsTrue = true,
    unsigned int Depth = 0);

Return Value

True/false if implied, or nullopt if unknown.

Parameters

NameDescription
LHSCondition assumed true or false according to LHSIsTrue.
RHSPredPredicate of the right-hand compare.
RHSOp0Left operand of the right-hand compare.
RHSOp1Right operand of the right-hand compare.
DLData layout used by the implication analysis.
LHSIsTrueWhether LHS is assumed true (vs false).
DepthCurrent recursion depth for this query.