LLVM 22.0.0git
MIPatternMatch.h File Reference

Contains matchers for matching SSA Machine Instructions. More...

Go to the source code of this file.

Classes

struct  llvm::MIPatternMatch::OneUse_match< SubPatternT >
struct  llvm::MIPatternMatch::OneNonDBGUse_match< SubPatternT >
struct  llvm::MIPatternMatch::ConstantMatch< ConstT >
struct  llvm::MIPatternMatch::ICstOrSplatMatch< ConstT >
struct  llvm::MIPatternMatch::GCstAndRegMatch
struct  llvm::MIPatternMatch::GFCstAndRegMatch
struct  llvm::MIPatternMatch::GFCstOrSplatGFCstMatch
struct  llvm::MIPatternMatch::SpecificConstantMatch
 Matcher for a specific constant value. More...
struct  llvm::MIPatternMatch::SpecificConstantSplatMatch
 Matcher for a specific constant splat. More...
struct  llvm::MIPatternMatch::SpecificConstantOrSplatMatch
 Matcher for a specific constant or constant splat. More...
struct  llvm::MIPatternMatch::SpecificRegisterMatch
 Matcher for a specific register. More...
struct  llvm::MIPatternMatch::operand_type_match
struct  llvm::MIPatternMatch::And< Preds >
 Matching combinators. More...
struct  llvm::MIPatternMatch::And< Pred, Preds... >
struct  llvm::MIPatternMatch::Or< Preds >
struct  llvm::MIPatternMatch::Or< Pred, Preds... >
struct  llvm::MIPatternMatch::bind_helper< BindTy >
struct  llvm::MIPatternMatch::bind_helper< MachineInstr * >
struct  llvm::MIPatternMatch::bind_helper< const MachineInstr * >
struct  llvm::MIPatternMatch::bind_helper< LLT >
struct  llvm::MIPatternMatch::bind_helper< const ConstantFP * >
struct  llvm::MIPatternMatch::bind_ty< Class >
struct  llvm::MIPatternMatch::deferred_helper< BindTy >
struct  llvm::MIPatternMatch::deferred_helper< LLT >
struct  llvm::MIPatternMatch::deferred_ty< Class >
struct  llvm::MIPatternMatch::ImplicitDefMatch
struct  llvm::MIPatternMatch::BinaryOp_match< LHS_P, RHS_P, Opcode, Commutable, Flags >
struct  llvm::MIPatternMatch::BinaryOpc_match< LHS_P, RHS_P, Commutable >
struct  llvm::MIPatternMatch::UnaryOp_match< SrcTy, Opcode >
struct  llvm::MIPatternMatch::CompareOp_match< Pred_P, LHS_P, RHS_P, Opcode, Commutable >
struct  llvm::MIPatternMatch::ClassifyOp_match< LHS_P, Test_P, Opcode >
struct  llvm::MIPatternMatch::CheckType
struct  llvm::MIPatternMatch::TernaryOp_match< Src0Ty, Src1Ty, Src2Ty, Opcode >

Namespaces

namespace  llvm
 This is an optimization pass for GlobalISel generic memory operations.
namespace  llvm::MIPatternMatch

Functions

template<typename Reg, typename Pattern>
bool llvm::MIPatternMatch::mi_match (Reg R, const MachineRegisterInfo &MRI, Pattern &&P)
template<typename Pattern>
bool llvm::MIPatternMatch::mi_match (MachineInstr &MI, const MachineRegisterInfo &MRI, Pattern &&P)
template<typename Pattern>
bool llvm::MIPatternMatch::mi_match (const MachineInstr &MI, const MachineRegisterInfo &MRI, Pattern &&P)
template<typename SubPat>
OneUse_match< SubPat > llvm::MIPatternMatch::m_OneUse (const SubPat &SP)
template<typename SubPat>
OneNonDBGUse_match< SubPat > llvm::MIPatternMatch::m_OneNonDBGUse (const SubPat &SP)
template<typename ConstT>
std::optional< ConstT > llvm::MIPatternMatch::matchConstant (Register, const MachineRegisterInfo &)
template<>
std::optional< APIntllvm::MIPatternMatch::matchConstant (Register Reg, const MachineRegisterInfo &MRI)
template<>
std::optional< int64_t > llvm::MIPatternMatch::matchConstant (Register Reg, const MachineRegisterInfo &MRI)
ConstantMatch< APIntllvm::MIPatternMatch::m_ICst (APInt &Cst)
ConstantMatch< int64_t > llvm::MIPatternMatch::m_ICst (int64_t &Cst)
template<typename ConstT>
std::optional< ConstT > llvm::MIPatternMatch::matchConstantSplat (Register, const MachineRegisterInfo &)
template<>
std::optional< APIntllvm::MIPatternMatch::matchConstantSplat (Register Reg, const MachineRegisterInfo &MRI)
template<>
std::optional< int64_t > llvm::MIPatternMatch::matchConstantSplat (Register Reg, const MachineRegisterInfo &MRI)
ICstOrSplatMatch< APIntllvm::MIPatternMatch::m_ICstOrSplat (APInt &Cst)
ICstOrSplatMatch< int64_t > llvm::MIPatternMatch::m_ICstOrSplat (int64_t &Cst)
GCstAndRegMatch llvm::MIPatternMatch::m_GCst (std::optional< ValueAndVReg > &ValReg)
GFCstAndRegMatch llvm::MIPatternMatch::m_GFCst (std::optional< FPValueAndVReg > &FPValReg)
GFCstOrSplatGFCstMatch llvm::MIPatternMatch::m_GFCstOrSplat (std::optional< FPValueAndVReg > &FPValReg)
SpecificConstantMatch llvm::MIPatternMatch::m_SpecificICst (APInt RequestedValue)
 Matches a constant equal to RequestedValue.
SpecificConstantMatch llvm::MIPatternMatch::m_SpecificICst (int64_t RequestedValue)
SpecificConstantSplatMatch llvm::MIPatternMatch::m_SpecificICstSplat (APInt RequestedValue)
 Matches a constant splat of RequestedValue.
SpecificConstantSplatMatch llvm::MIPatternMatch::m_SpecificICstSplat (int64_t RequestedValue)
SpecificConstantOrSplatMatch llvm::MIPatternMatch::m_SpecificICstOrSplat (APInt RequestedValue)
 Matches a RequestedValue constant or a constant splat of RequestedValue.
SpecificConstantOrSplatMatch llvm::MIPatternMatch::m_SpecificICstOrSplat (int64_t RequestedValue)
SpecificConstantMatch llvm::MIPatternMatch::m_ZeroInt ()
 Convenience matchers for specific integer values.
SpecificConstantMatch llvm::MIPatternMatch::m_AllOnesInt ()
SpecificRegisterMatch llvm::MIPatternMatch::m_SpecificReg (Register RequestedReg)
 Matches a register only if it is equal to RequestedReg.
operand_type_match llvm::MIPatternMatch::m_Reg ()
template<typename... Preds>
And< Preds... > llvm::MIPatternMatch::m_all_of (Preds &&... preds)
template<typename... Preds>
Or< Preds... > llvm::MIPatternMatch::m_any_of (Preds &&... preds)
bind_ty< Registerllvm::MIPatternMatch::m_Reg (Register &R)
bind_ty< MachineInstr * > llvm::MIPatternMatch::m_MInstr (MachineInstr *&MI)
bind_ty< const MachineInstr * > llvm::MIPatternMatch::m_MInstr (const MachineInstr *&MI)
bind_ty< LLTllvm::MIPatternMatch::m_Type (LLT &Ty)
bind_ty< CmpInst::Predicatellvm::MIPatternMatch::m_Pred (CmpInst::Predicate &P)
operand_type_match llvm::MIPatternMatch::m_Pred ()
bind_ty< FPClassTestllvm::MIPatternMatch::m_FPClassTest (FPClassTest &T)
deferred_ty< Registerllvm::MIPatternMatch::m_DeferredReg (Register &R)
 Similar to m_SpecificReg/Type, but the specific value to match originated from an earlier sub-pattern in the same mi_match expression.
deferred_ty< LLTllvm::MIPatternMatch::m_DeferredType (LLT &Ty)
ImplicitDefMatch llvm::MIPatternMatch::m_GImplicitDef ()
bind_ty< const ConstantFP * > llvm::MIPatternMatch::m_GFCst (const ConstantFP *&C)
template<typename LHS, typename RHS>
BinaryOpc_match< LHS, RHS, false > llvm::MIPatternMatch::m_BinOp (unsigned Opcode, const LHS &L, const RHS &R)
template<typename LHS, typename RHS>
BinaryOpc_match< LHS, RHS, true > llvm::MIPatternMatch::m_CommutativeBinOp (unsigned Opcode, const LHS &L, const RHS &R)
template<typename LHS, typename RHS>
BinaryOp_match< LHS, RHS, TargetOpcode::G_ADD, true > llvm::MIPatternMatch::m_GAdd (const LHS &L, const RHS &R)
template<typename LHS, typename RHS>
BinaryOp_match< LHS, RHS, TargetOpcode::G_BUILD_VECTOR, false > llvm::MIPatternMatch::m_GBuildVector (const LHS &L, const RHS &R)
template<typename LHS, typename RHS>
BinaryOp_match< LHS, RHS, TargetOpcode::G_BUILD_VECTOR_TRUNC, false > llvm::MIPatternMatch::m_GBuildVectorTrunc (const LHS &L, const RHS &R)
template<typename LHS, typename RHS>
BinaryOp_match< LHS, RHS, TargetOpcode::G_PTR_ADD, false > llvm::MIPatternMatch::m_GPtrAdd (const LHS &L, const RHS &R)
template<typename LHS, typename RHS>
BinaryOp_match< LHS, RHS, TargetOpcode::G_SUB > llvm::MIPatternMatch::m_GSub (const LHS &L, const RHS &R)
template<typename LHS, typename RHS>
BinaryOp_match< LHS, RHS, TargetOpcode::G_MUL, true > llvm::MIPatternMatch::m_GMul (const LHS &L, const RHS &R)
template<typename LHS, typename RHS>
BinaryOp_match< LHS, RHS, TargetOpcode::G_FADD, true > llvm::MIPatternMatch::m_GFAdd (const LHS &L, const RHS &R)
template<typename LHS, typename RHS>
BinaryOp_match< LHS, RHS, TargetOpcode::G_FMUL, true > llvm::MIPatternMatch::m_GFMul (const LHS &L, const RHS &R)
template<typename LHS, typename RHS>
BinaryOp_match< LHS, RHS, TargetOpcode::G_FSUB, false > llvm::MIPatternMatch::m_GFSub (const LHS &L, const RHS &R)
template<typename LHS, typename RHS>
BinaryOp_match< LHS, RHS, TargetOpcode::G_AND, true > llvm::MIPatternMatch::m_GAnd (const LHS &L, const RHS &R)
template<typename LHS, typename RHS>
BinaryOp_match< LHS, RHS, TargetOpcode::G_XOR, true > llvm::MIPatternMatch::m_GXor (const LHS &L, const RHS &R)
template<typename LHS, typename RHS>
BinaryOp_match< LHS, RHS, TargetOpcode::G_OR, true > llvm::MIPatternMatch::m_GOr (const LHS &L, const RHS &R)
template<typename LHS, typename RHS>
BinaryOp_match< LHS, RHS, TargetOpcode::G_OR, true, MachineInstr::Disjointllvm::MIPatternMatch::m_GDisjointOr (const LHS &L, const RHS &R)
template<typename LHS, typename RHS>
auto llvm::MIPatternMatch::m_GAddLike (const LHS &L, const RHS &R)
template<typename LHS, typename RHS>
BinaryOp_match< LHS, RHS, TargetOpcode::G_SHL, false > llvm::MIPatternMatch::m_GShl (const LHS &L, const RHS &R)
template<typename LHS, typename RHS>
BinaryOp_match< LHS, RHS, TargetOpcode::G_LSHR, false > llvm::MIPatternMatch::m_GLShr (const LHS &L, const RHS &R)
template<typename LHS, typename RHS>
BinaryOp_match< LHS, RHS, TargetOpcode::G_ASHR, false > llvm::MIPatternMatch::m_GAShr (const LHS &L, const RHS &R)
template<typename LHS, typename RHS>
BinaryOp_match< LHS, RHS, TargetOpcode::G_SMAX, true > llvm::MIPatternMatch::m_GSMax (const LHS &L, const RHS &R)
template<typename LHS, typename RHS>
BinaryOp_match< LHS, RHS, TargetOpcode::G_SMIN, true > llvm::MIPatternMatch::m_GSMin (const LHS &L, const RHS &R)
template<typename LHS, typename RHS>
BinaryOp_match< LHS, RHS, TargetOpcode::G_UMAX, true > llvm::MIPatternMatch::m_GUMax (const LHS &L, const RHS &R)
template<typename LHS, typename RHS>
BinaryOp_match< LHS, RHS, TargetOpcode::G_UMIN, true > llvm::MIPatternMatch::m_GUMin (const LHS &L, const RHS &R)
template<typename SrcTy>
UnaryOp_match< SrcTy, TargetOpcode::G_ANYEXT > llvm::MIPatternMatch::m_GAnyExt (const SrcTy &Src)
template<typename SrcTy>
UnaryOp_match< SrcTy, TargetOpcode::G_SEXT > llvm::MIPatternMatch::m_GSExt (const SrcTy &Src)
template<typename SrcTy>
UnaryOp_match< SrcTy, TargetOpcode::G_ZEXT > llvm::MIPatternMatch::m_GZExt (const SrcTy &Src)
template<typename SrcTy>
UnaryOp_match< SrcTy, TargetOpcode::G_FPEXT > llvm::MIPatternMatch::m_GFPExt (const SrcTy &Src)
template<typename SrcTy>
UnaryOp_match< SrcTy, TargetOpcode::G_TRUNC > llvm::MIPatternMatch::m_GTrunc (const SrcTy &Src)
template<typename SrcTy>
UnaryOp_match< SrcTy, TargetOpcode::G_BITCAST > llvm::MIPatternMatch::m_GBitcast (const SrcTy &Src)
template<typename SrcTy>
UnaryOp_match< SrcTy, TargetOpcode::G_PTRTOINT > llvm::MIPatternMatch::m_GPtrToInt (const SrcTy &Src)
template<typename SrcTy>
UnaryOp_match< SrcTy, TargetOpcode::G_INTTOPTR > llvm::MIPatternMatch::m_GIntToPtr (const SrcTy &Src)
template<typename SrcTy>
UnaryOp_match< SrcTy, TargetOpcode::G_FPTRUNC > llvm::MIPatternMatch::m_GFPTrunc (const SrcTy &Src)
template<typename SrcTy>
UnaryOp_match< SrcTy, TargetOpcode::G_FABS > llvm::MIPatternMatch::m_GFabs (const SrcTy &Src)
template<typename SrcTy>
UnaryOp_match< SrcTy, TargetOpcode::G_FNEG > llvm::MIPatternMatch::m_GFNeg (const SrcTy &Src)
template<typename SrcTy>
UnaryOp_match< SrcTy, TargetOpcode::COPY > llvm::MIPatternMatch::m_Copy (SrcTy &&Src)
template<typename SrcTy>
UnaryOp_match< SrcTy, TargetOpcode::G_FSQRT > llvm::MIPatternMatch::m_GFSqrt (const SrcTy &Src)
template<typename Pred, typename LHS, typename RHS>
CompareOp_match< Pred, LHS, RHS, TargetOpcode::G_ICMP > llvm::MIPatternMatch::m_GICmp (const Pred &P, const LHS &L, const RHS &R)
template<typename Pred, typename LHS, typename RHS>
CompareOp_match< Pred, LHS, RHS, TargetOpcode::G_FCMP > llvm::MIPatternMatch::m_GFCmp (const Pred &P, const LHS &L, const RHS &R)
template<typename Pred, typename LHS, typename RHS>
CompareOp_match< Pred, LHS, RHS, TargetOpcode::G_ICMP, true > llvm::MIPatternMatch::m_c_GICmp (const Pred &P, const LHS &L, const RHS &R)
 G_ICMP matcher that also matches commuted compares.
template<typename Pred, typename LHS, typename RHS>
CompareOp_match< Pred, LHS, RHS, TargetOpcode::G_FCMP, true > llvm::MIPatternMatch::m_c_GFCmp (const Pred &P, const LHS &L, const RHS &R)
 G_FCMP matcher that also matches commuted compares.
template<typename LHS, typename Test>
ClassifyOp_match< LHS, Test, TargetOpcode::G_IS_FPCLASS > llvm::MIPatternMatch::m_GIsFPClass (const LHS &L, const Test &T)
 Matches the register and immediate used in a fpclass test G_IS_FPCLASS val, 96.
CheckType llvm::MIPatternMatch::m_SpecificType (LLT Ty)
template<typename Src0Ty, typename Src1Ty, typename Src2Ty>
TernaryOp_match< Src0Ty, Src1Ty, Src2Ty, TargetOpcode::G_INSERT_VECTOR_ELT > llvm::MIPatternMatch::m_GInsertVecElt (const Src0Ty &Src0, const Src1Ty &Src1, const Src2Ty &Src2)
template<typename Src0Ty, typename Src1Ty, typename Src2Ty>
TernaryOp_match< Src0Ty, Src1Ty, Src2Ty, TargetOpcode::G_SELECT > llvm::MIPatternMatch::m_GISelect (const Src0Ty &Src0, const Src1Ty &Src1, const Src2Ty &Src2)
template<typename SrcTy>
BinaryOp_match< SpecificConstantMatch, SrcTy, TargetOpcode::G_SUB > llvm::MIPatternMatch::m_Neg (const SrcTy &&Src)
 Matches a register negated by a G_SUB.
template<typename SrcTy>
BinaryOp_match< SrcTy, SpecificConstantMatch, TargetOpcode::G_XOR, true > llvm::MIPatternMatch::m_Not (const SrcTy &&Src)
 Matches a register not-ed by a G_XOR.

Detailed Description

Contains matchers for matching SSA Machine Instructions.

Definition in file MIPatternMatch.h.