Match a unary predicate against a scalar/splat constant or build vector.
Declared in <llvm/CodeGen/GlobalISel/Utils.h>
bool
matchUnaryPredicate(
MachineRegisterInfo const& MRI,
Register Reg,
std::function<bool(Constant const*)> Match,
bool AllowUndefs = false);
Attempt to match a unary predicate against a scalar/splat constant or every element of a constant G_BUILD_VECTOR. If ConstVal is null, the source value was undef.
True if the predicate matches all elements.
| Name | Description |
|---|---|
| MRI | Register information for the function. |
| Reg | Virtual register whose constant definition is matched. |
| Match | Predicate invoked for each constant element (null if undef). |
| AllowUndefs | Whether undef elements are permitted. |