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

Contains matchers for matching SelectionDAG nodes and values. More...

#include "llvm/ADT/APInt.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/CodeGen/SelectionDAG.h"
#include "llvm/CodeGen/SelectionDAGNodes.h"
#include "llvm/CodeGen/TargetLowering.h"

Go to the source code of this file.

Classes

class  llvm::SDPatternMatch::BasicMatchContext
 MatchContext can repurpose existing patterns to behave differently under a certain context. More...
 
struct  llvm::SDPatternMatch::Value_match
 
struct  llvm::SDPatternMatch::DeferredValue_match
 
struct  llvm::SDPatternMatch::Opcode_match
 
struct  llvm::SDPatternMatch::NUses_match< NumUses, Pattern >
 
struct  llvm::SDPatternMatch::Value_bind
 
struct  llvm::SDPatternMatch::TLI_pred_match< Pattern, PredFuncT >
 
struct  llvm::SDPatternMatch::SwitchContext< NewMatchContext, Pattern >
 Switch to a different MatchContext for subsequent patterns. More...
 
struct  llvm::SDPatternMatch::ValueType_bind
 
struct  llvm::SDPatternMatch::ValueType_match< Pattern, PredFuncT >
 
struct  llvm::SDPatternMatch::And< Preds >
 
struct  llvm::SDPatternMatch::And< Pred, Preds... >
 
struct  llvm::SDPatternMatch::Or< Preds >
 
struct  llvm::SDPatternMatch::Or< Pred, Preds... >
 
struct  llvm::SDPatternMatch::Not< Pred >
 
struct  llvm::SDPatternMatch::Operands_match< OpIdx, OpndPreds >
 
struct  llvm::SDPatternMatch::Operands_match< OpIdx, OpndPred, OpndPreds... >
 
struct  llvm::SDPatternMatch::EffectiveOperands< ExcludeChain >
 Provide number of operands that are not chain or glue, as well as the first index of such operand. More...
 
struct  llvm::SDPatternMatch::EffectiveOperands< false >
 
struct  llvm::SDPatternMatch::TernaryOpc_match< T0_P, T1_P, T2_P, Commutable, ExcludeChain >
 
struct  llvm::SDPatternMatch::BinaryOpc_match< LHS_P, RHS_P, Commutable, ExcludeChain >
 
struct  llvm::SDPatternMatch::UnaryOpc_match< Opnd_P, ExcludeChain >
 
struct  llvm::SDPatternMatch::ConstantInt_match
 
struct  llvm::SDPatternMatch::SpecificInt_match
 
struct  llvm::SDPatternMatch::AllOnes_match
 
struct  llvm::SDPatternMatch::CondCode_match
 

Namespaces

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

Functions

template<typename Pattern , typename MatchContext >
bool llvm::SDPatternMatch::sd_context_match (SDValue N, const MatchContext &Ctx, Pattern &&P)
 
template<typename Pattern , typename MatchContext >
bool llvm::SDPatternMatch::sd_context_match (SDNode *N, const MatchContext &Ctx, Pattern &&P)
 
template<typename Pattern >
bool llvm::SDPatternMatch::sd_match (SDNode *N, const SelectionDAG *DAG, Pattern &&P)
 
template<typename Pattern >
bool llvm::SDPatternMatch::sd_match (SDValue N, const SelectionDAG *DAG, Pattern &&P)
 
template<typename Pattern >
bool llvm::SDPatternMatch::sd_match (SDNode *N, Pattern &&P)
 
template<typename Pattern >
bool llvm::SDPatternMatch::sd_match (SDValue N, Pattern &&P)
 
Value_match llvm::SDPatternMatch::m_Value ()
 Match any valid SDValue.
 
Value_match llvm::SDPatternMatch::m_Specific (SDValue N)
 
DeferredValue_match llvm::SDPatternMatch::m_Deferred (SDValue &V)
 Similar to m_Specific, but the specific value to match is determined by another sub-pattern in the same sd_match() expression.
 
Opcode_match llvm::SDPatternMatch::m_Opc (unsigned Opcode)
 
template<typename Pattern >
NUses_match< 1, Pattern > llvm::SDPatternMatch::m_OneUse (const Pattern &P)
 
template<unsigned N, typename Pattern >
NUses_match< N, Pattern > llvm::SDPatternMatch::m_NUses (const Pattern &P)
 
NUses_match< 1, Value_match > llvm::SDPatternMatch::m_OneUse ()
 
template<unsigned N>
NUses_match< N, Value_match > llvm::SDPatternMatch::m_NUses ()
 
Value_bind llvm::SDPatternMatch::m_Value (SDValue &N)
 
template<typename PredFuncT , typename Pattern >
 llvm::SDPatternMatch::TLI_pred_match (const PredFuncT &Pred, const Pattern &P) -> TLI_pred_match< Pattern, PredFuncT >
 
template<typename Pattern >
auto llvm::SDPatternMatch::m_LegalOp (const Pattern &P)
 Match legal SDNodes based on the information provided by TargetLowering.
 
template<typename MatchContext , typename Pattern >
SwitchContext< MatchContext, Pattern > llvm::SDPatternMatch::m_Context (const MatchContext &Ctx, Pattern &&P)
 
ValueType_bind llvm::SDPatternMatch::m_VT (EVT &VT)
 Retreive the ValueType of the current SDValue.
 
template<typename PredFuncT , typename Pattern >
 llvm::SDPatternMatch::ValueType_match (const PredFuncT &Pred, const Pattern &P) -> ValueType_match< Pattern, PredFuncT >
 
template<typename Pattern >
auto llvm::SDPatternMatch::m_SpecificVT (EVT RefVT, const Pattern &P)
 Match a specific ValueType.
 
auto llvm::SDPatternMatch::m_SpecificVT (EVT RefVT)
 
auto llvm::SDPatternMatch::m_Glue ()
 
auto llvm::SDPatternMatch::m_OtherVT ()
 
template<typename Pattern >
auto llvm::SDPatternMatch::m_IntegerVT (const Pattern &P)
 Match any integer ValueTypes.
 
auto llvm::SDPatternMatch::m_IntegerVT ()
 
template<typename Pattern >
auto llvm::SDPatternMatch::m_FloatingPointVT (const Pattern &P)
 Match any floating point ValueTypes.
 
auto llvm::SDPatternMatch::m_FloatingPointVT ()
 
template<typename Pattern >
auto llvm::SDPatternMatch::m_VectorVT (const Pattern &P)
 Match any vector ValueTypes.
 
auto llvm::SDPatternMatch::m_VectorVT ()
 
template<typename Pattern >
auto llvm::SDPatternMatch::m_FixedVectorVT (const Pattern &P)
 Match fixed-length vector ValueTypes.
 
auto llvm::SDPatternMatch::m_FixedVectorVT ()
 
template<typename Pattern >
auto llvm::SDPatternMatch::m_ScalableVectorVT (const Pattern &P)
 Match scalable vector ValueTypes.
 
auto llvm::SDPatternMatch::m_ScalableVectorVT ()
 
template<typename Pattern >
auto llvm::SDPatternMatch::m_LegalType (const Pattern &P)
 Match legal ValueTypes based on the information provided by TargetLowering.
 
template<typename Pred >
 llvm::SDPatternMatch::Not (const Pred &P) -> Not< Pred >
 
template<typename Pred >
Not< Pred > llvm::SDPatternMatch::m_Unless (const Pred &P)
 Match if the inner pattern does NOT match.
 
template<typename... Preds>
And< Preds... > llvm::SDPatternMatch::m_AllOf (const Preds &...preds)
 
template<typename... Preds>
Or< Preds... > llvm::SDPatternMatch::m_AnyOf (const Preds &...preds)
 
template<typename... Preds>
auto llvm::SDPatternMatch::m_NoneOf (const Preds &...preds)
 
template<typename... OpndPreds>
auto llvm::SDPatternMatch::m_Node (unsigned Opcode, const OpndPreds &...preds)
 
template<typename T0_P , typename T1_P , typename T2_P >
TernaryOpc_match< T0_P, T1_P, T2_P > llvm::SDPatternMatch::m_SetCC (const T0_P &LHS, const T1_P &RHS, const T2_P &CC)
 
template<typename T0_P , typename T1_P , typename T2_P >
TernaryOpc_match< T0_P, T1_P, T2_P, true, false > llvm::SDPatternMatch::m_c_SetCC (const T0_P &LHS, const T1_P &RHS, const T2_P &CC)
 
template<typename T0_P , typename T1_P , typename T2_P >
TernaryOpc_match< T0_P, T1_P, T2_P > llvm::SDPatternMatch::m_Select (const T0_P &Cond, const T1_P &T, const T2_P &F)
 
template<typename T0_P , typename T1_P , typename T2_P >
TernaryOpc_match< T0_P, T1_P, T2_P > llvm::SDPatternMatch::m_VSelect (const T0_P &Cond, const T1_P &T, const T2_P &F)
 
template<typename LHS , typename RHS >
BinaryOpc_match< LHS, RHSllvm::SDPatternMatch::m_BinOp (unsigned Opc, const LHS &L, const RHS &R)
 
template<typename LHS , typename RHS >
BinaryOpc_match< LHS, RHS, truellvm::SDPatternMatch::m_c_BinOp (unsigned Opc, const LHS &L, const RHS &R)
 
template<typename LHS , typename RHS >
BinaryOpc_match< LHS, RHS, false, truellvm::SDPatternMatch::m_ChainedBinOp (unsigned Opc, const LHS &L, const RHS &R)
 
template<typename LHS , typename RHS >
BinaryOpc_match< LHS, RHS, true, truellvm::SDPatternMatch::m_c_ChainedBinOp (unsigned Opc, const LHS &L, const RHS &R)
 
template<typename LHS , typename RHS >
BinaryOpc_match< LHS, RHS, truellvm::SDPatternMatch::m_Add (const LHS &L, const RHS &R)
 
template<typename LHS , typename RHS >
BinaryOpc_match< LHS, RHSllvm::SDPatternMatch::m_Sub (const LHS &L, const RHS &R)
 
template<typename LHS , typename RHS >
BinaryOpc_match< LHS, RHS, truellvm::SDPatternMatch::m_Mul (const LHS &L, const RHS &R)
 
template<typename LHS , typename RHS >
BinaryOpc_match< LHS, RHS, truellvm::SDPatternMatch::m_And (const LHS &L, const RHS &R)
 
template<typename LHS , typename RHS >
BinaryOpc_match< LHS, RHS, truellvm::SDPatternMatch::m_Or (const LHS &L, const RHS &R)
 
template<typename LHS , typename RHS >
BinaryOpc_match< LHS, RHS, truellvm::SDPatternMatch::m_DisjointOr (const LHS &L, const RHS &R)
 
template<typename LHS , typename RHS >
auto llvm::SDPatternMatch::m_AddLike (const LHS &L, const RHS &R)
 
template<typename LHS , typename RHS >
BinaryOpc_match< LHS, RHS, truellvm::SDPatternMatch::m_Xor (const LHS &L, const RHS &R)
 
template<typename LHS , typename RHS >
BinaryOpc_match< LHS, RHS, truellvm::SDPatternMatch::m_SMin (const LHS &L, const RHS &R)
 
template<typename LHS , typename RHS >
BinaryOpc_match< LHS, RHS, truellvm::SDPatternMatch::m_SMax (const LHS &L, const RHS &R)
 
template<typename LHS , typename RHS >
BinaryOpc_match< LHS, RHS, truellvm::SDPatternMatch::m_UMin (const LHS &L, const RHS &R)
 
template<typename LHS , typename RHS >
BinaryOpc_match< LHS, RHS, truellvm::SDPatternMatch::m_UMax (const LHS &L, const RHS &R)
 
template<typename LHS , typename RHS >
BinaryOpc_match< LHS, RHSllvm::SDPatternMatch::m_UDiv (const LHS &L, const RHS &R)
 
template<typename LHS , typename RHS >
BinaryOpc_match< LHS, RHSllvm::SDPatternMatch::m_SDiv (const LHS &L, const RHS &R)
 
template<typename LHS , typename RHS >
BinaryOpc_match< LHS, RHSllvm::SDPatternMatch::m_URem (const LHS &L, const RHS &R)
 
template<typename LHS , typename RHS >
BinaryOpc_match< LHS, RHSllvm::SDPatternMatch::m_SRem (const LHS &L, const RHS &R)
 
template<typename LHS , typename RHS >
BinaryOpc_match< LHS, RHSllvm::SDPatternMatch::m_Shl (const LHS &L, const RHS &R)
 
template<typename LHS , typename RHS >
BinaryOpc_match< LHS, RHSllvm::SDPatternMatch::m_Sra (const LHS &L, const RHS &R)
 
template<typename LHS , typename RHS >
BinaryOpc_match< LHS, RHSllvm::SDPatternMatch::m_Srl (const LHS &L, const RHS &R)
 
template<typename LHS , typename RHS >
BinaryOpc_match< LHS, RHS, truellvm::SDPatternMatch::m_FAdd (const LHS &L, const RHS &R)
 
template<typename LHS , typename RHS >
BinaryOpc_match< LHS, RHSllvm::SDPatternMatch::m_FSub (const LHS &L, const RHS &R)
 
template<typename LHS , typename RHS >
BinaryOpc_match< LHS, RHS, truellvm::SDPatternMatch::m_FMul (const LHS &L, const RHS &R)
 
template<typename LHS , typename RHS >
BinaryOpc_match< LHS, RHSllvm::SDPatternMatch::m_FDiv (const LHS &L, const RHS &R)
 
template<typename LHS , typename RHS >
BinaryOpc_match< LHS, RHSllvm::SDPatternMatch::m_FRem (const LHS &L, const RHS &R)
 
template<typename Opnd >
UnaryOpc_match< Opnd > llvm::SDPatternMatch::m_UnaryOp (unsigned Opc, const Opnd &Op)
 
template<typename Opnd >
UnaryOpc_match< Opnd, truellvm::SDPatternMatch::m_ChainedUnaryOp (unsigned Opc, const Opnd &Op)
 
template<typename Opnd >
UnaryOpc_match< Opnd > llvm::SDPatternMatch::m_BitReverse (const Opnd &Op)
 
template<typename Opnd >
UnaryOpc_match< Opnd > llvm::SDPatternMatch::m_ZExt (const Opnd &Op)
 
template<typename Opnd >
UnaryOpc_match< Opnd > llvm::SDPatternMatch::m_NNegZExt (const Opnd &Op)
 
template<typename Opnd >
auto llvm::SDPatternMatch::m_SExt (const Opnd &Op)
 
template<typename Opnd >
UnaryOpc_match< Opnd > llvm::SDPatternMatch::m_AnyExt (const Opnd &Op)
 
template<typename Opnd >
UnaryOpc_match< Opnd > llvm::SDPatternMatch::m_Trunc (const Opnd &Op)
 
template<typename Opnd >
auto llvm::SDPatternMatch::m_ZExtOrSelf (const Opnd &Op)
 Match a zext or identity Allows to peek through optional extensions.
 
template<typename Opnd >
auto llvm::SDPatternMatch::m_SExtOrSelf (const Opnd &Op)
 Match a sext or identity Allows to peek through optional extensions.
 
template<typename Opnd >
auto llvm::SDPatternMatch::m_SExtLike (const Opnd &Op)
 
template<typename Opnd >
Or< UnaryOpc_match< Opnd >, Opnd > llvm::SDPatternMatch::m_AExtOrSelf (const Opnd &Op)
 Match a aext or identity Allows to peek through optional extensions.
 
template<typename Opnd >
Or< UnaryOpc_match< Opnd >, Opnd > llvm::SDPatternMatch::m_TruncOrSelf (const Opnd &Op)
 Match a trunc or identity Allows to peek through optional truncations.
 
template<typename Opnd >
UnaryOpc_match< Opnd > llvm::SDPatternMatch::m_VScale (const Opnd &Op)
 
template<typename Opnd >
UnaryOpc_match< Opnd > llvm::SDPatternMatch::m_FPToUI (const Opnd &Op)
 
template<typename Opnd >
UnaryOpc_match< Opnd > llvm::SDPatternMatch::m_FPToSI (const Opnd &Op)
 
ConstantInt_match llvm::SDPatternMatch::m_ConstInt ()
 Match any interger constants or splat of an integer constant.
 
ConstantInt_match llvm::SDPatternMatch::m_ConstInt (APInt &V)
 Match any interger constants or splat of an integer constant; return the specific constant or constant splat value.
 
SpecificInt_match llvm::SDPatternMatch::m_SpecificInt (APInt V)
 Match a specific integer constant or constant splat value.
 
SpecificInt_match llvm::SDPatternMatch::m_SpecificInt (uint64_t V)
 
SpecificInt_match llvm::SDPatternMatch::m_Zero ()
 
SpecificInt_match llvm::SDPatternMatch::m_One ()
 
AllOnes_match llvm::SDPatternMatch::m_AllOnes ()
 
auto llvm::SDPatternMatch::m_True ()
 Match true boolean value based on the information provided by TargetLowering.
 
auto llvm::SDPatternMatch::m_False ()
 Match false boolean value based on the information provided by TargetLowering.
 
CondCode_match llvm::SDPatternMatch::m_CondCode ()
 Match any conditional code SDNode.
 
CondCode_match llvm::SDPatternMatch::m_CondCode (ISD::CondCode &CC)
 Match any conditional code SDNode and return its ISD::CondCode value.
 
CondCode_match llvm::SDPatternMatch::m_SpecificCondCode (ISD::CondCode CC)
 Match a conditional code SDNode with a specific ISD::CondCode.
 
template<typename ValTy >
BinaryOpc_match< SpecificInt_match, ValTy > llvm::SDPatternMatch::m_Neg (const ValTy &V)
 Match a negate as a sub(0, v)
 
template<typename ValTy >
BinaryOpc_match< ValTy, AllOnes_match, truellvm::SDPatternMatch::m_Not (const ValTy &V)
 Match a Not as a xor(v, -1) or xor(-1, v)
 

Detailed Description

Contains matchers for matching SelectionDAG nodes and values.

Definition in file SDPatternMatch.h.