Match a unary predicate against scalar/splat/BUILD_VECTOR constants.
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);
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.
True if the unary predicate matched.
| Name | Description |
|---|---|
| Op | Value to match against. |
| DemandedElts | Elements that must satisfy the predicate. |
| Match | Predicate invoked for each constant element. |
| AllowUndefs | Whether undef elements are allowed. |
| AllowTruncation | Whether build-vector truncation is allowed. |