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>
38 return P.match(MRI, &
MI);
41template <
typename Pattern>
44 return P.match(MRI, &
MI);
57template <
typename SubPat>
71template <
typename SubPat>
76template <
typename ConstT>
111template <
typename ConstT>
122inline std::optional<int64_t>
201 return P(FPImm->getValueAPF());
292 APInt(64, RequestedValue,
true));
326 APInt(64, RequestedValue,
true));
366template <
typename... Preds>
struct And {
367 template <
typename MatchSrc>
373template <
typename Pred,
typename... Preds>
374struct And<Pred, Preds...> :
And<Preds...> {
376 And(Pred &&p, Preds &&... preds)
377 :
And<Preds...>(
std::forward<Preds>(preds)...),
P(
std::forward<Pred>(p)) {
379 template <
typename MatchSrc>
385template <
typename... Preds>
struct Or {
386 template <
typename MatchSrc>
392template <
typename Pred,
typename... Preds>
393struct Or<Pred, Preds...> :
Or<Preds...> {
395 Or(Pred &&p, Preds &&... preds)
396 :
Or<Preds...>(
std::forward<Preds>(preds)...),
P(
std::forward<Pred>(p)) {}
397 template <
typename MatchSrc>
403template <
typename... Preds>
And<Preds...>
m_all_of(Preds &&... preds) {
404 return And<Preds...>(std::forward<Preds>(preds)...);
407template <
typename... Preds>
Or<Preds...>
m_any_of(Preds &&... preds) {
408 return Or<Preds...>(std::forward<Preds>(preds)...);
536 return TmpMI->
getOpcode() == TargetOpcode::G_IMPLICIT_DEF;
574 if (
MI->getOpcode() == TargetOpcode::G_CONSTANT) {
575 Bits =
MI->getOperand(1).getCImm()->getValue();
578 if (
MI->getOpcode() == TargetOpcode::G_FCONSTANT) {
579 Bits =
MI->getOperand(1).getFPImm()->getValueAPF().bitcastToAPInt();
608 if (!
Load || !
Ptr.match(MRI,
Load->getPointerReg()))
618template <
typename PtrP>
622template <
typename PtrP>
627template <
typename PtrP>
632template <
typename PtrP>
636template <
typename PtrP>
667 template <
typename OpTy>
673 if (!GI || !GI->is(IntrID))
675 return matchOperands(MRI, *GI, std::index_sequence_for<OpMatchers...>{});
679 template <
size_t... Is>
681 std::index_sequence<Is...>) {
691inline GIntrinsic_match<IntrID, OpMatchers...>
710 if (!Shuf || !
Src1.match(MRI, Shuf->getSrc1Reg()) ||
711 !
Src2.match(MRI, Shuf->getSrc2Reg()))
713 Mask = Shuf->getMask();
718template <
typename Src1Ty,
typename Src2Ty>
730 TmpMI->
getOpcode() == TargetOpcode::G_FRAME_INDEX) {
744template <
typename LHS_P,
typename RHS_P,
unsigned Opcode,
755 template <
typename OpTy>
770 if ((TmpMI->
getFlags() & Flags) != Flags)
782template <
typename LHS_P,
typename RHS_P,
bool Commutable = false>
790 template <
typename OpTy>
811template <
typename LHS,
typename RHS>
817template <
typename LHS,
typename RHS>
823template <
typename LHS,
typename RHS>
829template <
typename LHS,
typename RHS>
835template <
typename LHS,
typename RHS>
842template <
typename LHS,
typename RHS>
848template <
typename LHS,
typename RHS>
854template <
typename LHS,
typename RHS>
860template <
typename LHS,
typename RHS>
866template <
typename LHS,
typename RHS>
872template <
typename LHS,
typename RHS>
878template <
typename LHS,
typename RHS>
884template <
typename LHS,
typename RHS>
890template <
typename LHS,
typename RHS>
896template <
typename LHS,
typename RHS>
902template <
typename LHS,
typename RHS>
908template <
typename LHS,
typename RHS>
916template <
typename LHS,
typename RHS>
921template <
typename LHS,
typename RHS>
927template <
typename LHS,
typename RHS>
933template <
typename LHS,
typename RHS>
939template <
typename LHS,
typename RHS>
945template <
typename LHS,
typename RHS>
951template <
typename LHS,
typename RHS>
957template <
typename LHS,
typename RHS>
968 template <
typename OpTy>
980template <
typename SrcTy>
986template <
typename SrcTy>
991template <
typename SrcTy>
996template <
typename SrcTy>
1001template <
typename SrcTy>
1006template <
typename SrcTy>
1012template <
typename SrcTy>
1018template <
typename SrcTy>
1024template <
typename SrcTy>
1032template <
typename SrcTy,
typename ImmTy,
unsigned Opcode>
1038 template <
typename OpTy>
1049 bool match(int64_t)
const {
return true; }
1053template <
typename SrcTy>
1059template <
typename SrcTy,
typename ImmTy>
1066template <
typename SrcTy>
1072template <
typename SrcTy,
typename ImmTy>
1078template <
typename SrcTy>
1083template <
typename SrcTy>
1088template <
typename SrcTy>
1093template <
typename SrcTy>
1098template <
typename SrcTy>
1106template <
typename Pred_P,
typename LHS_P,
typename RHS_P,
unsigned Opcode,
1107 bool Commutable =
false>
1116 template <
typename OpTy>
1124 if (!
P.match(MRI, TmpPred))
1128 if (
L.match(MRI,
LHS) &&
R.match(MRI,
RHS))
1134 if (Commutable &&
L.match(MRI,
RHS) &&
R.match(MRI,
LHS) &&
1141template <
typename LHS_P,
typename Test_P,
unsigned Opcode>
1148 template <
typename OpTy>
1155 if (!
L.match(MRI,
LHS))
1160 if (
T.match(MRI, TmpClass))
1167template <
typename Pred,
typename LHS,
typename RHS>
1173template <
typename Pred,
typename LHS,
typename RHS>
1188template <
typename Pred,
typename LHS,
typename RHS>
1203template <
typename Pred,
typename LHS,
typename RHS>
1211template <
typename LHS,
typename Test>
1229template <
typename Src0Ty,
typename Src1Ty,
typename Src2Ty,
unsigned Opcode>
1237 template <
typename OpTy>
1250template <
typename Src0Ty,
typename Src1Ty,
typename Src2Ty>
1252 TargetOpcode::G_INSERT_VECTOR_ELT>
1255 TargetOpcode::G_INSERT_VECTOR_ELT>(Src0, Src1, Src2);
1258template <
typename Src0Ty,
typename Src1Ty,
typename Src2Ty>
1260m_GISelect(
const Src0Ty &Src0,
const Src1Ty &Src1,
const Src2Ty &Src2) {
1267template <
typename SrcTy>
1275template <
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[]
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.
unsigned getBitWidth() const
Return the number of bits in the APInt.
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...
LLVM_ABI APInt sext(unsigned width) const
Sign extend to a new width.
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,...
LLVM_ABI bool hasOneNonDBGUse(Register RegNo) const
hasOneNonDBGUse - Return true if there is exactly one non-Debug use of the specified register.
LLVM_ABI LLVM_READONLY MachineInstr * getVRegDef(Register Reg) const
getVRegDef - Return the machine instr that defines the specified virtual register or null if none is ...
LLT getType(Register Reg) const
Get the low-level type of Reg or LLT{} if Reg is not a generic (target independent) virtual register.
bool hasOneUse(Register RegNo) const
hasOneUse - Return true if there is exactly one instruction using the specified register.
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)
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, binding its pointer operand (like IR's m_Load), and optionally the instru...
LoadOp_match(Class *&Inst, const PtrP &Ptr, MMORef MMO)
bool match(const MachineRegisterInfo &MRI, Register Reg)
LoadOp_match(const PtrP &Ptr)
const MachineMemOperand ** MMOOut
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)