llvm::ISD::matchUnaryPredicateImpl

Match a unary predicate against scalar/splat/BUILD_VECTOR constants.

Synopsis

Declared in <llvm/CodeGen/SelectionDAGNodes.h>

template<typename ConstNodeType>
bool
matchUnaryPredicateImpl(
    SDValue Op,
    APInt const& DemandedElts,
    std::function<bool(ConstNodeType*)> Match,
    bool AllowUndefs = false,
    bool AllowTruncation = false);

Description

The DemandedElts argument allows us to only collect the known bits that are shared by the requested vector elements. If AllowUndef is true, then UNDEF elements will pass nullptr to Match.

Return Value

True if the unary predicate matched.

Parameters

NameDescription
OpValue to match against.
DemandedEltsElements that must satisfy the predicate.
MatchPredicate invoked for each constant element.
AllowUndefsWhether undef elements are allowed.
AllowTruncationWhether build-vector truncation is allowed.