LLVM  8.0.1
Classes | Functions
llvm::PatternMatch Namespace Reference

Classes

struct  AnyBinaryOp_match
 
struct  apfloat_match
 
struct  api_pred_ty
 This helper class is used to match scalar and vector constants that satisfy a specified predicate, and bind them to an APInt. More...
 
struct  apint_match
 
struct  Argument_match
 
struct  BinaryOp_match
 
struct  bind_const_intval_ty
 
struct  bind_ty
 
struct  BinOpPred_match
 
struct  br_match
 
struct  brc_match
 
struct  CastClass_match
 
struct  class_match
 
struct  CmpClass_match
 
struct  constantint_match
 
struct  cst_pred_ty
 This helper class is used to match scalar and vector integer constants that satisfy a specified predicate. More...
 
struct  cstfp_pred_ty
 This helper class is used to match scalar and vector floating-point constants that satisfy a specified predicate. More...
 
struct  deferredval_ty
 Stores a reference to the Value *, not the Value * itself, thus can be used in commutative matchers. More...
 
struct  Exact_match
 
struct  FNeg_match
 
struct  IntrinsicID_match
 Intrinsic matchers. More...
 
struct  is_all_ones
 
struct  is_any_zero_fp
 
struct  is_bitwiselogic_op
 
struct  is_idiv_op
 
struct  is_logical_shift_op
 
struct  is_lowbit_mask
 
struct  is_maxsignedvalue
 
struct  is_nan
 
struct  is_neg_zero_fp
 
struct  is_negative
 
struct  is_nonnegative
 
struct  is_one
 
struct  is_pos_zero_fp
 
struct  is_power2
 
struct  is_power2_or_zero
 
struct  is_right_shift_op
 
struct  is_shift_op
 
struct  is_sign_mask
 
struct  is_zero
 
struct  is_zero_int
 
struct  m_Intrinsic_Ty
 Intrinsic matches are combinations of ID matchers, and argument matchers. More...
 
struct  m_Intrinsic_Ty< T0 >
 
struct  m_Intrinsic_Ty< T0, T1 >
 
struct  m_Intrinsic_Ty< T0, T1, T2 >
 
struct  m_Intrinsic_Ty< T0, T1, T2, T3 >
 
struct  match_combine_and
 
struct  match_combine_or
 Matching combinators. More...
 
struct  MaxMin_match
 
struct  ofmax_pred_ty
 Helper class for identifying ordered max predicates. More...
 
struct  ofmin_pred_ty
 Helper class for identifying ordered min predicates. More...
 
struct  OneOps_match
 Matches instructions with Opcode and three operands. More...
 
struct  OneUse_match
 
struct  OverflowingBinaryOp_match
 
struct  Signum_match
 
struct  smax_pred_ty
 Helper class for identifying signed max predicates. More...
 
struct  smin_pred_ty
 Helper class for identifying signed min predicates. More...
 
struct  specific_fpval
 Match a specified floating point value or vector of all elements of that value. More...
 
struct  specific_intval
 Match a specified integer value or vector of all elements of that. More...
 
struct  specificval_ty
 Match a specified Value*. More...
 
struct  ThreeOps_match
 Matches instructions with Opcode and three operands. More...
 
struct  TwoOps_match
 Matches instructions with Opcode and three operands. More...
 
struct  UAddWithOverflow_match
 
struct  ufmax_pred_ty
 Helper class for identifying unordered max predicates. More...
 
struct  ufmin_pred_ty
 Helper class for identifying unordered min predicates. More...
 
struct  umax_pred_ty
 Helper class for identifying unsigned max predicates. More...
 
struct  umin_pred_ty
 Helper class for identifying unsigned min predicates. More...
 

Functions

template<typename Val , typename Pattern >
bool match (Val *V, const Pattern &P)
 
template<typename T >
OneUse_match< Tm_OneUse (const T &SubPattern)
 
class_match< Valuem_Value ()
 Match an arbitrary value and ignore it. More...
 
class_match< BinaryOperatorm_BinOp ()
 Match an arbitrary binary operation and ignore it. More...
 
class_match< CmpInstm_Cmp ()
 Matches any compare instruction and ignore it. More...
 
class_match< ConstantIntm_ConstantInt ()
 Match an arbitrary ConstantInt and ignore it. More...
 
class_match< UndefValuem_Undef ()
 Match an arbitrary undef constant. More...
 
class_match< Constantm_Constant ()
 Match an arbitrary Constant and ignore it. More...
 
template<typename LTy , typename RTy >
match_combine_or< LTy, RTy > m_CombineOr (const LTy &L, const RTy &R)
 Combine two pattern matchers matching L || R. More...
 
template<typename LTy , typename RTy >
match_combine_and< LTy, RTy > m_CombineAnd (const LTy &L, const RTy &R)
 Combine two pattern matchers matching L && R. More...
 
apint_match m_APInt (const APInt *&Res)
 Match a ConstantInt or splatted ConstantVector, binding the specified pointer to the contained APInt. More...
 
apfloat_match m_APFloat (const APFloat *&Res)
 Match a ConstantFP or splatted ConstantVector, binding the specified pointer to the contained APFloat. More...
 
cst_pred_ty< is_all_onesm_AllOnes ()
 Match an integer or vector with all bits set. More...
 
cst_pred_ty< is_maxsignedvaluem_MaxSignedValue ()
 Match an integer or vector with values having all bits except for the high bit set (0x7f...). More...
 
api_pred_ty< is_maxsignedvaluem_MaxSignedValue (const APInt *&V)
 
cst_pred_ty< is_negativem_Negative ()
 Match an integer or vector of negative values. More...
 
api_pred_ty< is_negativem_Negative (const APInt *&V)
 
cst_pred_ty< is_nonnegativem_NonNegative ()
 Match an integer or vector of nonnegative values. More...
 
api_pred_ty< is_nonnegativem_NonNegative (const APInt *&V)
 
cst_pred_ty< is_onem_One ()
 Match an integer 1 or a vector with all elements equal to 1. More...
 
cst_pred_ty< is_zero_intm_ZeroInt ()
 Match an integer 0 or a vector with all elements equal to 0. More...
 
is_zero m_Zero ()
 Match any null constant or a vector with all elements equal to 0. More...
 
cst_pred_ty< is_power2m_Power2 ()
 Match an integer or vector power-of-2. More...
 
api_pred_ty< is_power2m_Power2 (const APInt *&V)
 
cst_pred_ty< is_power2_or_zerom_Power2OrZero ()
 Match an integer or vector of 0 or power-of-2 values. More...
 
api_pred_ty< is_power2_or_zerom_Power2OrZero (const APInt *&V)
 
cst_pred_ty< is_sign_maskm_SignMask ()
 Match an integer or vector with only the sign bit(s) set. More...
 
cst_pred_ty< is_lowbit_maskm_LowBitMask ()
 Match an integer or vector with only the low bit(s) set. More...
 
cstfp_pred_ty< is_nanm_NaN ()
 Match an arbitrary NaN constant. More...
 
cstfp_pred_ty< is_any_zero_fpm_AnyZeroFP ()
 Match a floating-point negative zero or positive zero. More...
 
cstfp_pred_ty< is_pos_zero_fpm_PosZeroFP ()
 Match a floating-point positive zero. More...
 
cstfp_pred_ty< is_neg_zero_fpm_NegZeroFP ()
 Match a floating-point negative zero. More...
 
bind_ty< Valuem_Value (Value *&V)
 Match a value, capturing it if we match. More...
 
bind_ty< const Valuem_Value (const Value *&V)
 
bind_ty< Instructionm_Instruction (Instruction *&I)
 Match an instruction, capturing it if we match. More...
 
bind_ty< BinaryOperatorm_BinOp (BinaryOperator *&I)
 Match a binary operator, capturing it if we match. More...
 
bind_ty< ConstantIntm_ConstantInt (ConstantInt *&CI)
 Match a ConstantInt, capturing the value if we match. More...
 
bind_ty< Constantm_Constant (Constant *&C)
 Match a Constant, capturing the value if we match. More...
 
bind_ty< ConstantFPm_ConstantFP (ConstantFP *&C)
 Match a ConstantFP, capturing the value if we match. More...
 
specificval_ty m_Specific (const Value *V)
 Match if we have a specific specified value. More...
 
deferredval_ty< Valuem_Deferred (Value *const &V)
 A commutative-friendly version of m_Specific(). More...
 
deferredval_ty< const Valuem_Deferred (const Value *const &V)
 
specific_fpval m_SpecificFP (double V)
 Match a specific floating point value or vector with all elements equal to the value. More...
 
specific_fpval m_FPOne ()
 Match a float 1.0 or vector with all elements equal to 1.0. More...
 
specific_intval m_SpecificInt (uint64_t V)
 Match a specific integer value or vector with all elements equal to the value. More...
 
bind_const_intval_ty m_ConstantInt (uint64_t &V)
 Match a ConstantInt and bind to its value. More...
 
template<typename LHS , typename RHS >
AnyBinaryOp_match< LHS, RHS > m_BinOp (const LHS &L, const RHS &R)
 
template<typename LHS , typename RHS >
BinaryOp_match< LHS, RHS, Instruction::Add > m_Add (const LHS &L, const RHS &R)
 
template<typename LHS , typename RHS >
BinaryOp_match< LHS, RHS, Instruction::FAdd > m_FAdd (const LHS &L, const RHS &R)
 
template<typename LHS , typename RHS >
BinaryOp_match< LHS, RHS, Instruction::Sub > m_Sub (const LHS &L, const RHS &R)
 
template<typename LHS , typename RHS >
BinaryOp_match< LHS, RHS, Instruction::FSub > m_FSub (const LHS &L, const RHS &R)
 
template<typename OpTy >
FNeg_match< OpTy > m_FNeg (const OpTy &X)
 Match 'fneg X' as 'fsub -0.0, X'. More...
 
template<typename RHS >
BinaryOp_match< cstfp_pred_ty< is_any_zero_fp >, RHS, Instruction::FSub > m_FNegNSZ (const RHS &X)
 Match 'fneg X' as 'fsub +-0.0, X'. More...
 
template<typename LHS , typename RHS >
BinaryOp_match< LHS, RHS, Instruction::Mul > m_Mul (const LHS &L, const RHS &R)
 
template<typename LHS , typename RHS >
BinaryOp_match< LHS, RHS, Instruction::FMul > m_FMul (const LHS &L, const RHS &R)
 
template<typename LHS , typename RHS >
BinaryOp_match< LHS, RHS, Instruction::UDiv > m_UDiv (const LHS &L, const RHS &R)
 
template<typename LHS , typename RHS >
BinaryOp_match< LHS, RHS, Instruction::SDiv > m_SDiv (const LHS &L, const RHS &R)
 
template<typename LHS , typename RHS >
BinaryOp_match< LHS, RHS, Instruction::FDiv > m_FDiv (const LHS &L, const RHS &R)
 
template<typename LHS , typename RHS >
BinaryOp_match< LHS, RHS, Instruction::URem > m_URem (const LHS &L, const RHS &R)
 
template<typename LHS , typename RHS >
BinaryOp_match< LHS, RHS, Instruction::SRem > m_SRem (const LHS &L, const RHS &R)
 
template<typename LHS , typename RHS >
BinaryOp_match< LHS, RHS, Instruction::FRem > m_FRem (const LHS &L, const RHS &R)
 
template<typename LHS , typename RHS >
BinaryOp_match< LHS, RHS, Instruction::And > m_And (const LHS &L, const RHS &R)
 
template<typename LHS , typename RHS >
BinaryOp_match< LHS, RHS, Instruction::Or > m_Or (const LHS &L, const RHS &R)
 
template<typename LHS , typename RHS >
BinaryOp_match< LHS, RHS, Instruction::Xor > m_Xor (const LHS &L, const RHS &R)
 
template<typename LHS , typename RHS >
BinaryOp_match< LHS, RHS, Instruction::Shl > m_Shl (const LHS &L, const RHS &R)
 
template<typename LHS , typename RHS >
BinaryOp_match< LHS, RHS, Instruction::LShr > m_LShr (const LHS &L, const RHS &R)
 
template<typename LHS , typename RHS >
BinaryOp_match< LHS, RHS, Instruction::AShr > m_AShr (const LHS &L, const RHS &R)
 
template<typename LHS , typename RHS >
OverflowingBinaryOp_match< LHS, RHS, Instruction::Add, OverflowingBinaryOperator::NoSignedWrapm_NSWAdd (const LHS &L, const RHS &R)
 
template<typename LHS , typename RHS >
OverflowingBinaryOp_match< LHS, RHS, Instruction::Sub, OverflowingBinaryOperator::NoSignedWrapm_NSWSub (const LHS &L, const RHS &R)
 
template<typename LHS , typename RHS >
OverflowingBinaryOp_match< LHS, RHS, Instruction::Mul, OverflowingBinaryOperator::NoSignedWrapm_NSWMul (const LHS &L, const RHS &R)
 
template<typename LHS , typename RHS >
OverflowingBinaryOp_match< LHS, RHS, Instruction::Shl, OverflowingBinaryOperator::NoSignedWrapm_NSWShl (const LHS &L, const RHS &R)
 
template<typename LHS , typename RHS >
OverflowingBinaryOp_match< LHS, RHS, Instruction::Add, OverflowingBinaryOperator::NoUnsignedWrapm_NUWAdd (const LHS &L, const RHS &R)
 
template<typename LHS , typename RHS >
OverflowingBinaryOp_match< LHS, RHS, Instruction::Sub, OverflowingBinaryOperator::NoUnsignedWrapm_NUWSub (const LHS &L, const RHS &R)
 
template<typename LHS , typename RHS >
OverflowingBinaryOp_match< LHS, RHS, Instruction::Mul, OverflowingBinaryOperator::NoUnsignedWrapm_NUWMul (const LHS &L, const RHS &R)
 
template<typename LHS , typename RHS >
OverflowingBinaryOp_match< LHS, RHS, Instruction::Shl, OverflowingBinaryOperator::NoUnsignedWrapm_NUWShl (const LHS &L, const RHS &R)
 
template<typename LHS , typename RHS >
BinOpPred_match< LHS, RHS, is_shift_opm_Shift (const LHS &L, const RHS &R)
 Matches shift operations. More...
 
template<typename LHS , typename RHS >
BinOpPred_match< LHS, RHS, is_right_shift_opm_Shr (const LHS &L, const RHS &R)
 Matches logical shift operations. More...
 
template<typename LHS , typename RHS >
BinOpPred_match< LHS, RHS, is_logical_shift_opm_LogicalShift (const LHS &L, const RHS &R)
 Matches logical shift operations. More...
 
template<typename LHS , typename RHS >
BinOpPred_match< LHS, RHS, is_bitwiselogic_opm_BitwiseLogic (const LHS &L, const RHS &R)
 Matches bitwise logic operations. More...
 
template<typename LHS , typename RHS >
BinOpPred_match< LHS, RHS, is_idiv_opm_IDiv (const LHS &L, const RHS &R)
 Matches integer division operations. More...
 
template<typename T >
Exact_match< Tm_Exact (const T &SubPattern)
 
template<typename LHS , typename RHS >
CmpClass_match< LHS, RHS, CmpInst, CmpInst::Predicatem_Cmp (CmpInst::Predicate &Pred, const LHS &L, const RHS &R)
 
template<typename LHS , typename RHS >
CmpClass_match< LHS, RHS, ICmpInst, ICmpInst::Predicatem_ICmp (ICmpInst::Predicate &Pred, const LHS &L, const RHS &R)
 
template<typename LHS , typename RHS >
CmpClass_match< LHS, RHS, FCmpInst, FCmpInst::Predicatem_FCmp (FCmpInst::Predicate &Pred, const LHS &L, const RHS &R)
 
template<typename Cond , typename LHS , typename RHS >
ThreeOps_match< Cond, LHS, RHS, Instruction::Select > m_Select (const Cond &C, const LHS &L, const RHS &R)
 Matches SelectInst. More...
 
template<int64_t L, int64_t R, typename Cond >
ThreeOps_match< Cond, constantint_match< L >, constantint_match< R >, Instruction::Select > m_SelectCst (const Cond &C)
 This matches a select of two constants, e.g. More...
 
template<typename Val_t , typename Elt_t , typename Idx_t >
ThreeOps_match< Val_t, Elt_t, Idx_t, Instruction::InsertElement > m_InsertElement (const Val_t &Val, const Elt_t &Elt, const Idx_t &Idx)
 Matches InsertElementInst. More...
 
template<typename Val_t , typename Idx_t >
TwoOps_match< Val_t, Idx_t, Instruction::ExtractElement > m_ExtractElement (const Val_t &Val, const Idx_t &Idx)
 Matches ExtractElementInst. More...
 
template<typename V1_t , typename V2_t , typename Mask_t >
ThreeOps_match< V1_t, V2_t, Mask_t, Instruction::ShuffleVector > m_ShuffleVector (const V1_t &v1, const V2_t &v2, const Mask_t &m)
 Matches ShuffleVectorInst. More...
 
template<typename OpTy >
OneOps_match< OpTy, Instruction::Load > m_Load (const OpTy &Op)
 Matches LoadInst. More...
 
template<typename ValueOpTy , typename PointerOpTy >
TwoOps_match< ValueOpTy, PointerOpTy, Instruction::Store > m_Store (const ValueOpTy &ValueOp, const PointerOpTy &PointerOp)
 Matches StoreInst. More...
 
template<typename OpTy >
CastClass_match< OpTy, Instruction::BitCast > m_BitCast (const OpTy &Op)
 Matches BitCast. More...
 
template<typename OpTy >
CastClass_match< OpTy, Instruction::PtrToInt > m_PtrToInt (const OpTy &Op)
 Matches PtrToInt. More...
 
template<typename OpTy >
CastClass_match< OpTy, Instruction::Trunc > m_Trunc (const OpTy &Op)
 Matches Trunc. More...
 
template<typename OpTy >
CastClass_match< OpTy, Instruction::SExt > m_SExt (const OpTy &Op)
 Matches SExt. More...
 
template<typename OpTy >
CastClass_match< OpTy, Instruction::ZExt > m_ZExt (const OpTy &Op)
 Matches ZExt. More...
 
template<typename OpTy >
match_combine_or< CastClass_match< OpTy, Instruction::ZExt >, CastClass_match< OpTy, Instruction::SExt > > m_ZExtOrSExt (const OpTy &Op)
 
template<typename OpTy >
CastClass_match< OpTy, Instruction::UIToFP > m_UIToFP (const OpTy &Op)
 Matches UIToFP. More...
 
template<typename OpTy >
CastClass_match< OpTy, Instruction::SIToFP > m_SIToFP (const OpTy &Op)
 Matches SIToFP. More...
 
template<typename OpTy >
CastClass_match< OpTy, Instruction::FPTrunc > m_FPTrunc (const OpTy &Op)
 Matches FPTrunc. More...
 
template<typename OpTy >
CastClass_match< OpTy, Instruction::FPExt > m_FPExt (const OpTy &Op)
 Matches FPExt. More...
 
br_match m_UnconditionalBr (BasicBlock *&Succ)
 
template<typename Cond_t >
brc_match< Cond_t > m_Br (const Cond_t &C, BasicBlock *&T, BasicBlock *&F)
 
template<typename LHS , typename RHS >
MaxMin_match< ICmpInst, LHS, RHS, smax_pred_tym_SMax (const LHS &L, const RHS &R)
 
template<typename LHS , typename RHS >
MaxMin_match< ICmpInst, LHS, RHS, smin_pred_tym_SMin (const LHS &L, const RHS &R)
 
template<typename LHS , typename RHS >
MaxMin_match< ICmpInst, LHS, RHS, umax_pred_tym_UMax (const LHS &L, const RHS &R)
 
template<typename LHS , typename RHS >
MaxMin_match< ICmpInst, LHS, RHS, umin_pred_tym_UMin (const LHS &L, const RHS &R)
 
template<typename LHS , typename RHS >
MaxMin_match< FCmpInst, LHS, RHS, ofmax_pred_tym_OrdFMax (const LHS &L, const RHS &R)
 Match an 'ordered' floating point maximum function. More...
 
template<typename LHS , typename RHS >
MaxMin_match< FCmpInst, LHS, RHS, ofmin_pred_tym_OrdFMin (const LHS &L, const RHS &R)
 Match an 'ordered' floating point minimum function. More...
 
template<typename LHS , typename RHS >
MaxMin_match< FCmpInst, LHS, RHS, ufmax_pred_tym_UnordFMax (const LHS &L, const RHS &R)
 Match an 'unordered' floating point maximum function. More...
 
template<typename LHS , typename RHS >
MaxMin_match< FCmpInst, LHS, RHS, ufmin_pred_tym_UnordFMin (const LHS &L, const RHS &R)
 Match an 'unordered' floating point minimum function. More...
 
template<typename LHS_t , typename RHS_t , typename Sum_t >
UAddWithOverflow_match< LHS_t, RHS_t, Sum_t > m_UAddWithOverflow (const LHS_t &L, const RHS_t &R, const Sum_t &S)
 Match an icmp instruction checking for unsigned overflow on addition. More...
 
template<unsigned OpI, typename Opnd_t >
Argument_match< Opnd_t > m_Argument (const Opnd_t &Op)
 Match an argument. More...
 
template<Intrinsic::ID IntrID>
IntrinsicID_match m_Intrinsic ()
 Match intrinsic calls like this: m_Intrinsic<Intrinsic::fabs>(m_Value(X)) More...
 
template<Intrinsic::ID IntrID, typename T0 >
m_Intrinsic_Ty< T0 >::Ty m_Intrinsic (const T0 &Op0)
 
template<Intrinsic::ID IntrID, typename T0 , typename T1 >
m_Intrinsic_Ty< T0, T1 >::Ty m_Intrinsic (const T0 &Op0, const T1 &Op1)
 
template<Intrinsic::ID IntrID, typename T0 , typename T1 , typename T2 >
m_Intrinsic_Ty< T0, T1, T2 >::Ty m_Intrinsic (const T0 &Op0, const T1 &Op1, const T2 &Op2)
 
template<Intrinsic::ID IntrID, typename T0 , typename T1 , typename T2 , typename T3 >
m_Intrinsic_Ty< T0, T1, T2, T3 >::Ty m_Intrinsic (const T0 &Op0, const T1 &Op1, const T2 &Op2, const T3 &Op3)
 
template<typename Opnd0 >
m_Intrinsic_Ty< Opnd0 >::Ty m_BitReverse (const Opnd0 &Op0)
 
template<typename Opnd0 >
m_Intrinsic_Ty< Opnd0 >::Ty m_BSwap (const Opnd0 &Op0)
 
template<typename Opnd0 >
m_Intrinsic_Ty< Opnd0 >::Ty m_FAbs (const Opnd0 &Op0)
 
template<typename Opnd0 >
m_Intrinsic_Ty< Opnd0 >::Ty m_FCanonicalize (const Opnd0 &Op0)
 
template<typename Opnd0 , typename Opnd1 >
m_Intrinsic_Ty< Opnd0, Opnd1 >::Ty m_FMin (const Opnd0 &Op0, const Opnd1 &Op1)
 
template<typename Opnd0 , typename Opnd1 >
m_Intrinsic_Ty< Opnd0, Opnd1 >::Ty m_FMax (const Opnd0 &Op0, const Opnd1 &Op1)
 
template<typename LHS , typename RHS >
AnyBinaryOp_match< LHS, RHS, truem_c_BinOp (const LHS &L, const RHS &R)
 Matches a BinaryOperator with LHS and RHS in either order. More...
 
template<typename LHS , typename RHS >
CmpClass_match< LHS, RHS, ICmpInst, ICmpInst::Predicate, truem_c_ICmp (ICmpInst::Predicate &Pred, const LHS &L, const RHS &R)
 Matches an ICmp with a predicate over LHS and RHS in either order. More...
 
template<typename LHS , typename RHS >
BinaryOp_match< LHS, RHS, Instruction::Add, truem_c_Add (const LHS &L, const RHS &R)
 Matches a Add with LHS and RHS in either order. More...
 
template<typename LHS , typename RHS >
BinaryOp_match< LHS, RHS, Instruction::Mul, truem_c_Mul (const LHS &L, const RHS &R)
 Matches a Mul with LHS and RHS in either order. More...
 
template<typename LHS , typename RHS >
BinaryOp_match< LHS, RHS, Instruction::And, truem_c_And (const LHS &L, const RHS &R)
 Matches an And with LHS and RHS in either order. More...
 
template<typename LHS , typename RHS >
BinaryOp_match< LHS, RHS, Instruction::Or, truem_c_Or (const LHS &L, const RHS &R)
 Matches an Or with LHS and RHS in either order. More...
 
template<typename LHS , typename RHS >
BinaryOp_match< LHS, RHS, Instruction::Xor, truem_c_Xor (const LHS &L, const RHS &R)
 Matches an Xor with LHS and RHS in either order. More...
 
template<typename ValTy >
BinaryOp_match< cst_pred_ty< is_zero_int >, ValTy, Instruction::Sub > m_Neg (const ValTy &V)
 Matches a 'Neg' as 'sub 0, V'. More...
 
template<typename ValTy >
BinaryOp_match< ValTy, cst_pred_ty< is_all_ones >, Instruction::Xor, truem_Not (const ValTy &V)
 Matches a 'Not' as 'xor V, -1' or 'xor -1, V'. More...
 
template<typename LHS , typename RHS >
MaxMin_match< ICmpInst, LHS, RHS, smin_pred_ty, truem_c_SMin (const LHS &L, const RHS &R)
 Matches an SMin with LHS and RHS in either order. More...
 
template<typename LHS , typename RHS >
MaxMin_match< ICmpInst, LHS, RHS, smax_pred_ty, truem_c_SMax (const LHS &L, const RHS &R)
 Matches an SMax with LHS and RHS in either order. More...
 
template<typename LHS , typename RHS >
MaxMin_match< ICmpInst, LHS, RHS, umin_pred_ty, truem_c_UMin (const LHS &L, const RHS &R)
 Matches a UMin with LHS and RHS in either order. More...
 
template<typename LHS , typename RHS >
MaxMin_match< ICmpInst, LHS, RHS, umax_pred_ty, truem_c_UMax (const LHS &L, const RHS &R)
 Matches a UMax with LHS and RHS in either order. More...
 
template<typename LHS , typename RHS >
BinaryOp_match< LHS, RHS, Instruction::FAdd, truem_c_FAdd (const LHS &L, const RHS &R)
 Matches FAdd with LHS and RHS in either order. More...
 
template<typename LHS , typename RHS >
BinaryOp_match< LHS, RHS, Instruction::FMul, truem_c_FMul (const LHS &L, const RHS &R)
 Matches FMul with LHS and RHS in either order. More...
 
template<typename Val_t >
Signum_match< Val_t > m_Signum (const Val_t &V)
 Matches a signum pattern. More...
 

Function Documentation

◆ m_Add()

template<typename LHS , typename RHS >
BinaryOp_match<LHS, RHS, Instruction::Add> llvm::PatternMatch::m_Add ( const LHS &  L,
const RHS &  R 
)
inline

◆ m_AllOnes()

cst_pred_ty<is_all_ones> llvm::PatternMatch::m_AllOnes ( )
inline

◆ m_And()

template<typename LHS , typename RHS >
BinaryOp_match<LHS, RHS, Instruction::And> llvm::PatternMatch::m_And ( const LHS &  L,
const RHS &  R 
)
inline

◆ m_AnyZeroFP()

cstfp_pred_ty<is_any_zero_fp> llvm::PatternMatch::m_AnyZeroFP ( )
inline

Match a floating-point negative zero or positive zero.

For vectors, this includes constants with undefined elements.

Definition at line 436 of file PatternMatch.h.

Referenced by canonicalizeSaturatedSubtract(), foldFCmpReciprocalAndZero(), foldSelectBinOpIdentity(), m_FNegNSZ(), matchSelectPattern(), SimplifyFAddInst(), SimplifyFDivInst(), SimplifyFMulInst(), SimplifyFSubInst(), and llvm::InstCombiner::visitFCmpInst().

◆ m_APFloat()

apfloat_match llvm::PatternMatch::m_APFloat ( const APFloat *&  Res)
inline

◆ m_APInt()

apint_match llvm::PatternMatch::m_APInt ( const APInt *&  Res)
inline

Match a ConstantInt or splatted ConstantVector, binding the specified pointer to the contained APInt.

Definition at line 176 of file PatternMatch.h.

Referenced by canEvaluateShiftedShift(), canEvaluateTruncated(), canEvaluateZExtd(), canonicalizeSaturatedSubtract(), checkForNegativeOperand(), llvm::InstCombiner::commonIDivTransforms(), llvm::InstCombiner::commonIRemTransforms(), computeKnownBits(), computeKnownBitsFromOperator(), ComputeNumSignBitsImpl(), llvm::ConstantFoldBinaryInstruction(), createAndInstr(), CreateLoadIns(), llvm::decomposeBitTestICmp(), foldAndOrOfEqualityCmpsWithConstants(), foldICmpShlOne(), foldICmpWithTruncSignExtendedVal(), foldSelectICmpAnd(), llvm::InstCombiner::FoldShiftByConstant(), foldShiftedShift(), foldSignedTruncationCheck(), getAlternateBinop(), getBinOpsForFactorization(), GetConstantInt(), getDemandedBitsLHSMask(), getLogBase2(), GetLoopInvariantInsertPosition(), getRangeForAffineARHelper(), isAlwaysLive(), isDivZero(), llvm::isSafeToSpeculativelyExecute(), isSelect01(), isSignedMinMaxClamp(), isTruePredicate(), lookThroughAnd(), MaintainNoSignedWrap(), matchClamp(), MatchDiv(), matchMinMax(), MatchMul(), MatchRem(), processUGT_ADDCST_ADD(), llvm::InstCombiner::replacedSelectWithOperand(), setLimitsForBinOp(), setLimitsForIntrinsic(), ShrinkDemandedConstant(), SimplifyAndInst(), simplifyAndOfICmpsWithAdd(), simplifyAndOrOfICmpsWithConstants(), SimplifyBSwap(), simplifyICmpWithAbsNabs(), simplifyICmpWithBinOp(), simplifyICmpWithConstant(), simplifyIntrinsic(), SimplifyLShrInst(), SimplifyOrInst(), simplifyOrOfICmpsWithAdd(), simplifySelectBitTest(), simplifySelectWithICmpCond(), truncateIVUse(), llvm::InstCombiner::visitAnd(), llvm::InstCombiner::visitAShr(), llvm::InstCombiner::visitCallInst(), llvm::InstCombiner::visitICmpInst(), llvm::InstCombiner::visitLShr(), llvm::InstCombiner::visitMul(), llvm::InstCombiner::visitOr(), llvm::InstCombiner::visitSDiv(), llvm::InstCombiner::visitShl(), llvm::InstCombiner::visitSub(), llvm::InstCombiner::visitTrunc(), llvm::InstCombiner::visitUDiv(), llvm::InstCombiner::visitXor(), and llvm::reassociate::XorOpnd::XorOpnd().

◆ m_Argument()

template<unsigned OpI, typename Opnd_t >
Argument_match<Opnd_t> llvm::PatternMatch::m_Argument ( const Opnd_t &  Op)
inline

Match an argument.

Definition at line 1497 of file PatternMatch.h.

◆ m_AShr()

template<typename LHS , typename RHS >
BinaryOp_match<LHS, RHS, Instruction::AShr> llvm::PatternMatch::m_AShr ( const LHS &  L,
const RHS &  R 
)
inline

◆ m_BinOp() [1/3]

class_match<BinaryOperator> llvm::PatternMatch::m_BinOp ( )
inline

◆ m_BinOp() [2/3]

bind_ty<BinaryOperator> llvm::PatternMatch::m_BinOp ( BinaryOperator *&  I)
inline

Match a binary operator, capturing it if we match.

Definition at line 481 of file PatternMatch.h.

References I.

◆ m_BinOp() [3/3]

template<typename LHS , typename RHS >
AnyBinaryOp_match<LHS, RHS> llvm::PatternMatch::m_BinOp ( const LHS &  L,
const RHS &  R 
)
inline

Definition at line 607 of file PatternMatch.h.

References llvm::MCID::Commutable.

◆ m_BitCast()

template<typename OpTy >
CastClass_match<OpTy, Instruction::BitCast> llvm::PatternMatch::m_BitCast ( const OpTy &  Op)
inline

◆ m_BitReverse()

template<typename Opnd0 >
m_Intrinsic_Ty<Opnd0>::Ty llvm::PatternMatch::m_BitReverse ( const Opnd0 &  Op0)
inline

Definition at line 1576 of file PatternMatch.h.

Referenced by foldICmpWithMinMax(), and simplifyUnaryIntrinsic().

◆ m_BitwiseLogic()

template<typename LHS , typename RHS >
BinOpPred_match<LHS, RHS, is_bitwiselogic_op> llvm::PatternMatch::m_BitwiseLogic ( const LHS &  L,
const RHS &  R 
)
inline

Matches bitwise logic operations.

Definition at line 948 of file PatternMatch.h.

Referenced by llvm::AssumptionCache::updateAffectedValues().

◆ m_Br()

template<typename Cond_t >
brc_match<Cond_t> llvm::PatternMatch::m_Br ( const Cond_t &  C,
BasicBlock *&  T,
BasicBlock *&  F 
)
inline

◆ m_BSwap()

template<typename Opnd0 >
m_Intrinsic_Ty<Opnd0>::Ty llvm::PatternMatch::m_BSwap ( const Opnd0 &  Op0)
inline

◆ m_c_Add()

template<typename LHS , typename RHS >
BinaryOp_match<LHS, RHS, Instruction::Add, true> llvm::PatternMatch::m_c_Add ( const LHS &  L,
const RHS &  R 
)
inline

Matches a Add with LHS and RHS in either order.

Definition at line 1628 of file PatternMatch.h.

Referenced by foldICmpWithTruncSignExtendedVal(), SimplifyOrInst(), llvm::InstCombiner::visitSub(), and llvm::InstCombiner::visitXor().

◆ m_c_And()

template<typename LHS , typename RHS >
BinaryOp_match<LHS, RHS, Instruction::And, true> llvm::PatternMatch::m_c_And ( const LHS &  L,
const RHS &  R 
)
inline

◆ m_c_BinOp()

template<typename LHS , typename RHS >
AnyBinaryOp_match<LHS, RHS, true> llvm::PatternMatch::m_c_BinOp ( const LHS &  L,
const RHS &  R 
)
inline

◆ m_c_FAdd()

template<typename LHS , typename RHS >
BinaryOp_match<LHS, RHS, Instruction::FAdd, true> llvm::PatternMatch::m_c_FAdd ( const LHS &  L,
const RHS &  R 
)
inline

Matches FAdd with LHS and RHS in either order.

Definition at line 1703 of file PatternMatch.h.

Referenced by SimplifyFSubInst(), and llvm::InstCombiner::visitFSub().

◆ m_c_FMul()

template<typename LHS , typename RHS >
BinaryOp_match<LHS, RHS, Instruction::FMul, true> llvm::PatternMatch::m_c_FMul ( const LHS &  L,
const RHS &  R 
)
inline

Matches FMul with LHS and RHS in either order.

Definition at line 1710 of file PatternMatch.h.

Referenced by factorizeFAddFSub(), SimplifyFDivInst(), llvm::InstCombiner::visitFDiv(), and llvm::InstCombiner::visitFMul().

◆ m_c_ICmp()

template<typename LHS , typename RHS >
CmpClass_match<LHS, RHS, ICmpInst, ICmpInst::Predicate, true> llvm::PatternMatch::m_c_ICmp ( ICmpInst::Predicate Pred,
const LHS &  L,
const RHS &  R 
)
inline

Matches an ICmp with a predicate over LHS and RHS in either order.

Does not swap the predicate.

Definition at line 1621 of file PatternMatch.h.

Referenced by computeKnownBitsFromAssume(), foldICmpWithHighBitMask(), foldICmpWithLowBitMaskedVal(), foldICmpWithTruncSignExtendedVal(), foldSelectWithBinaryOp(), and isKnownNonNullFromDominatingCondition().

◆ m_c_Mul()

template<typename LHS , typename RHS >
BinaryOp_match<LHS, RHS, Instruction::Mul, true> llvm::PatternMatch::m_c_Mul ( const LHS &  L,
const RHS &  R 
)
inline

Matches a Mul with LHS and RHS in either order.

Definition at line 1635 of file PatternMatch.h.

Referenced by llvm::InstCombiner::commonIDivTransforms(), simplifyDiv(), llvm::InstCombiner::visitMul(), and llvm::InstCombiner::visitSub().

◆ m_c_Or()

template<typename LHS , typename RHS >
BinaryOp_match<LHS, RHS, Instruction::Or, true> llvm::PatternMatch::m_c_Or ( const LHS &  L,
const RHS &  R 
)
inline

◆ m_c_SMax()

template<typename LHS , typename RHS >
MaxMin_match<ICmpInst, LHS, RHS, smax_pred_ty, true> llvm::PatternMatch::m_c_SMax ( const LHS &  L,
const RHS &  R 
)
inline

Matches an SMax with LHS and RHS in either order.

Definition at line 1684 of file PatternMatch.h.

Referenced by foldICmpWithMinMax().

◆ m_c_SMin()

template<typename LHS , typename RHS >
MaxMin_match<ICmpInst, LHS, RHS, smin_pred_ty, true> llvm::PatternMatch::m_c_SMin ( const LHS &  L,
const RHS &  R 
)
inline

Matches an SMin with LHS and RHS in either order.

Definition at line 1678 of file PatternMatch.h.

Referenced by foldICmpWithMinMax().

◆ m_c_UMax()

template<typename LHS , typename RHS >
MaxMin_match<ICmpInst, LHS, RHS, umax_pred_ty, true> llvm::PatternMatch::m_c_UMax ( const LHS &  L,
const RHS &  R 
)
inline

Matches a UMax with LHS and RHS in either order.

Definition at line 1696 of file PatternMatch.h.

Referenced by foldICmpWithMinMax().

◆ m_c_UMin()

template<typename LHS , typename RHS >
MaxMin_match<ICmpInst, LHS, RHS, umin_pred_ty, true> llvm::PatternMatch::m_c_UMin ( const LHS &  L,
const RHS &  R 
)
inline

Matches a UMin with LHS and RHS in either order.

Definition at line 1690 of file PatternMatch.h.

Referenced by foldICmpWithMinMax().

◆ m_c_Xor()

template<typename LHS , typename RHS >
BinaryOp_match<LHS, RHS, Instruction::Xor, true> llvm::PatternMatch::m_c_Xor ( const LHS &  L,
const RHS &  R 
)
inline

◆ m_Cmp() [1/2]

class_match<CmpInst> llvm::PatternMatch::m_Cmp ( )
inline

◆ m_Cmp() [2/2]

template<typename LHS , typename RHS >
CmpClass_match<LHS, RHS, CmpInst, CmpInst::Predicate> llvm::PatternMatch::m_Cmp ( CmpInst::Predicate Pred,
const LHS &  L,
const RHS &  R 
)
inline

Definition at line 1008 of file PatternMatch.h.

◆ m_CombineAnd()

template<typename LTy , typename RTy >
match_combine_and<LTy, RTy> llvm::PatternMatch::m_CombineAnd ( const LTy &  L,
const RTy &  R 
)
inline

Combine two pattern matchers matching L && R.

Definition at line 130 of file PatternMatch.h.

Referenced by foldICmpWithLowBitMaskedVal(), m_Intrinsic(), SimplifyAndInst(), and visitMaskedMerge().

◆ m_CombineOr()

template<typename LTy , typename RTy >
match_combine_or<LTy, RTy> llvm::PatternMatch::m_CombineOr ( const LTy &  L,
const RTy &  R 
)
inline

◆ m_Constant() [1/2]

class_match<Constant> llvm::PatternMatch::m_Constant ( )
inline

◆ m_Constant() [2/2]

bind_ty<Constant> llvm::PatternMatch::m_Constant ( Constant *&  C)
inline

Match a Constant, capturing the value if we match.

Definition at line 487 of file PatternMatch.h.

References C.

◆ m_ConstantFP()

bind_ty<ConstantFP> llvm::PatternMatch::m_ConstantFP ( ConstantFP *&  C)
inline

Match a ConstantFP, capturing the value if we match.

Definition at line 490 of file PatternMatch.h.

References C.

◆ m_ConstantInt() [1/3]

constantint_match< Val > llvm::PatternMatch::m_ConstantInt ( )
inline

◆ m_ConstantInt() [2/3]

bind_ty<ConstantInt> llvm::PatternMatch::m_ConstantInt ( ConstantInt *&  CI)
inline

Match a ConstantInt, capturing the value if we match.

Definition at line 484 of file PatternMatch.h.

◆ m_ConstantInt() [3/3]

bind_const_intval_ty llvm::PatternMatch::m_ConstantInt ( uint64_t &  V)
inline

Match a ConstantInt and bind to its value.

This does not match ConstantInts wider than 64-bits.

Definition at line 583 of file PatternMatch.h.

◆ m_Deferred() [1/2]

deferredval_ty<Value> llvm::PatternMatch::m_Deferred ( Value *const V)
inline

◆ m_Deferred() [2/2]

deferredval_ty<const Value> llvm::PatternMatch::m_Deferred ( const Value *const V)
inline

Definition at line 516 of file PatternMatch.h.

◆ m_Exact()

template<typename T >
Exact_match<T> llvm::PatternMatch::m_Exact ( const T SubPattern)
inline

◆ m_ExtractElement()

template<typename Val_t , typename Idx_t >
TwoOps_match<Val_t, Idx_t, Instruction::ExtractElement> llvm::PatternMatch::m_ExtractElement ( const Val_t &  Val,
const Idx_t &  Idx 
)
inline

Matches ExtractElementInst.

Definition at line 1106 of file PatternMatch.h.

Referenced by llvm::InstCombiner::visitInsertElementInst().

◆ m_FAbs()

template<typename Opnd0 >
m_Intrinsic_Ty<Opnd0>::Ty llvm::PatternMatch::m_FAbs ( const Opnd0 &  Op0)
inline

Definition at line 1586 of file PatternMatch.h.

Referenced by llvm::InstCombiner::visitCallInst().

◆ m_FAdd()

template<typename LHS , typename RHS >
BinaryOp_match<LHS, RHS, Instruction::FAdd> llvm::PatternMatch::m_FAdd ( const LHS &  L,
const RHS &  R 
)
inline

◆ m_FCanonicalize()

template<typename Opnd0 >
m_Intrinsic_Ty<Opnd0>::Ty llvm::PatternMatch::m_FCanonicalize ( const Opnd0 &  Op0)
inline

Definition at line 1591 of file PatternMatch.h.

◆ m_FCmp()

template<typename LHS , typename RHS >
CmpClass_match<LHS, RHS, FCmpInst, FCmpInst::Predicate> llvm::PatternMatch::m_FCmp ( FCmpInst::Predicate Pred,
const LHS &  L,
const RHS &  R 
)
inline

Definition at line 1020 of file PatternMatch.h.

Referenced by simplifySelectWithFCmp().

◆ m_FDiv()

template<typename LHS , typename RHS >
BinaryOp_match<LHS, RHS, Instruction::FDiv> llvm::PatternMatch::m_FDiv ( const LHS &  L,
const RHS &  R 
)
inline

◆ m_FMax()

template<typename Opnd0 , typename Opnd1 >
m_Intrinsic_Ty<Opnd0, Opnd1>::Ty llvm::PatternMatch::m_FMax ( const Opnd0 &  Op0,
const Opnd1 &  Op1 
)
inline

Definition at line 1602 of file PatternMatch.h.

◆ m_FMin()

template<typename Opnd0 , typename Opnd1 >
m_Intrinsic_Ty<Opnd0, Opnd1>::Ty llvm::PatternMatch::m_FMin ( const Opnd0 &  Op0,
const Opnd1 &  Op1 
)
inline

Definition at line 1596 of file PatternMatch.h.

◆ m_FMul()

template<typename LHS , typename RHS >
BinaryOp_match<LHS, RHS, Instruction::FMul> llvm::PatternMatch::m_FMul ( const LHS &  L,
const RHS &  R 
)
inline

◆ m_FNeg()

template<typename OpTy >
FNeg_match<OpTy> llvm::PatternMatch::m_FNeg ( const OpTy &  X)
inline

◆ m_FNegNSZ()

template<typename RHS >
BinaryOp_match<cstfp_pred_ty<is_any_zero_fp>, RHS, Instruction::FSub> llvm::PatternMatch::m_FNegNSZ ( const RHS &  X)
inline

Match 'fneg X' as 'fsub +-0.0, X'.

Definition at line 696 of file PatternMatch.h.

References m_AnyZeroFP(), and m_FSub().

Referenced by SimplifyFDivInst().

◆ m_FPExt()

template<typename OpTy >
CastClass_match<OpTy, Instruction::FPExt> llvm::PatternMatch::m_FPExt ( const OpTy &  Op)
inline

◆ m_FPOne()

specific_fpval llvm::PatternMatch::m_FPOne ( )
inline

Match a float 1.0 or vector with all elements equal to 1.0.

Definition at line 543 of file PatternMatch.h.

References m_SpecificFP().

Referenced by llvm::GCNTTIImpl::getArithmeticInstrCost(), getSqrtCall(), SimplifyFDivInst(), SimplifyFMulInst(), and llvm::InstCombiner::visitCallInst().

◆ m_FPTrunc()

template<typename OpTy >
CastClass_match<OpTy, Instruction::FPTrunc> llvm::PatternMatch::m_FPTrunc ( const OpTy &  Op)
inline

Matches FPTrunc.

Definition at line 1199 of file PatternMatch.h.

Referenced by llvm::InstCombiner::visitFSub().

◆ m_FRem()

template<typename LHS , typename RHS >
BinaryOp_match<LHS, RHS, Instruction::FRem> llvm::PatternMatch::m_FRem ( const LHS &  L,
const RHS &  R 
)
inline

Definition at line 743 of file PatternMatch.h.

◆ m_FSub()

template<typename LHS , typename RHS >
BinaryOp_match<LHS, RHS, Instruction::FSub> llvm::PatternMatch::m_FSub ( const LHS &  L,
const RHS &  R 
)
inline

◆ m_ICmp()

template<typename LHS , typename RHS >
CmpClass_match<LHS, RHS, ICmpInst, ICmpInst::Predicate> llvm::PatternMatch::m_ICmp ( ICmpInst::Predicate Pred,
const LHS &  L,
const RHS &  R 
)
inline

◆ m_IDiv()

template<typename LHS , typename RHS >
BinOpPred_match<LHS, RHS, is_idiv_op> llvm::PatternMatch::m_IDiv ( const LHS &  L,
const RHS &  R 
)
inline

Matches integer division operations.

Definition at line 954 of file PatternMatch.h.

Referenced by isKnownNonZero(), and SimplifyMulInst().

◆ m_InsertElement()

template<typename Val_t , typename Elt_t , typename Idx_t >
ThreeOps_match<Val_t, Elt_t, Idx_t, Instruction::InsertElement> llvm::PatternMatch::m_InsertElement ( const Val_t &  Val,
const Elt_t &  Elt,
const Idx_t &  Idx 
)
inline

Matches InsertElementInst.

Definition at line 1098 of file PatternMatch.h.

Referenced by cheapToScalarize(), foldBitcastExtElt(), and foldShuffleWithInsert().

◆ m_Instruction()

bind_ty<Instruction> llvm::PatternMatch::m_Instruction ( Instruction *&  I)
inline

◆ m_Intrinsic() [1/5]

template<Intrinsic::ID IntrID>
IntrinsicID_match llvm::PatternMatch::m_Intrinsic ( )
inline

Match intrinsic calls like this: m_Intrinsic<Intrinsic::fabs>(m_Value(X))

Definition at line 1546 of file PatternMatch.h.

◆ m_Intrinsic() [2/5]

template<Intrinsic::ID IntrID, typename T0 >
m_Intrinsic_Ty<T0>::Ty llvm::PatternMatch::m_Intrinsic ( const T0 &  Op0)
inline

Definition at line 1551 of file PatternMatch.h.

References m_CombineAnd().

◆ m_Intrinsic() [3/5]

template<Intrinsic::ID IntrID, typename T0 , typename T1 >
m_Intrinsic_Ty<T0, T1>::Ty llvm::PatternMatch::m_Intrinsic ( const T0 &  Op0,
const T1 Op1 
)
inline

Definition at line 1556 of file PatternMatch.h.

References m_CombineAnd().

◆ m_Intrinsic() [4/5]

template<Intrinsic::ID IntrID, typename T0 , typename T1 , typename T2 >
m_Intrinsic_Ty<T0, T1, T2>::Ty llvm::PatternMatch::m_Intrinsic ( const T0 &  Op0,
const T1 Op1,
const T2 &  Op2 
)
inline

Definition at line 1563 of file PatternMatch.h.

References m_CombineAnd(), and T1.

◆ m_Intrinsic() [5/5]

template<Intrinsic::ID IntrID, typename T0 , typename T1 , typename T2 , typename T3 >
m_Intrinsic_Ty<T0, T1, T2, T3>::Ty llvm::PatternMatch::m_Intrinsic ( const T0 &  Op0,
const T1 Op1,
const T2 &  Op2,
const T3 &  Op3 
)
inline

Definition at line 1570 of file PatternMatch.h.

References m_CombineAnd().

◆ m_Load()

template<typename OpTy >
OneOps_match<OpTy, Instruction::Load> llvm::PatternMatch::m_Load ( const OpTy &  Op)
inline

◆ m_LogicalShift()

template<typename LHS , typename RHS >
BinOpPred_match<LHS, RHS, is_logical_shift_op> llvm::PatternMatch::m_LogicalShift ( const LHS &  L,
const RHS &  R 
)
inline

Matches logical shift operations.

Definition at line 941 of file PatternMatch.h.

Referenced by canonicalizeSaturatedSubtract(), foldVecTruncToExtElt(), matchRotate(), and llvm::InstCombiner::visitAnd().

◆ m_LowBitMask()

cst_pred_ty<is_lowbit_mask> llvm::PatternMatch::m_LowBitMask ( )
inline

Match an integer or vector with only the low bit(s) set.

For vectors, this includes constants with undefined elements.

Definition at line 418 of file PatternMatch.h.

Referenced by foldICmpWithLowBitMaskedVal().

◆ m_LShr()

template<typename LHS , typename RHS >
BinaryOp_match<LHS, RHS, Instruction::LShr> llvm::PatternMatch::m_LShr ( const LHS &  L,
const RHS &  R 
)
inline

◆ m_MaxSignedValue() [1/2]

cst_pred_ty<is_maxsignedvalue> llvm::PatternMatch::m_MaxSignedValue ( )
inline

Match an integer or vector with values having all bits except for the high bit set (0x7f...).

For vectors, this includes constants with undefined elements.

Definition at line 319 of file PatternMatch.h.

◆ m_MaxSignedValue() [2/2]

api_pred_ty<is_maxsignedvalue> llvm::PatternMatch::m_MaxSignedValue ( const APInt *&  V)
inline

Definition at line 322 of file PatternMatch.h.

◆ m_Mul()

template<typename LHS , typename RHS >
BinaryOp_match<LHS, RHS, Instruction::Mul> llvm::PatternMatch::m_Mul ( const LHS &  L,
const RHS &  R 
)
inline

◆ m_NaN()

cstfp_pred_ty<is_nan> llvm::PatternMatch::m_NaN ( )
inline

Match an arbitrary NaN constant.

This includes quiet and signalling nans. For vectors, this includes constants with undefined elements.

Definition at line 427 of file PatternMatch.h.

Referenced by simplifyBinaryIntrinsic(), SimplifyFCmpInst(), simplifyFPBinop(), and llvm::InstCombiner::visitCallInst().

◆ m_Neg()

template<typename ValTy >
BinaryOp_match<cst_pred_ty<is_zero_int>, ValTy, Instruction::Sub> llvm::PatternMatch::m_Neg ( const ValTy &  V)
inline

◆ m_Negative() [1/2]

cst_pred_ty<is_negative> llvm::PatternMatch::m_Negative ( )
inline

Match an integer or vector of negative values.

For vectors, this includes constants with undefined elements.

Definition at line 331 of file PatternMatch.h.

Referenced by SimplifyShlInst(), llvm::InstCombiner::visitSRem(), llvm::InstCombiner::visitUDiv(), llvm::InstCombiner::visitURem(), and llvm::InstCombiner::visitXor().

◆ m_Negative() [2/2]

api_pred_ty<is_negative> llvm::PatternMatch::m_Negative ( const APInt *&  V)
inline

Definition at line 334 of file PatternMatch.h.

◆ m_NegZeroFP()

cstfp_pred_ty<is_neg_zero_fp> llvm::PatternMatch::m_NegZeroFP ( )
inline

Match a floating-point negative zero.

For vectors, this includes constants with undefined elements.

Definition at line 454 of file PatternMatch.h.

Referenced by SimplifyFAddInst(), SimplifyFRemInst(), and SimplifyFSubInst().

◆ m_NonNegative() [1/2]

cst_pred_ty<is_nonnegative> llvm::PatternMatch::m_NonNegative ( )
inline

Match an integer or vector of nonnegative values.

For vectors, this includes constants with undefined elements.

Definition at line 343 of file PatternMatch.h.

Referenced by foldICmpWithLowBitMaskedVal(), and llvm::InstCombiner::visitXor().

◆ m_NonNegative() [2/2]

api_pred_ty<is_nonnegative> llvm::PatternMatch::m_NonNegative ( const APInt *&  V)
inline

Definition at line 346 of file PatternMatch.h.

◆ m_Not()

template<typename ValTy >
BinaryOp_match<ValTy, cst_pred_ty<is_all_ones>, Instruction::Xor, true> llvm::PatternMatch::m_Not ( const ValTy &  V)
inline

◆ m_NSWAdd()

template<typename LHS , typename RHS >
OverflowingBinaryOp_match<LHS, RHS, Instruction::Add, OverflowingBinaryOperator::NoSignedWrap> llvm::PatternMatch::m_NSWAdd ( const LHS &  L,
const RHS &  R 
)
inline

◆ m_NSWMul()

template<typename LHS , typename RHS >
OverflowingBinaryOp_match<LHS, RHS, Instruction::Mul, OverflowingBinaryOperator::NoSignedWrap> llvm::PatternMatch::m_NSWMul ( const LHS &  L,
const RHS &  R 
)
inline

◆ m_NSWShl()

template<typename LHS , typename RHS >
OverflowingBinaryOp_match<LHS, RHS, Instruction::Shl, OverflowingBinaryOperator::NoSignedWrap> llvm::PatternMatch::m_NSWShl ( const LHS &  L,
const RHS &  R 
)
inline

◆ m_NSWSub()

template<typename LHS , typename RHS >
OverflowingBinaryOp_match<LHS, RHS, Instruction::Sub, OverflowingBinaryOperator::NoSignedWrap> llvm::PatternMatch::m_NSWSub ( const LHS &  L,
const RHS &  R 
)
inline

◆ m_NUWAdd()

template<typename LHS , typename RHS >
OverflowingBinaryOp_match<LHS, RHS, Instruction::Add, OverflowingBinaryOperator::NoUnsignedWrap> llvm::PatternMatch::m_NUWAdd ( const LHS &  L,
const RHS &  R 
)
inline

◆ m_NUWMul()

template<typename LHS , typename RHS >
OverflowingBinaryOp_match<LHS, RHS, Instruction::Mul, OverflowingBinaryOperator::NoUnsignedWrap> llvm::PatternMatch::m_NUWMul ( const LHS &  L,
const RHS &  R 
)
inline

◆ m_NUWShl()

template<typename LHS , typename RHS >
OverflowingBinaryOp_match<LHS, RHS, Instruction::Shl, OverflowingBinaryOperator::NoUnsignedWrap> llvm::PatternMatch::m_NUWShl ( const LHS &  L,
const RHS &  R 
)
inline

◆ m_NUWSub()

template<typename LHS , typename RHS >
OverflowingBinaryOp_match<LHS, RHS, Instruction::Sub, OverflowingBinaryOperator::NoUnsignedWrap> llvm::PatternMatch::m_NUWSub ( const LHS &  L,
const RHS &  R 
)
inline

Definition at line 853 of file PatternMatch.h.

References llvm::OverflowingBinaryOperator::NoUnsignedWrap.

◆ m_One()

cst_pred_ty<is_one> llvm::PatternMatch::m_One ( )
inline

◆ m_OneUse()

template<typename T >
OneUse_match<T> llvm::PatternMatch::m_OneUse ( const T SubPattern)
inline

◆ m_Or()

template<typename LHS , typename RHS >
BinaryOp_match<LHS, RHS, Instruction::Or> llvm::PatternMatch::m_Or ( const LHS &  L,
const RHS &  R 
)
inline

◆ m_OrdFMax()

template<typename LHS , typename RHS >
MaxMin_match<FCmpInst, LHS, RHS, ofmax_pred_ty> llvm::PatternMatch::m_OrdFMax ( const LHS &  L,
const RHS &  R 
)
inline

Match an 'ordered' floating point maximum function.

Floating point has one special value 'NaN'. Therefore, there is no total order. However, if we can ignore the 'NaN' value (for example, because of a 'no-nans-float-math' flag) a combination of a fcmp and select has 'maximum' semantics. In the presence of 'NaN' we have to preserve the original select(fcmp(ogt/ge, L, R), L, R) semantics matched by this predicate.

                    max(L, R)  iff L and R are not NaN

m_OrdFMax(L, R) = R iff L or R are NaN

Definition at line 1385 of file PatternMatch.h.

Referenced by createRdxShuffleMask(), getReductionData(), llvm::RecurrenceDescriptor::isMinMaxSelectCmpPattern(), and matchFastFloatClamp().

◆ m_OrdFMin()

template<typename LHS , typename RHS >
MaxMin_match<FCmpInst, LHS, RHS, ofmin_pred_ty> llvm::PatternMatch::m_OrdFMin ( const LHS &  L,
const RHS &  R 
)
inline

Match an 'ordered' floating point minimum function.

Floating point has one special value 'NaN'. Therefore, there is no total order. However, if we can ignore the 'NaN' value (for example, because of a 'no-nans-float-math' flag) a combination of a fcmp and select has 'minimum' semantics. In the presence of 'NaN' we have to preserve the original select(fcmp(olt/le, L, R), L, R) semantics matched by this predicate.

                    min(L, R)  iff L and R are not NaN

m_OrdFMin(L, R) = R iff L or R are NaN

Definition at line 1400 of file PatternMatch.h.

Referenced by createRdxShuffleMask(), getReductionData(), llvm::RecurrenceDescriptor::isMinMaxSelectCmpPattern(), and matchFastFloatClamp().

◆ m_PosZeroFP()

cstfp_pred_ty<is_pos_zero_fp> llvm::PatternMatch::m_PosZeroFP ( )
inline

◆ m_Power2() [1/2]

cst_pred_ty<is_power2> llvm::PatternMatch::m_Power2 ( )
inline

◆ m_Power2() [2/2]

api_pred_ty<is_power2> llvm::PatternMatch::m_Power2 ( const APInt *&  V)
inline

Definition at line 388 of file PatternMatch.h.

◆ m_Power2OrZero() [1/2]

cst_pred_ty<is_power2_or_zero> llvm::PatternMatch::m_Power2OrZero ( )
inline

Match an integer or vector of 0 or power-of-2 values.

For vectors, this includes constants with undefined elements.

Definition at line 397 of file PatternMatch.h.

Referenced by isKnownToBeAPowerOfTwo().

◆ m_Power2OrZero() [2/2]

api_pred_ty<is_power2_or_zero> llvm::PatternMatch::m_Power2OrZero ( const APInt *&  V)
inline

Definition at line 400 of file PatternMatch.h.

◆ m_PtrToInt()

template<typename OpTy >
CastClass_match<OpTy, Instruction::PtrToInt> llvm::PatternMatch::m_PtrToInt ( const OpTy &  Op)
inline

◆ m_SDiv()

template<typename LHS , typename RHS >
BinaryOp_match<LHS, RHS, Instruction::SDiv> llvm::PatternMatch::m_SDiv ( const LHS &  L,
const RHS &  R 
)
inline

◆ m_Select()

template<typename Cond , typename LHS , typename RHS >
ThreeOps_match<Cond, LHS, RHS, Instruction::Select> llvm::PatternMatch::m_Select ( const Cond &  C,
const LHS &  L,
const RHS &  R 
)
inline

◆ m_SelectCst()

template<int64_t L, int64_t R, typename Cond >
ThreeOps_match<Cond, constantint_match<L>, constantint_match<R>, Instruction::Select> llvm::PatternMatch::m_SelectCst ( const Cond &  C)
inline

This matches a select of two constants, e.g.

: m_SelectCst<-1, 0>(m_Value(V))

Definition at line 1091 of file PatternMatch.h.

References m_Select().

◆ m_SExt()

template<typename OpTy >
CastClass_match<OpTy, Instruction::SExt> llvm::PatternMatch::m_SExt ( const OpTy &  Op)
inline

◆ m_Shift()

template<typename LHS , typename RHS >
BinOpPred_match<LHS, RHS, is_shift_op> llvm::PatternMatch::m_Shift ( const LHS &  L,
const RHS &  R 
)
inline

Matches shift operations.

Definition at line 926 of file PatternMatch.h.

Referenced by llvm::AssumptionCache::updateAffectedValues().

◆ m_Shl()

template<typename LHS , typename RHS >
BinaryOp_match<LHS, RHS, Instruction::Shl> llvm::PatternMatch::m_Shl ( const LHS &  L,
const RHS &  R 
)
inline

◆ m_Shr()

template<typename LHS , typename RHS >
BinOpPred_match<LHS, RHS, is_right_shift_op> llvm::PatternMatch::m_Shr ( const LHS &  L,
const RHS &  R 
)
inline

◆ m_ShuffleVector()

template<typename V1_t , typename V2_t , typename Mask_t >
ThreeOps_match<V1_t, V2_t, Mask_t, Instruction::ShuffleVector> llvm::PatternMatch::m_ShuffleVector ( const V1_t &  v1,
const V2_t &  v2,
const Mask_t &  m 
)
inline

◆ m_SignMask()

cst_pred_ty<is_sign_mask> llvm::PatternMatch::m_SignMask ( )
inline

Match an integer or vector with only the sign bit(s) set.

For vectors, this includes constants with undefined elements.

Definition at line 409 of file PatternMatch.h.

Referenced by isKnownToBeAPowerOfTwo(), and SimplifyAddInst().

◆ m_Signum()

template<typename Val_t >
Signum_match<Val_t> llvm::PatternMatch::m_Signum ( const Val_t &  V)
inline

Matches a signum pattern.

signum(x) = x > 0 -> 1 x == 0 -> 0 x < 0 -> -1

Definition at line 1750 of file PatternMatch.h.

Referenced by processUGT_ADDCST_ADD().

◆ m_SIToFP()

template<typename OpTy >
CastClass_match<OpTy, Instruction::SIToFP> llvm::PatternMatch::m_SIToFP ( const OpTy &  Op)
inline

Matches SIToFP.

Definition at line 1193 of file PatternMatch.h.

Referenced by llvm::InstCombiner::visitICmpInst().

◆ m_SMax()

template<typename LHS , typename RHS >
MaxMin_match<ICmpInst, LHS, RHS, smax_pred_ty> llvm::PatternMatch::m_SMax ( const LHS &  L,
const RHS &  R 
)
inline

◆ m_SMin()

template<typename LHS , typename RHS >
MaxMin_match<ICmpInst, LHS, RHS, smin_pred_ty> llvm::PatternMatch::m_SMin ( const LHS &  L,
const RHS &  R 
)
inline

◆ m_Specific()

specificval_ty llvm::PatternMatch::m_Specific ( const Value V)
inline

Match if we have a specific specified value.

Definition at line 502 of file PatternMatch.h.

Referenced by areInverseVectorBitmasks(), canNarrowShiftAmt(), canonicalizeSaturatedSubtract(), llvm::InstCombiner::commonIDivTransforms(), computeKnownBitsFromAssume(), createRdxShuffleMask(), factorizeFAddFSub(), foldGuardedRotateToFunnelShift(), foldICmpShlOne(), foldICmpWithMinMax(), foldICmpWithTruncSignExtendedVal(), foldOrToXor(), foldSelectBinOpIdentity(), foldSelectICmpAndAnd(), foldSelectICmpAndOr(), foldSelectShuffleWith1Binop(), foldSelectWithBinaryOp(), llvm::InstCombiner::FoldShiftByConstant(), foldSignedTruncationCheck(), foldVectorCmp(), foldVecTruncToExtElt(), foldXorToXor(), getBinOpsForFactorization(), GetLoopInvariantInsertPosition(), getValueFromICmpCondition(), llvm::haveNoCommonBitsSet(), llvm::isKnownNegation(), isKnownNonNullFromDominatingCondition(), isKnownToBeAPowerOfTwo(), isMinMaxWithLoads(), isObjectDereferencedInBlock(), isTruePredicate(), matchClamp(), matchFastFloatClamp(), matchMinMax(), matchMinMaxOfMinMax(), matchRotate(), matchSelectPattern(), processUGT_ADDCST_ADD(), replaceAllUsesOfWithIn(), shouldMergeGEPs(), SimplifyAddInst(), SimplifyAndInst(), simplifyAndOfICmpsWithAdd(), simplifyAndOfICmpsWithSameOperands(), simplifyAndOrOfICmpsWithZero(), SimplifyAShrInst(), simplifyDiv(), SimplifyFAddInst(), SimplifyFDivInst(), SimplifyFSubInst(), SimplifyGEPInst(), simplifyICmpWithBinOp(), SimplifyLShrInst(), SimplifyMulInst(), SimplifyOrInst(), simplifyOrOfICmpsWithAdd(), simplifyOrOfICmpsWithSameOperands(), simplifyRem(), simplifySelectBitTest(), simplifySelectWithFCmp(), SimplifyShlInst(), simplifyUnsignedRangeCheck(), SimplifyXorInst(), swapMayExposeCSEOpportunities(), truncateIVUse(), tryToMoveFreeBeforeNullTest(), llvm::InstCombiner::visitAdd(), llvm::InstCombiner::visitAnd(), llvm::InstCombiner::visitAShr(), llvm::InstCombiner::visitCallInst(), llvm::InstCombiner::visitFDiv(), llvm::InstCombiner::visitFMul(), llvm::InstCombiner::visitFSub(), llvm::InstCombiner::visitGetElementPtrInst(), llvm::InstCombiner::visitLShr(), llvm::InstCombiner::visitOr(), llvm::InstCombiner::visitShl(), llvm::InstCombiner::visitSub(), llvm::InstCombiner::visitUDiv(), llvm::InstCombiner::visitXor(), and llvm::InstCombiner::visitZExt().

◆ m_SpecificFP()

specific_fpval llvm::PatternMatch::m_SpecificFP ( double  V)
inline

Match a specific floating point value or vector with all elements equal to the value.

Definition at line 540 of file PatternMatch.h.

Referenced by getPow(), getSqrtCall(), m_FPOne(), and llvm::InstCombiner::visitFMul().

◆ m_SpecificInt()

specific_intval llvm::PatternMatch::m_SpecificInt ( uint64_t  V)
inline

Match a specific integer value or vector with all elements equal to the value.

Definition at line 579 of file PatternMatch.h.

Referenced by canonicalizeSaturatedSubtract(), foldGuardedRotateToFunnelShift(), foldVecTruncToExtElt(), llvm::PatternMatch::Signum_match< Opnd_t >::match(), matchRotate(), SimplifyGEPInst(), and splitMergedValStore().

◆ m_SRem()

template<typename LHS , typename RHS >
BinaryOp_match<LHS, RHS, Instruction::SRem> llvm::PatternMatch::m_SRem ( const LHS &  L,
const RHS &  R 
)
inline

◆ m_Store()

template<typename ValueOpTy , typename PointerOpTy >
TwoOps_match<ValueOpTy, PointerOpTy, Instruction::Store> llvm::PatternMatch::m_Store ( const ValueOpTy &  ValueOp,
const PointerOpTy &  PointerOp 
)
inline

Matches StoreInst.

Definition at line 1127 of file PatternMatch.h.

◆ m_Sub()

template<typename LHS , typename RHS >
BinaryOp_match<LHS, RHS, Instruction::Sub> llvm::PatternMatch::m_Sub ( const LHS &  L,
const RHS &  R 
)
inline

◆ m_Trunc()

template<typename OpTy >
CastClass_match<OpTy, Instruction::Trunc> llvm::PatternMatch::m_Trunc ( const OpTy &  Op)
inline

◆ m_UAddWithOverflow()

template<typename LHS_t , typename RHS_t , typename Sum_t >
UAddWithOverflow_match<LHS_t, RHS_t, Sum_t> llvm::PatternMatch::m_UAddWithOverflow ( const LHS_t &  L,
const RHS_t &  R,
const Sum_t &  S 
)

Match an icmp instruction checking for unsigned overflow on addition.

S is matched to the addition whose result is being checked for overflow, and L and R are matched to the LHS and RHS of S.

Definition at line 1477 of file PatternMatch.h.

Referenced by CombineUAddWithOverflow(), and llvm::InstCombiner::visitICmpInst().

◆ m_UDiv()

template<typename LHS , typename RHS >
BinaryOp_match<LHS, RHS, Instruction::UDiv> llvm::PatternMatch::m_UDiv ( const LHS &  L,
const RHS &  R 
)
inline

◆ m_UIToFP()

template<typename OpTy >
CastClass_match<OpTy, Instruction::UIToFP> llvm::PatternMatch::m_UIToFP ( const OpTy &  Op)
inline

Matches UIToFP.

Definition at line 1187 of file PatternMatch.h.

Referenced by simplifyICmpWithConstant(), and llvm::InstCombiner::visitICmpInst().

◆ m_UMax()

template<typename LHS , typename RHS >
MaxMin_match<ICmpInst, LHS, RHS, umax_pred_ty> llvm::PatternMatch::m_UMax ( const LHS &  L,
const RHS &  R 
)
inline

◆ m_UMin()

template<typename LHS , typename RHS >
MaxMin_match<ICmpInst, LHS, RHS, umin_pred_ty> llvm::PatternMatch::m_UMin ( const LHS &  L,
const RHS &  R 
)
inline

◆ m_UnconditionalBr()

br_match llvm::PatternMatch::m_UnconditionalBr ( BasicBlock *&  Succ)
inline

Definition at line 1228 of file PatternMatch.h.

Referenced by tryToMoveFreeBeforeNullTest().

◆ m_Undef()

class_match<UndefValue> llvm::PatternMatch::m_Undef ( )
inline

◆ m_UnordFMax()

template<typename LHS , typename RHS >
MaxMin_match<FCmpInst, LHS, RHS, ufmax_pred_ty> llvm::PatternMatch::m_UnordFMax ( const LHS &  L,
const RHS &  R 
)
inline

Match an 'unordered' floating point maximum function.

Floating point has one special value 'NaN'. Therefore, there is no total order. However, if we can ignore the 'NaN' value (for example, because of a 'no-nans-float-math' flag) a combination of a fcmp and select has 'maximum' semantics. In the presence of 'NaN' we have to preserve the original select(fcmp(ugt/ge, L, R), L, R) semantics matched by this predicate.

                    max(L, R)  iff L and R are not NaN

m_UnordFMax(L, R) = L iff L or R are NaN

Definition at line 1416 of file PatternMatch.h.

Referenced by createRdxShuffleMask(), getReductionData(), llvm::RecurrenceDescriptor::isMinMaxSelectCmpPattern(), and matchFastFloatClamp().

◆ m_UnordFMin()

template<typename LHS , typename RHS >
MaxMin_match<FCmpInst, LHS, RHS, ufmin_pred_ty> llvm::PatternMatch::m_UnordFMin ( const LHS &  L,
const RHS &  R 
)
inline

Match an 'unordered' floating point minimum function.

Floating point has one special value 'NaN'. Therefore, there is no total order. However, if we can ignore the 'NaN' value (for example, because of a 'no-nans-float-math' flag) a combination of a fcmp and select has 'minimum' semantics. In the presence of 'NaN' we have to preserve the original select(fcmp(ult/le, L, R), L, R) semantics matched by this predicate.

                     min(L, R)  iff L and R are not NaN

m_UnordFMin(L, R) = L iff L or R are NaN

Definition at line 1431 of file PatternMatch.h.

Referenced by createRdxShuffleMask(), getReductionData(), llvm::RecurrenceDescriptor::isMinMaxSelectCmpPattern(), and matchFastFloatClamp().

◆ m_URem()

template<typename LHS , typename RHS >
BinaryOp_match<LHS, RHS, Instruction::URem> llvm::PatternMatch::m_URem ( const LHS &  L,
const RHS &  R 
)
inline

◆ m_Value() [1/3]

class_match<Value> llvm::PatternMatch::m_Value ( )
inline

Match an arbitrary value and ignore it.

Definition at line 71 of file PatternMatch.h.

Referenced by areInverseVectorBitmasks(), buildMultiplyTree(), canAlwaysEvaluateInType(), canEvaluateShifted(), canNarrowShiftAmt(), llvm::CannotBeNegativeZero(), canonicalizeLowbitMask(), canonicalizeSaturatedSubtract(), cheapToScalarize(), checkForNegativeOperand(), llvm::collectCmpOps(), combineLoadToNewType(), CombineUAddWithOverflow(), llvm::InstCombiner::commonIDivTransforms(), llvm::InstCombiner::commonShiftTransforms(), computeKnownBitsFromAssume(), computeKnownBitsFromOperator(), llvm::JumpThreadingPass::ComputeValueKnownInPredecessorsImpl(), countToEliminateCompares(), createAndInstr(), createRdxShuffleMask(), llvm::createSeparateConstOffsetFromGEPPass(), llvm::decomposeBitTestICmp(), EvaluateConstantChrecAtConstant(), factorizeFAddFSub(), llvm::SelectionDAGBuilder::FindMergedConditions(), llvm::findScalarElement(), foldAndOrOfEqualityCmpsWithConstants(), foldAndToXor(), foldAnyOrAllBitsSet(), foldBitCastBitwiseLogic(), foldBitcastExtElt(), foldBitCastSelect(), foldFabsWithFcmpZero(), foldFDivConstantDividend(), foldFDivConstantDivisor(), foldGuardedRotateToFunnelShift(), foldICmpShlOne(), foldICmpWithHighBitMask(), foldICmpWithLowBitMaskedVal(), foldICmpWithMinMax(), foldICmpWithTruncSignExtendedVal(), foldIdentityExtractShuffle(), foldLogicCastConstant(), foldOrToXor(), foldSelectBinOpIdentity(), foldSelectICmpAnd(), foldSelectICmpAndAnd(), foldSelectICmpAndOr(), foldSelectShuffle(), foldSelectWithBinaryOp(), llvm::InstCombiner::FoldShiftByConstant(), foldShuffleWithInsert(), foldSignedTruncationCheck(), foldUDivShl(), foldVectorCmp(), foldVecTruncToExtElt(), foldXorToXor(), getBinOpsForFactorization(), llvm::getComplexity(), GetConstantInt(), GetLoopInvariantInsertPosition(), getMaskedTypeForICmpPair(), getRangeForAffineARHelper(), getReductionData(), getSelectFoldableConstant(), getSqrtCall(), hasOnlyOneNonZeroIndex(), llvm::haveNoCommonBitsSet(), hoistInsEltConst(), llvm::RecurrenceDescriptor::isConditionalRdxPattern(), llvm::IsFreeToInvert(), isGEPFoldable(), llvm::isImpliedByDomCondition(), isImpliedCondAndOr(), llvm::isKnownNegation(), isKnownNonZero(), IsKnownPredicateViaMinOrMax(), isKnownToBeAPowerOfTwo(), llvm::ScalarEvolution::isLoopInvariantPredicate(), llvm::RecurrenceDescriptor::isMinMaxSelectCmpPattern(), isMinMaxWithLoads(), IsNarrowSequence(), isObjectDereferencedInBlock(), isOnlyReachableViaThisEdge(), isReassociableOp(), isTruePredicate(), LinearizeExprTree(), llvm::PatternMatch::UAddWithOverflow_match< LHS_t, RHS_t, Sum_t >::match(), llvm::PatternMatch::Signum_match< Opnd_t >::match(), matchAndOrChain(), matchDeMorgansLaws(), MatchDiv(), matchesAdd(), matchesOr(), MatchMul(), MatchRem(), matchRotate(), narrowUDivURem(), narrowVectorSelect(), NegateValue(), OptimizeAndOrXor(), optimizeTrigReflections(), processUGT_ADDCST_ADD(), processUMulZExtIdiom(), recordCondition(), removeBitcastsFromLoadStoreOnMinMax(), replaceAllUsesOfWithIn(), llvm::InstCombiner::replacedSelectWithOperand(), llvm::LoopPredicationPass::run(), scaleWeights(), llvm::FastISel::selectFNeg(), ShouldBreakUpSubtract(), shouldMergeGEPs(), ShrinkDemandedConstant(), SimplifyAddInst(), SimplifyAndInst(), simplifyAndOfICmpsWithAdd(), simplifyAndOfICmpsWithSameOperands(), simplifyAndOrOfICmpsWithZero(), SimplifyAShrInst(), simplifyAssocCastAssoc(), SimplifyBSwap(), simplifyDiv(), simplifyDivRem(), SimplifyFAddInst(), SimplifyFDivInst(), SimplifyFMulInst(), SimplifyFSubInst(), SimplifyGEPInst(), simplifyICmpWithBinOp(), simplifyICmpWithConstant(), simplifyICmpWithMinMax(), SimplifyLShrInst(), SimplifyMulInst(), SimplifyOrInst(), simplifyOrOfICmpsWithAdd(), simplifyOrOfICmpsWithSameOperands(), simplifyRem(), simplifySelectWithICmpCond(), SimplifyShift(), SimplifyShlInst(), SimplifySRemInst(), SimplifySubInst(), simplifyUnaryIntrinsic(), simplifyUnsignedRangeCheck(), simplifyValueKnownNonZero(), simplifyX86movmsk(), sinkNotIntoXor(), splitMergedValStore(), truncateIVUse(), unifyBitWidth(), llvm::AssumptionCache::updateAffectedValues(), llvm::InstCombiner::visitAdd(), llvm::InstCombiner::visitAnd(), llvm::InstCombiner::visitAShr(), llvm::InstCombiner::visitBranchInst(), llvm::InstCombiner::visitCallInst(), llvm::InstCombiner::visitExtractElementInst(), llvm::InstCombiner::visitFAdd(), llvm::InstCombiner::visitFCmpInst(), llvm::InstCombiner::visitFDiv(), llvm::InstCombiner::visitFMul(), llvm::InstCombiner::visitFPTrunc(), llvm::InstCombiner::visitFSub(), llvm::InstCombiner::visitGetElementPtrInst(), llvm::InstCombiner::visitICmpInst(), llvm::InstCombiner::visitInsertElementInst(), llvm::InstCombiner::visitLShr(), visitMaskedMerge(), llvm::InstCombiner::visitMul(), llvm::InstCombiner::visitOr(), llvm::InstCombiner::visitSDiv(), llvm::InstCombiner::visitSExt(), llvm::InstCombiner::visitShl(), llvm::InstCombiner::visitSub(), llvm::InstCombiner::visitSwitchInst(), llvm::InstCombiner::visitTrunc(), llvm::InstCombiner::visitUDiv(), visitUDivOperand(), llvm::InstCombiner::visitURem(), llvm::InstCombiner::visitXor(), and llvm::InstCombiner::visitZExt().

◆ m_Value() [2/3]

bind_ty<Value> llvm::PatternMatch::m_Value ( Value *&  V)
inline

Match a value, capturing it if we match.

Definition at line 475 of file PatternMatch.h.

◆ m_Value() [3/3]

bind_ty<const Value> llvm::PatternMatch::m_Value ( const Value *&  V)
inline

Definition at line 476 of file PatternMatch.h.

◆ m_Xor()

template<typename LHS , typename RHS >
BinaryOp_match<LHS, RHS, Instruction::Xor> llvm::PatternMatch::m_Xor ( const LHS &  L,
const RHS &  R 
)
inline

◆ m_Zero()

is_zero llvm::PatternMatch::m_Zero ( )
inline

◆ m_ZeroInt()

cst_pred_ty<is_zero_int> llvm::PatternMatch::m_ZeroInt ( )
inline

Match an integer 0 or a vector with all elements equal to 0.

For vectors, this includes constants with undefined elements.

Definition at line 364 of file PatternMatch.h.

Referenced by canonicalizeSaturatedSubtract(), foldGuardedRotateToFunnelShift(), llvm::isKnownNegation(), m_Neg(), matchSelectPattern(), llvm::InstCombiner::visitCallInst(), llvm::InstCombiner::visitSub(), and llvm::InstCombiner::visitZExt().

◆ m_ZExt()

template<typename OpTy >
CastClass_match<OpTy, Instruction::ZExt> llvm::PatternMatch::m_ZExt ( const OpTy &  Op)
inline

◆ m_ZExtOrSExt()

template<typename OpTy >
match_combine_or<CastClass_match<OpTy, Instruction::ZExt>, CastClass_match<OpTy, Instruction::SExt> > llvm::PatternMatch::m_ZExtOrSExt ( const OpTy &  Op)
inline

◆ match()

template<typename Val , typename Pattern >
bool llvm::PatternMatch::match ( Val *  V,
const Pattern &  P 
)

Definition at line 48 of file PatternMatch.h.

References P.

Referenced by llvm::AliasSetTracker::add(), areInverseVectorBitmasks(), buildMultiplyTree(), canAlwaysEvaluateInType(), canEvaluateShifted(), canEvaluateShiftedShift(), canEvaluateTruncated(), canEvaluateZExtd(), canNarrowShiftAmt(), llvm::CannotBeNegativeZero(), canonicalizeICmpBool(), canonicalizeLowbitMask(), canonicalizeSaturatedSubtract(), llvm::canSinkOrHoistInst(), cheapToScalarize(), checkForNegativeOperand(), llvm::collectCmpOps(), combineInstructionsOverFunction(), combineLoadToNewType(), CombineUAddWithOverflow(), llvm::InstCombiner::commonIDivTransforms(), llvm::InstCombiner::commonIRemTransforms(), llvm::InstCombiner::commonShiftTransforms(), computeKnownBits(), computeKnownBitsFromAssume(), computeKnownBitsFromOperator(), ComputeNumSignBitsImpl(), llvm::JumpThreadingPass::ComputeValueKnownInPredecessorsImpl(), llvm::ConstantFoldBinaryInstruction(), countToEliminateCompares(), createAndInstr(), CreateLoadIns(), createRdxShuffleMask(), llvm::createSeparateConstOffsetFromGEPPass(), llvm::decomposeBitTestICmp(), despeculateCountZeros(), EvaluateConstantChrecAtConstant(), factorizeFAddFSub(), llvm::SelectionDAGBuilder::FindMergedConditions(), llvm::findScalarElement(), foldAndOrOfEqualityCmpsWithConstants(), foldAndToXor(), foldAnyOrAllBitsSet(), foldBitCastBitwiseLogic(), foldBitcastExtElt(), foldBitCastSelect(), foldConstantInsEltIntoShuffle(), foldCttzCtlz(), foldFabsWithFcmpZero(), foldFCmpReciprocalAndZero(), foldFDivConstantDividend(), foldFDivConstantDivisor(), foldGuardedRotateToFunnelShift(), foldICmpShlOne(), foldICmpWithHighBitMask(), foldICmpWithLowBitMaskedVal(), foldICmpWithMinMax(), foldICmpWithTruncSignExtendedVal(), foldIdentityExtractShuffle(), foldLogicCastConstant(), foldOrToXor(), foldSelectBinOpIdentity(), foldSelectICmpAnd(), foldSelectICmpAndAnd(), foldSelectICmpAndOr(), foldSelectShuffle(), foldSelectShuffleWith1Binop(), foldSelectWithBinaryOp(), llvm::InstCombiner::FoldShiftByConstant(), foldShiftedShift(), foldShuffleWithInsert(), foldSignedTruncationCheck(), foldUDivShl(), foldVectorCmp(), foldVecTruncToExtElt(), foldXorToXor(), llvm::itanium_demangle::ForwardTemplateReference::ForwardTemplateReference(), getAlternateBinop(), llvm::GCNTTIImpl::getArithmeticInstrCost(), getBinOpsForFactorization(), llvm::getComplexity(), GetConstantInt(), getDemandedBitsLHSMask(), llvm::getGEPInductionOperand(), getLogBase2(), GetLoopInvariantInsertPosition(), getMaskedTypeForICmpPair(), getPow(), getRangeForAffineARHelper(), getReductionData(), llvm::SCEVExpander::getRelatedExistingExpansion(), getSelectFoldableConstant(), getSqrtCall(), getValueFromICmpCondition(), hasOnlyOneNonZeroIndex(), llvm::haveNoCommonBitsSet(), hoistInsEltConst(), llvm::hoistRegion(), isAlwaysLive(), llvm::RecurrenceDescriptor::isConditionalRdxPattern(), isDivZero(), llvm::IsFreeToInvert(), isGEPFoldable(), llvm::isGuaranteedToTransferExecutionToSuccessor(), llvm::isGuard(), llvm::isImpliedByDomCondition(), isImpliedCondAndOr(), llvm::isKnownNegation(), isKnownNonNullFromDominatingCondition(), isKnownNonZero(), IsKnownPredicateViaMinOrMax(), isKnownToBeAPowerOfTwo(), llvm::ScalarEvolution::isLoopInvariantPredicate(), isLoopNeverExecuted(), isMinMaxWithLoads(), IsNarrowSequence(), isObjectDereferencedInBlock(), isOnlyReachableViaThisEdge(), isReassociableOp(), llvm::isSafeToSpeculativelyExecute(), isSelect01(), isSignedMinMaxClamp(), isTruePredicate(), LinearizeExprTree(), lookThroughAnd(), lookThroughCast(), MaintainNoSignedWrap(), markAliveBlocks(), llvm::FileCheckPattern::Match(), llvm::PatternMatch::MaxMin_match< CmpInst_t, LHS_t, RHS_t, Pred_t, Commutable >::match(), matchAndOrChain(), matchClamp(), matchDeMorgansLaws(), MatchDiv(), matchesAdd(), matchesOr(), matchFastFloatClamp(), matchMinMax(), matchMinMaxOfMinMax(), MatchMul(), MatchRem(), matchRotate(), matchSelectPattern(), llvm::AliasSet::mergeSetIn(), narrowUDivURem(), narrowVectorSelect(), NegateValue(), OptimizeAndOrXor(), optimizeTrigReflections(), PickMostRelevantLoop(), processUGT_ADDCST_ADD(), processUMulZExtIdiom(), recordCondition(), llvm::AssumptionCache::registerAssumption(), removeBitcastsFromLoadStoreOnMinMax(), replaceAllUsesOfWithIn(), llvm::InstCombiner::replacedSelectWithOperand(), llvm::LoopPredicationPass::run(), scaleWeights(), llvm::FastISel::selectFNeg(), setLimitsForBinOp(), setLimitsForIntrinsic(), ShouldBreakUpSubtract(), shouldMergeGEPs(), ShrinkDemandedConstant(), SimplifyAddInst(), SimplifyAndInst(), simplifyAndOfICmpsWithAdd(), simplifyAndOfICmpsWithSameOperands(), simplifyAndOrOfICmpsWithConstants(), simplifyAndOrOfICmpsWithZero(), SimplifyAShrInst(), simplifyAssocCastAssoc(), simplifyBinaryIntrinsic(), SimplifyBSwap(), simplifyDiv(), simplifyDivRem(), llvm::InstCombiner::simplifyDivRemOfSelectWithZeroOp(), SimplifyFAddInst(), SimplifyFCmpInst(), SimplifyFDivInst(), SimplifyFMulInst(), simplifyFPBinop(), SimplifyFRemInst(), SimplifyFSubInst(), SimplifyGEPInst(), simplifyICmpOfBools(), simplifyICmpWithAbsNabs(), simplifyICmpWithBinOp(), simplifyICmpWithConstant(), simplifyICmpWithMinMax(), simplifyICmpWithZero(), SimplifyInsertValueInst(), simplifyIntrinsic(), SimplifyLShrInst(), SimplifyMulInst(), SimplifyOrInst(), simplifyOrOfICmpsWithAdd(), simplifyOrOfICmpsWithSameOperands(), simplifyRem(), SimplifyRightShift(), simplifySelectBitTest(), simplifySelectWithFCmp(), simplifySelectWithICmpCond(), SimplifyShift(), SimplifyShlInst(), SimplifySRemInst(), SimplifySubInst(), simplifyUnaryIntrinsic(), simplifyUnsignedRangeCheck(), simplifyValueKnownNonZero(), simplifyX86movmsk(), SimplifyXorInst(), sinkNotIntoXor(), splitMergedValStore(), swapMayExposeCSEOpportunities(), ThreadCmpOverSelect(), truncateIVUse(), tryToMoveFreeBeforeNullTest(), unifyBitWidth(), llvm::AssumptionCache::updateAffectedValues(), llvm::AssumptionCacheTracker::verifyAnalysis(), llvm::InstCombiner::visitAdd(), llvm::InstCombiner::visitAnd(), llvm::InstCombiner::visitAShr(), llvm::InstCombiner::visitBranchInst(), llvm::InstCombiner::visitCallInst(), llvm::InstCombiner::visitExtractElementInst(), llvm::InstCombiner::visitFAdd(), llvm::InstCombiner::visitFCmpInst(), llvm::InstCombiner::visitFDiv(), llvm::InstCombiner::visitFMul(), llvm::InstCombiner::visitFPTrunc(), llvm::InstCombiner::visitFSub(), llvm::InstCombiner::visitGetElementPtrInst(), llvm::InstCombiner::visitICmpInst(), llvm::InstCombiner::visitInsertElementInst(), llvm::InstCombiner::visitLShr(), visitMaskedMerge(), llvm::InstCombiner::visitMul(), llvm::InstCombiner::visitOr(), llvm::InstCombiner::visitPHINode(), llvm::InstCombiner::visitSDiv(), llvm::InstCombiner::visitSExt(), llvm::InstCombiner::visitShl(), llvm::InstCombiner::visitSRem(), llvm::InstCombiner::visitSub(), llvm::InstCombiner::visitSwitchInst(), llvm::InstCombiner::visitTrunc(), llvm::InstCombiner::visitUDiv(), visitUDivOperand(), llvm::InstCombiner::visitURem(), llvm::InstCombiner::visitXor(), llvm::InstCombiner::visitZExt(), and llvm::reassociate::XorOpnd::XorOpnd().