13#ifndef LLVM_CODEGEN_GLOBALISEL_MIPATTERNMATCH_H
14#define LLVM_CODEGEN_GLOBALISEL_MIPATTERNMATCH_H
29template <
typename Reg,
typename Pattern>
32 return P.match(
MRI, R);
35template <
typename Pattern>
41template <
typename Pattern>
57template <
typename SubPat>
71template <
typename SubPat>
76template <
typename ConstT>
97 CR = std::move(*MaybeCst);
111template <
typename ConstT>
122inline std::optional<int64_t>
132 CR = std::move(*MaybeCst);
137 CR = std::move(*MaybeCstSplat);
201 return P(FPImm->getValueAPF());
287 APInt(64, RequestedValue,
true));
316 APInt(64, RequestedValue,
true));
356template <
typename... Preds>
struct And {
357 template <
typename MatchSrc>
363template <
typename Pred,
typename... Preds>
364struct And<Pred, Preds...> :
And<Preds...> {
366 And(Pred &&p, Preds &&... preds)
367 :
And<Preds...>(
std::forward<Preds>(preds)...),
P(
std::forward<Pred>(p)) {
369 template <
typename MatchSrc>
375template <
typename... Preds>
struct Or {
376 template <
typename MatchSrc>
382template <
typename Pred,
typename... Preds>
383struct Or<Pred, Preds...> :
Or<Preds...> {
385 Or(Pred &&p, Preds &&... preds)
386 :
Or<Preds...>(
std::forward<Preds>(preds)...),
P(
std::forward<Pred>(p)) {}
387 template <
typename MatchSrc>
393template <
typename... Preds>
And<Preds...>
m_all_of(Preds &&... preds) {
394 return And<Preds...>(std::forward<Preds>(preds)...);
397template <
typename... Preds>
Or<Preds...>
m_any_of(Preds &&... preds) {
398 return Or<Preds...>(std::forward<Preds>(preds)...);
500 return VT ==
MRI.getType(R);
526 return TmpMI->
getOpcode() == TargetOpcode::G_IMPLICIT_DEF;
564 if (
MI->getOpcode() == TargetOpcode::G_CONSTANT) {
565 Bits =
MI->getOperand(1).getCImm()->getValue();
568 if (
MI->getOpcode() == TargetOpcode::G_FCONSTANT) {
569 Bits =
MI->getOperand(1).getFPImm()->getValueAPF().bitcastToAPInt();
593 template <
typename OpTy>
609template <
typename PtrP>
613template <
typename PtrP>
618template <
typename PtrP>
623template <
typename PtrP>
627template <
typename PtrP>
634 return {Inst,
m_Reg()};
638 return {Inst,
m_Reg()};
643 return {Inst,
m_Reg(), MMO};
647 return {Inst,
m_Reg(), MMO};
676 template <
typename OpTy>
682 if (!GI || !GI->is(IntrID))
684 return matchOperands(
MRI, *GI, std::index_sequence_for<OpMatchers...>{});
688 template <
size_t... Is>
690 std::index_sequence<Is...>) {
700inline GIntrinsic_match<IntrID, OpMatchers...>
719 if (!Shuf || !
Src1.match(
MRI, Shuf->getSrc1Reg()) ||
720 !
Src2.match(
MRI, Shuf->getSrc2Reg()))
722 Mask = Shuf->getMask();
727template <
typename Src1Ty,
typename Src2Ty>
739 TmpMI->
getOpcode() == TargetOpcode::G_FRAME_INDEX) {
753template <
typename LHS_P,
typename RHS_P,
unsigned Opcode,
764 template <
typename OpTy>
769 if ((TmpMI->
getFlags() & Flags) != Flags)
791template <
typename LHS_P,
typename RHS_P,
bool Commutable = false>
799 template <
typename OpTy>
820template <
typename LHS,
typename RHS>
826template <
typename LHS,
typename RHS>
832template <
typename LHS,
typename RHS>
838template <
typename LHS,
typename RHS>
844template <
typename LHS,
typename RHS>
851template <
typename LHS,
typename RHS>
857template <
typename LHS,
typename RHS>
863template <
typename LHS,
typename RHS>
869template <
typename LHS,
typename RHS>
875template <
typename LHS,
typename RHS>
881template <
typename LHS,
typename RHS>
887template <
typename LHS,
typename RHS>
893template <
typename LHS,
typename RHS>
899template <
typename LHS,
typename RHS>
905template <
typename LHS,
typename RHS>
911template <
typename LHS,
typename RHS>
917template <
typename LHS,
typename RHS>
925template <
typename LHS,
typename RHS>
930template <
typename LHS,
typename RHS>
936template <
typename LHS,
typename RHS>
942template <
typename LHS,
typename RHS>
948template <
typename LHS,
typename RHS>
954template <
typename LHS,
typename RHS>
960template <
typename LHS,
typename RHS>
966template <
typename LHS,
typename RHS>
977 template <
typename OpTy>
989template <
typename SrcTy>
995template <
typename SrcTy>
1000template <
typename SrcTy>
1005template <
typename SrcTy>
1010template <
typename SrcTy>
1015template <
typename SrcTy>
1021template <
typename SrcTy>
1027template <
typename SrcTy>
1033template <
typename SrcTy>
1041template <
typename SrcTy,
typename ImmTy,
unsigned Opcode>
1047 template <
typename OpTy>
1058 bool match(int64_t)
const {
return true; }
1062template <
typename SrcTy>
1068template <
typename SrcTy,
typename ImmTy>
1075template <
typename SrcTy>
1081template <
typename SrcTy,
typename ImmTy>
1087template <
typename SrcTy>
1092template <
typename SrcTy>
1097template <
typename SrcTy>
1102template <
typename SrcTy>
1107template <
typename SrcTy>
1115template <
typename Pred_P,
typename LHS_P,
typename RHS_P,
unsigned Opcode,
1116 bool Commutable =
false>
1125 template <
typename OpTy>
1133 if (!
P.match(
MRI, TmpPred))
1150template <
typename LHS_P,
typename Test_P,
unsigned Opcode>
1157 template <
typename OpTy>
1169 if (
T.match(
MRI, TmpClass))
1176template <
typename Pred,
typename LHS,
typename RHS>
1182template <
typename Pred,
typename LHS,
typename RHS>
1197template <
typename Pred,
typename LHS,
typename RHS>
1212template <
typename Pred,
typename LHS,
typename RHS>
1220template <
typename LHS,
typename Test>
1238template <
typename Src0Ty,
typename Src1Ty,
typename Src2Ty,
unsigned Opcode>
1246 template <
typename OpTy>
1259template <
typename Src0Ty,
typename Src1Ty,
typename Src2Ty>
1261 TargetOpcode::G_INSERT_VECTOR_ELT>
1264 TargetOpcode::G_INSERT_VECTOR_ELT>(Src0, Src1, Src2);
1267template <
typename Src0Ty,
typename Src1Ty,
typename Src2Ty>
1269m_GISelect(
const Src0Ty &Src0,
const Src1Ty &Src1,
const Src2Ty &Src2) {
1276template <
typename SrcTy>
1284template <
typename SrcTy>
This file implements a class to represent arbitrary precision integral constant values and operations...
static GCRegistry::Add< ShadowStackGC > C("shadow-stack", "Very portable GC for uncooperative code generators")
Utilities for dealing with flags related to floating point properties and mode controls.
Declares convenience wrapper classes for interpreting MachineInstr instances as specific generic oper...
const AbstractManglingParser< Derived, Alloc >::OperatorInfo AbstractManglingParser< Derived, Alloc >::Ops[]
MachineRegisterInfo & MRI
Class for arbitrary precision integers.
static APInt getAllOnes(unsigned numBits)
Return an APInt of a specified width with all bits set.
bool isAllOnes() const
Determine if all bits are set. This is true for zero-width values.
static bool isSameValue(const APInt &I1, const APInt &I2, bool SignedCompare=false)
Determine if two APInts have the same value, after zero-extending or sign-extending (if SignedCompare...
static APInt getZero(unsigned numBits)
Get the '0' value for the specified bit-width.
Represent a constant reference to an array (0 or more elements consecutively in memory),...
Predicate
This enumeration lists the possible predicates for CmpInst subclasses.
Predicate getSwappedPredicate() const
For example, EQ->EQ, SLE->SGE, ULT->UGT, OEQ->OEQ, ULE->UGE, OLT->OGT, etc.
ConstantFP - Floating Point Values [float, double].
Represents any generic load, including sign/zero extending variants.
Represents a G_BUILD_VECTOR.
Represents a G_CONCAT_VECTORS.
Represents a call to an intrinsic.
Represents a G_UNMERGE_VALUES.
Representation of each machine instruction.
unsigned getOpcode() const
Returns the opcode of this MachineInstr.
unsigned getNumOperands() const
Retuns the total number of operands.
LLVM_ABI unsigned getNumExplicitDefs() const
Returns the number of non-implicit definitions.
const MachineOperand & getOperand(unsigned i) const
uint32_t getFlags() const
Return the MI flags bitvector.
unsigned getNumDefs() const
Returns the total number of definitions.
A description of a memory reference used in the backend.
MachineOperand class - Representation of each machine instruction operand.
bool isReg() const
isReg - Tests if this is a MO_Register operand.
Register getReg() const
getReg - Returns the register number.
MachineRegisterInfo - Keep track of information for virtual and physical registers,...
Wrapper class representing virtual and physical registers.
operand_type_match m_Reg()
GInstrBind< GConstant > m_GConstant(GConstant *&Inst)
Match a literal G_CONSTANT instruction (no look-through of splats or copies).
SpecificConstantMatch m_SpecificICst(const APInt &RequestedValue)
Matches a constant equal to RequestedValue.
std::optional< ConstT > matchConstantSplat(Register, const MachineRegisterInfo &)
GInstrBind< GBuildVector > m_GBuildVector(GBuildVector *&Inst)
auto m_GAddLike(const LHS &L, const RHS &R)
SrcImmOp_match< SrcTy, AnyImmMatch, TargetOpcode::G_ASSERT_ZEXT > m_GAssertZext(const SrcTy &Src)
Matches a G_ASSERT_ZEXT, binding its source and immediate bit width.
SpecificConstantSplatMatch m_SpecificICstSplat(const APInt &RequestedValue)
Matches a constant splat of RequestedValue.
GCstAndRegMatch m_GCst(std::optional< ValueAndVReg > &ValReg)
UnaryOp_match< SrcTy, TargetOpcode::G_FFLOOR > m_GFFloor(const SrcTy &Src)
LoadOp_match< GLoad, PtrP > m_GLoad(const PtrP &Ptr)
UnaryOp_match< SrcTy, TargetOpcode::COPY > m_Copy(SrcTy &&Src)
MIFlagsRef m_MIFlags(uint32_t &Flags)
operand_type_match m_Pred()
BinaryOp_match< LHS, RHS, TargetOpcode::G_UMIN, true > m_GUMin(const LHS &L, const RHS &R)
UnaryOp_match< SrcTy, TargetOpcode::G_ZEXT > m_GZExt(const SrcTy &Src)
BinaryOp_match< LHS, RHS, TargetOpcode::G_XOR, true > m_GXor(const LHS &L, const RHS &R)
UnaryOp_match< SrcTy, TargetOpcode::G_SEXT > m_GSExt(const SrcTy &Src)
deferred_ty< LLT > m_DeferredType(LLT &Ty)
UnaryOp_match< SrcTy, TargetOpcode::G_FPEXT > m_GFPExt(const SrcTy &Src)
LoadOp_match< GZExtLoad, operand_type_match > m_GZExtLoad(GZExtLoad *&Inst)
LoadOp_match< GSExtLoad, operand_type_match > m_GSExtLoad(GSExtLoad *&Inst)
SpecificConstantMatch m_ZeroInt()
Convenience matchers for specific integer values.
ConstantMatch< APInt > m_ICst(APInt &Cst)
UnaryOp_match< SrcTy, TargetOpcode::G_FSQRT > m_GFSqrt(const SrcTy &Src)
UnaryOp_match< SrcTy, TargetOpcode::G_INTTOPTR > m_GIntToPtr(const SrcTy &Src)
SpecificConstantMatch m_AllOnesInt()
BinaryOp_match< LHS, RHS, TargetOpcode::G_OR, true, MachineInstr::Disjoint > m_GDisjointOr(const LHS &L, const RHS &R)
BinaryOp_match< LHS, RHS, TargetOpcode::G_ADD, true > m_GAdd(const LHS &L, const RHS &R)
auto m_PosZeroFP()
Matches a floating-point positive zero.
BinaryOp_match< LHS, RHS, TargetOpcode::G_OR, true > m_GOr(const LHS &L, const RHS &R)
BinaryOp_match< SpecificConstantMatch, SrcTy, TargetOpcode::G_SUB > m_Neg(const SrcTy &&Src)
Matches a register negated by a G_SUB.
ICstOrSplatMatch< APInt > m_ICstOrSplat(APInt &Cst)
bind_ty< FPClassTest > m_FPClassTest(FPClassTest &T)
ImplicitDefMatch m_GImplicitDef()
GInstrBind< GVScale > m_GVScale(GVScale *&Inst)
OneNonDBGUse_match< SubPat > m_OneNonDBGUse(const SubPat &SP)
SpecificImmMatch m_SpecificImm(int64_t RequestedValue)
Matches an immediate operand equal to RequestedValue.
GInstrBind< GConcatVectors > m_GConcatVectors(GConcatVectors *&Inst)
AllOnesConstantMatch m_AllOnes()
GConstantBitsMatch m_GConstantOrFConstantBits(APInt &Bits)
CheckType m_SpecificType(LLT Ty)
deferred_ty< Register > m_DeferredReg(Register &R)
Similar to m_SpecificReg/Type, but the specific value to match originated from an earlier sub-pattern...
BinaryOp_match< LHS, RHS, TargetOpcode::G_UMAX, true > m_GUMax(const LHS &L, const RHS &R)
BinaryOp_match< SrcTy, SpecificConstantMatch, TargetOpcode::G_XOR, true > m_Not(const SrcTy &&Src)
Matches a register not-ed by a G_XOR.
BinaryOpc_match< LHS, RHS, true > m_CommutativeBinOp(unsigned Opcode, const LHS &L, const RHS &R)
GFCstPredMatch(Pred) -> GFCstPredMatch< Pred >
CompareOp_match< Pred, LHS, RHS, TargetOpcode::G_ICMP > m_GICmp(const Pred &P, const LHS &L, const RHS &R)
BinaryOp_match< LHS, RHS, TargetOpcode::G_FADD, true > m_GFAdd(const LHS &L, const RHS &R)
BindImmMatch m_Imm(int64_t &Imm)
Binds an immediate operand's value.
GInstrBind< GUnmerge > m_GUnmerge(GUnmerge *&Inst)
Instruction binders for ops with no operand-form matcher (constant-immediate or variadic-source ops).
MMORef m_MMO(const MachineMemOperand *&MMO)
CompareOp_match< Pred, LHS, RHS, TargetOpcode::G_FCMP, true > m_c_GFCmp(const Pred &P, const LHS &L, const RHS &R)
G_FCMP matcher that also matches commuted compares.
UnaryOp_match< SrcTy, TargetOpcode::G_PTRTOINT > m_GPtrToInt(const SrcTy &Src)
BinaryOp_match< LHS, RHS, TargetOpcode::G_FSUB, false > m_GFSub(const LHS &L, const RHS &R)
BinaryOp_match< LHS, RHS, TargetOpcode::G_SUB > m_GSub(const LHS &L, const RHS &R)
BinaryOp_match< LHS, RHS, TargetOpcode::G_ASHR, false > m_GAShr(const LHS &L, const RHS &R)
TernaryOp_match< Src0Ty, Src1Ty, Src2Ty, TargetOpcode::G_SELECT > m_GISelect(const Src0Ty &Src0, const Src1Ty &Src1, const Src2Ty &Src2)
bool mi_match(Reg R, const MachineRegisterInfo &MRI, Pattern &&P)
BinaryOp_match< LHS, RHS, TargetOpcode::G_PTR_ADD, false > m_GPtrAdd(const LHS &L, const RHS &R)
SpecificRegisterMatch m_SpecificReg(Register RequestedReg)
Matches a register only if it is equal to RequestedReg.
BinaryOp_match< LHS, RHS, TargetOpcode::G_SHL, false > m_GShl(const LHS &L, const RHS &R)
GFrameIndexMatch m_GFrameIndex(int &FI)
Or< Preds... > m_any_of(Preds &&... preds)
SpecificConstantOrSplatMatch m_SpecificICstOrSplat(const APInt &RequestedValue)
Matches a RequestedValue constant or a constant splat of RequestedValue.
BinaryOp_match< LHS, RHS, TargetOpcode::G_AND, true > m_GAnd(const LHS &L, const RHS &R)
UnaryOp_match< SrcTy, TargetOpcode::G_BITCAST > m_GBitcast(const SrcTy &Src)
BinaryOp_match< LHS, RHS, TargetOpcode::G_BUILD_VECTOR_TRUNC, false > m_GBuildVectorTrunc(const LHS &L, const RHS &R)
bind_ty< MachineInstr * > m_MInstr(MachineInstr *&MI)
UnaryOp_match< SrcTy, TargetOpcode::G_FNEG > m_GFNeg(const SrcTy &Src)
CompareOp_match< Pred, LHS, RHS, TargetOpcode::G_ICMP, true > m_c_GICmp(const Pred &P, const LHS &L, const RHS &R)
G_ICMP matcher that also matches commuted compares.
LoadOp_match< GAnyLoad, PtrP > m_GAnyLoad(const PtrP &Ptr)
GFCstAndRegMatch m_GFCst(std::optional< FPValueAndVReg > &FPValReg)
ClassifyOp_match< LHS, Test, TargetOpcode::G_IS_FPCLASS > m_GIsFPClass(const LHS &L, const Test &T)
Matches the register and immediate used in a fpclass test G_IS_FPCLASS val, 96.
TernaryOp_match< Src0Ty, Src1Ty, Src2Ty, TargetOpcode::G_INSERT_VECTOR_ELT > m_GInsertVecElt(const Src0Ty &Src0, const Src1Ty &Src1, const Src2Ty &Src2)
GFCstOrSplatGFCstMatch m_GFCstOrSplat(std::optional< FPValueAndVReg > &FPValReg)
And< Preds... > m_all_of(Preds &&... preds)
BinaryOp_match< LHS, RHS, TargetOpcode::G_SMIN, true > m_GSMin(const LHS &L, const RHS &R)
UnaryOp_match< SrcTy, TargetOpcode::G_FABS > m_GFabs(const SrcTy &Src)
BinaryOp_match< LHS, RHS, TargetOpcode::G_LSHR, false > m_GLShr(const LHS &L, const RHS &R)
UnaryOp_match< SrcTy, TargetOpcode::G_ANYEXT > m_GAnyExt(const SrcTy &Src)
UnaryOp_match< SrcTy, TargetOpcode::G_FPTRUNC > m_GFPTrunc(const SrcTy &Src)
ShuffleVectorMatch< Src1Ty, Src2Ty > m_GShuffleVector(const Src1Ty &Src1, const Src2Ty &Src2, ArrayRef< int > &Mask)
std::optional< ConstT > matchConstant(Register, const MachineRegisterInfo &)
OneUse_match< SubPat > m_OneUse(const SubPat &SP)
BinaryOp_match< LHS, RHS, TargetOpcode::G_FMUL, true > m_GFMul(const LHS &L, const RHS &R)
BinaryOp_match< LHS, RHS, TargetOpcode::G_MUL, true > m_GMul(const LHS &L, const RHS &R)
UnaryOp_match< SrcTy, TargetOpcode::G_TRUNC > m_GTrunc(const SrcTy &Src)
GInstrBind< GIntrinsic > m_GIntrinsic(GIntrinsic *&Inst)
Binds the defining instruction of Reg if it is a GIntrinsic (any of the four G_INTRINSIC* opcodes).
bind_ty< LLT > m_Type(LLT &Ty)
BinaryOp_match< LHS, RHS, TargetOpcode::G_SMAX, true > m_GSMax(const LHS &L, const RHS &R)
SrcImmOp_match< SrcTy, AnyImmMatch, TargetOpcode::G_SEXT_INREG > m_GSExtInReg(const SrcTy &Src)
Matches a G_SEXT_INREG, binding its source and immediate width.
CompareOp_match< Pred, LHS, RHS, TargetOpcode::G_FCMP > m_GFCmp(const Pred &P, const LHS &L, const RHS &R)
auto m_BinOp()
Match an arbitrary binary operation and ignore it.
This is an optimization pass for GlobalISel generic memory operations.
LLVM_ABI const ConstantFP * getConstantFPVRegVal(Register VReg, const MachineRegisterInfo &MRI)
LLVM_ABI std::optional< APInt > getIConstantVRegVal(Register VReg, const MachineRegisterInfo &MRI)
If VReg is defined by a G_CONSTANT, return the corresponding value.
LLVM_ABI std::optional< APInt > getIConstantSplatVal(const Register Reg, const MachineRegisterInfo &MRI)
decltype(auto) dyn_cast(const From &Val)
dyn_cast<X> - Return the argument parameter cast to the specified type.
@ Load
The value being inserted comes from a load (InsertElement only).
LLVM_ABI std::optional< int64_t > getIConstantVRegSExtVal(Register VReg, const MachineRegisterInfo &MRI)
If VReg is defined by a G_CONSTANT fits in int64_t returns it.
MachineInstr * getImm(const MachineOperand &MO, const MachineRegisterInfo *MRI)
FPClassTest
Floating-point class tests, supported by 'is_fpclass' intrinsic.
LLVM_ABI std::optional< FPValueAndVReg > getFConstantSplat(Register VReg, const MachineRegisterInfo &MRI, bool AllowUndef=true)
Returns a floating point scalar constant of a build vector splat if it exists.
DWARFExpression::Operation Op
LLVM_ABI std::optional< FPValueAndVReg > getFConstantVRegValWithLookThrough(Register VReg, const MachineRegisterInfo &MRI, bool LookThroughInstrs=true)
If VReg is defined by a statically evaluable chain of instructions rooted on a G_FCONSTANT returns it...
LLVM_ABI bool isBuildVectorConstantSplat(const Register Reg, const MachineRegisterInfo &MRI, int64_t SplatValue, bool AllowUndef)
Return true if the specified register is defined by G_BUILD_VECTOR or G_BUILD_VECTOR_TRUNC where all ...
LLVM_ABI std::optional< ValueAndVReg > getIConstantVRegValWithLookThrough(Register VReg, const MachineRegisterInfo &MRI, bool LookThroughInstrs=true)
If VReg is defined by a statically evaluable chain of instructions rooted on a G_CONSTANT returns its...
LLVM_ABI std::optional< int64_t > getIConstantSplatSExtVal(const Register Reg, const MachineRegisterInfo &MRI)
Implement std::hash so that hash_code can be used in STL containers.
Matches an integer constant with all bits set, regardless of width.
bool match(const MachineRegisterInfo &MRI, Register Reg)
And(Pred &&p, Preds &&... preds)
bool match(const MachineRegisterInfo &MRI, MatchSrc &&src)
bool match(const MachineRegisterInfo &MRI, MatchSrc &&src)
Matches any immediate operand.
bool match(int64_t) const
BinaryOp_match(const LHS_P &LHS, const RHS_P &RHS)
BinaryOp_match(const LHS_P &LHS, const RHS_P &RHS, MIFlagsRef FlagsOut)
bool match(const MachineRegisterInfo &MRI, OpTy &&Op)
bool match(const MachineRegisterInfo &MRI, OpTy &&Op)
BinaryOpc_match(unsigned Opcode, const LHS_P &LHS, const RHS_P &RHS)
BindImmMatch(int64_t &ImmOut)
bool match(int64_t Imm) const
bool match(const MachineRegisterInfo &MRI, Register Reg)
ClassifyOp_match(const LHS_P &LHS, const Test_P &Tst)
bool match(const MachineRegisterInfo &MRI, OpTy &&Op)
CompareOp_match(const Pred_P &Pred, const LHS_P &LHS, const RHS_P &RHS)
bool match(const MachineRegisterInfo &MRI, OpTy &&Op)
bool match(const MachineRegisterInfo &MRI, Register Reg)
Match a literal G_CONSTANT or G_FCONSTANT, binding its raw bits to Bits (the integer value,...
bool match(const MachineRegisterInfo &MRI, Register Reg)
bool match(const MachineRegisterInfo &MRI, Register Reg)
GCstAndRegMatch(std::optional< ValueAndVReg > &ValReg)
std::optional< ValueAndVReg > & ValReg
GFCstAndRegMatch(std::optional< FPValueAndVReg > &FPValReg)
std::optional< FPValueAndVReg > & FPValReg
bool match(const MachineRegisterInfo &MRI, Register Reg)
GFCstOrSplatGFCstMatch(std::optional< FPValueAndVReg > &FPValReg)
bool match(const MachineRegisterInfo &MRI, Register Reg)
std::optional< FPValueAndVReg > & FPValReg
Matches an FP constant whose value satisfies the given predicate.
bool match(const MachineRegisterInfo &MRI, Register Reg)
Matches a G_FRAME_INDEX, binding its frame index.
bool match(const MachineRegisterInfo &MRI, Register Reg)
Binds the defining instruction of Reg if it is a Class.
bool match(const MachineRegisterInfo &MRI, Register Reg)
Matches a GIntrinsic with a specific intrinsic ID and optionally, matchers for its leading arguments.
bool match(const MachineRegisterInfo &MRI, OpTy &&Op)
GIntrinsic_match(const OpMatchers &...Ops)
std::tuple< OpMatchers... > Operands
ICstOrSplatMatch(ConstT &C)
bool match(const MachineRegisterInfo &MRI, Register Reg)
bool match(const MachineRegisterInfo &MRI, Register Reg)
Match a load of type Class, matching its pointer operand and optionally binding the instruction and/o...
LoadOp_match(Class *&Inst, const PtrP &Ptr, MMORef MMO)
LoadOp_match(const PtrP &Ptr)
const MachineMemOperand ** MMOOut
bool match(const MachineRegisterInfo &MRI, OpTy &&Op)
LoadOp_match(const PtrP &Ptr, MMORef MMO)
LoadOp_match(Class *&Inst, const PtrP &Ptr)
Wraps a MIFlags output for use as an optional trailing operand of an instruction matcher (e....
Optional trailing operand for a load matcher (e.g.
const MachineMemOperand *& MMO
OneNonDBGUse_match(const SubPatternT &SP)
bool match(const MachineRegisterInfo &MRI, Register Reg)
OneUse_match(const SubPatternT &SP)
bool match(const MachineRegisterInfo &MRI, Register Reg)
Or(Pred &&p, Preds &&... preds)
bool match(const MachineRegisterInfo &MRI, MatchSrc &&src)
bool match(const MachineRegisterInfo &MRI, MatchSrc &&src)
Matches a G_SHUFFLE_VECTOR, binding its two source operands and its mask.
bool match(const MachineRegisterInfo &MRI, Register Reg)
ShuffleVectorMatch(const Src1Ty &Src1, const Src2Ty &Src2, ArrayRef< int > &Mask)
Matcher for a specific constant value.
SpecificConstantMatch(const APInt &RequestedVal)
bool match(const MachineRegisterInfo &MRI, Register Reg)
Matcher for a specific constant or constant splat.
bool match(const MachineRegisterInfo &MRI, Register Reg)
SpecificConstantOrSplatMatch(const APInt &RequestedVal)
Matcher for a specific constant splat.
SpecificConstantSplatMatch(const APInt &RequestedVal)
bool match(const MachineRegisterInfo &MRI, Register Reg)
bool match(int64_t Imm) const
SpecificImmMatch(int64_t RequestedVal)
Matcher for a specific register.
bool match(const MachineRegisterInfo &MRI, Register Reg)
SpecificRegisterMatch(Register RequestedReg)
Matches an op that binds a source operand and an immediate operand with sub-matchers (e....
SrcImmOp_match(const SrcTy &LHS, const ImmTy &Imm)
bool match(const MachineRegisterInfo &MRI, OpTy &&Op)
bool match(const MachineRegisterInfo &MRI, OpTy &&Op)
TernaryOp_match(const Src0Ty &Src0, const Src1Ty &Src1, const Src2Ty &Src2)
bool match(const MachineRegisterInfo &MRI, OpTy &&Op)
UnaryOp_match(const SrcTy &LHS)
static bool bind(const MachineRegisterInfo &MRI, LLT &Ty, Register Reg)
static bool bind(const MachineRegisterInfo &MRI, MachineInstr *&MI, Register Reg)
static bool bind(const MachineRegisterInfo &MRI, MachineInstr *&MI, MachineInstr *Inst)
static bool bind(const MachineRegisterInfo &MRI, const ConstantFP *&F, Register Reg)
static bool bind(const MachineRegisterInfo &MRI, const MachineInstr *&MI, Register Reg)
static bool bind(const MachineRegisterInfo &MRI, const MachineInstr *&MI, const MachineInstr *Inst)
static bool bind(const MachineRegisterInfo &MRI, BindTy &VR, BindTy &V)
bool match(const MachineRegisterInfo &MRI, ITy &&V)
static bool match(const MachineRegisterInfo &MRI, LLT VT, Register R)
static bool match(const MachineRegisterInfo &MRI, BindTy &VR, BindTy &V)
bool match(const MachineRegisterInfo &MRI, ITy &&V)
bool match(const MachineRegisterInfo &MRI, MachineOperand *MO)
bool match(const MachineRegisterInfo &MRI, Register Reg)