llvm::matchUnaryPredicate

Match a unary predicate against a scalar/splat constant or build vector.

Synopsis

Declared in <llvm/CodeGen/GlobalISel/Utils.h>

bool
matchUnaryPredicate(
    MachineRegisterInfo const& MRI,
    Register Reg,
    std::function<bool(Constant const*)> Match,
    bool AllowUndefs = false);

Description

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.

Return Value

True if the predicate matches all elements.

Parameters

NameDescription
MRIRegister information for the function.
RegVirtual register whose constant definition is matched.
MatchPredicate invoked for each constant element (null if undef).
AllowUndefsWhether undef elements are permitted.