LLVM 20.0.0git
Classes | Namespaces | Functions
MIPatternMatch.h File Reference

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

#include "llvm/ADT/APInt.h"
#include "llvm/CodeGen/GlobalISel/Utils.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
#include "llvm/IR/InstrTypes.h"

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
 } 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< LLT >
 
struct  llvm::MIPatternMatch::bind_helper< const ConstantFP * >
 
struct  llvm::MIPatternMatch::bind_ty< Class >
 
struct  llvm::MIPatternMatch::ImplicitDefMatch
 
struct  llvm::MIPatternMatch::BinaryOp_match< LHS_P, RHS_P, Opcode, Commutable >
 
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::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 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< APInt > llvm::MIPatternMatch::matchConstant (Register Reg, const MachineRegisterInfo &MRI)
 
template<>
std::optional< int64_t > llvm::MIPatternMatch::matchConstant (Register Reg, const MachineRegisterInfo &MRI)
 
ConstantMatch< APInt > llvm::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< APInt > llvm::MIPatternMatch::matchConstantSplat (Register Reg, const MachineRegisterInfo &MRI)
 
template<>
std::optional< int64_t > llvm::MIPatternMatch::matchConstantSplat (Register Reg, const MachineRegisterInfo &MRI)
 
ICstOrSplatMatch< APInt > llvm::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 (int64_t RequestedValue)
 Matches a constant equal to RequestedValue.
 
SpecificConstantSplatMatch llvm::MIPatternMatch::m_SpecificICstSplat (int64_t RequestedValue)
 Matches a constant splat of RequestedValue.
 
SpecificConstantOrSplatMatch llvm::MIPatternMatch::m_SpecificICstOrSplat (int64_t RequestedValue)
 Matches a RequestedValue constant or a constant splat of 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< LLT > llvm::MIPatternMatch::m_Type (LLT Ty)
 
bind_ty< CmpInst::Predicate > llvm::MIPatternMatch::m_Pred (CmpInst::Predicate &P)
 
operand_type_match llvm::MIPatternMatch::m_Pred ()
 
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, truellvm::MIPatternMatch::m_CommutativeBinOp (unsigned Opcode, const LHS &L, const RHS &R)
 
template<typename LHS , typename RHS >
BinaryOp_match< LHS, RHS, TargetOpcode::G_ADD, truellvm::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, truellvm::MIPatternMatch::m_GMul (const LHS &L, const RHS &R)
 
template<typename LHS , typename RHS >
BinaryOp_match< LHS, RHS, TargetOpcode::G_FADD, truellvm::MIPatternMatch::m_GFAdd (const LHS &L, const RHS &R)
 
template<typename LHS , typename RHS >
BinaryOp_match< LHS, RHS, TargetOpcode::G_FMUL, truellvm::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, truellvm::MIPatternMatch::m_GAnd (const LHS &L, const RHS &R)
 
template<typename LHS , typename RHS >
BinaryOp_match< LHS, RHS, TargetOpcode::G_XOR, truellvm::MIPatternMatch::m_GXor (const LHS &L, const RHS &R)
 
template<typename LHS , typename RHS >
BinaryOp_match< LHS, RHS, TargetOpcode::G_OR, truellvm::MIPatternMatch::m_GOr (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, false > llvm::MIPatternMatch::m_GSMax (const LHS &L, const RHS &R)
 
template<typename LHS , typename RHS >
BinaryOp_match< LHS, RHS, TargetOpcode::G_SMIN, false > llvm::MIPatternMatch::m_GSMin (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, truellvm::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, truellvm::MIPatternMatch::m_c_GFCmp (const Pred &P, const LHS &L, const RHS &R)
 G_FCMP matcher that also matches commuted compares.
 
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, truellvm::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.