LLVM  5.0.0
Classes | Functions
llvm::PatternMatch Namespace Reference

Classes

struct  OneUse_match
 
struct  class_match
 
struct  match_combine_or
 Matching combinators. More...
 
struct  match_combine_and
 
struct  match_zero
 
struct  match_neg_zero
 
struct  match_any_zero
 
struct  match_nan
 
struct  match_one
 
struct  match_all_ones
 
struct  match_sign_mask
 
struct  apint_match
 
struct  constantint_match
 
struct  cst_pred_ty
 This helper class is used to match scalar and vector constants that satisfy a specified predicate. More...
 
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  is_power2
 
struct  is_maxsignedvalue
 
struct  bind_ty
 
struct  specificval_ty
 Match a specified Value*. More...
 
struct  specific_fpval
 Match a specified floating point value or vector of all elements of that value. More...
 
struct  bind_const_intval_ty
 
struct  specific_intval
 Match a specified integer value or vector of all elements of that. More...
 
struct  AnyBinaryOp_match
 
struct  BinaryOp_match
 
struct  OverflowingBinaryOp_match
 
struct  BinOpPred_match
 
struct  is_shift_op
 
struct  is_right_shift_op
 
struct  is_logical_shift_op
 
struct  is_bitwiselogic_op
 
struct  is_idiv_op
 
struct  Exact_match
 
struct  CmpClass_match
 
struct  SelectClass_match
 
struct  CastClass_match
 
struct  not_match
 
struct  neg_match
 
struct  fneg_match
 
struct  br_match
 
struct  brc_match
 
struct  MaxMin_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  umax_pred_ty
 Helper class for identifying unsigned max predicates. More...
 
struct  umin_pred_ty
 Helper class for identifying unsigned min predicates. More...
 
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  ufmax_pred_ty
 Helper class for identifying unordered max predicates. More...
 
struct  ufmin_pred_ty
 Helper class for identifying unordered min predicates. More...
 
struct  UAddWithOverflow_match
 
struct  Argument_match
 
struct  IntrinsicID_match
 Intrinsic matchers. More...
 
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  Signum_match
 

Functions

template<typename Val , typename Pattern >
bool match (Val *V, const Pattern &P)
 
template<typename T >
OneUse_match< T > m_OneUse (const T &SubPattern)
 
class_match< Value > m_Value ()
 Match an arbitrary value and ignore it. More...
 
class_match< BinaryOperator > m_BinOp ()
 Match an arbitrary binary operation and ignore it. More...
 
class_match< CmpInst > m_Cmp ()
 Matches any compare instruction and ignore it. More...
 
class_match< ConstantInt > m_ConstantInt ()
 Match an arbitrary ConstantInt and ignore it. More...
 
class_match< UndefValue > m_Undef ()
 Match an arbitrary undef constant. More...
 
class_match< Constant > m_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...
 
match_zero m_Zero ()
 Match an arbitrary zero/null constant. More...
 
match_neg_zero m_NegZero ()
 Match an arbitrary zero/null constant. More...
 
match_any_zero m_AnyZero ()
 
  • Match an arbitrary zero/null constant.
More...
 
match_nan m_NaN ()
 Match an arbitrary NaN constant. This includes quiet and signalling nans. More...
 
match_one m_One ()
 Match an integer 1 or a vector with all elements equal to 1. More...
 
match_all_ones m_AllOnes ()
 Match an integer or vector with all bits set to true. More...
 
match_sign_mask m_SignMask ()
 Match an integer or vector with only the sign bit(s) set. More...
 
apint_match m_APInt (const APInt *&Res)
 Match a ConstantInt or splatted ConstantVector, binding the specified pointer to the contained APInt. More...
 
cst_pred_ty< is_power2 > m_Power2 ()
 Match an integer or vector power of 2. More...
 
api_pred_ty< is_power2 > m_Power2 (const APInt *&V)
 
cst_pred_ty< is_maxsignedvalue > m_MaxSignedValue ()
 
api_pred_ty< is_maxsignedvalue > m_MaxSignedValue (const APInt *&V)
 
bind_ty< Value > m_Value (Value *&V)
 Match a value, capturing it if we match. More...
 
bind_ty< const Value > m_Value (const Value *&V)
 
bind_ty< Instruction > m_Instruction (Instruction *&I)
 Match an instruction, capturing it if we match. More...
 
bind_ty< BinaryOperator > m_BinOp (BinaryOperator *&I)
 Match a binary operator, capturing it if we match. More...
 
bind_ty< ConstantInt > m_ConstantInt (ConstantInt *&CI)
 Match a ConstantInt, capturing the value if we match. More...
 
bind_ty< Constant > m_Constant (Constant *&C)
 Match a Constant, capturing the value if we match. More...
 
bind_ty< ConstantFP > m_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...
 
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 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::NoSignedWrap > 
m_NSWAdd (const LHS &L, const RHS &R)
 
template<typename LHS , typename RHS >
OverflowingBinaryOp_match< LHS,
RHS, Instruction::Sub,
OverflowingBinaryOperator::NoSignedWrap > 
m_NSWSub (const LHS &L, const RHS &R)
 
template<typename LHS , typename RHS >
OverflowingBinaryOp_match< LHS,
RHS, Instruction::Mul,
OverflowingBinaryOperator::NoSignedWrap > 
m_NSWMul (const LHS &L, const RHS &R)
 
template<typename LHS , typename RHS >
OverflowingBinaryOp_match< LHS,
RHS, Instruction::Shl,
OverflowingBinaryOperator::NoSignedWrap > 
m_NSWShl (const LHS &L, const RHS &R)
 
template<typename LHS , typename RHS >
OverflowingBinaryOp_match< LHS,
RHS, Instruction::Add,
OverflowingBinaryOperator::NoUnsignedWrap > 
m_NUWAdd (const LHS &L, const RHS &R)
 
template<typename LHS , typename RHS >
OverflowingBinaryOp_match< LHS,
RHS, Instruction::Sub,
OverflowingBinaryOperator::NoUnsignedWrap > 
m_NUWSub (const LHS &L, const RHS &R)
 
template<typename LHS , typename RHS >
OverflowingBinaryOp_match< LHS,
RHS, Instruction::Mul,
OverflowingBinaryOperator::NoUnsignedWrap > 
m_NUWMul (const LHS &L, const RHS &R)
 
template<typename LHS , typename RHS >
OverflowingBinaryOp_match< LHS,
RHS, Instruction::Shl,
OverflowingBinaryOperator::NoUnsignedWrap > 
m_NUWShl (const LHS &L, const RHS &R)
 
template<typename LHS , typename RHS >
BinOpPred_match< LHS, RHS,
is_shift_op > 
m_Shift (const LHS &L, const RHS &R)
 Matches shift operations. More...
 
template<typename LHS , typename RHS >
BinOpPred_match< LHS, RHS,
is_right_shift_op > 
m_Shr (const LHS &L, const RHS &R)
 Matches logical shift operations. More...
 
template<typename LHS , typename RHS >
BinOpPred_match< LHS, RHS,
is_logical_shift_op > 
m_LogicalShift (const LHS &L, const RHS &R)
 Matches logical shift operations. More...
 
template<typename LHS , typename RHS >
BinOpPred_match< LHS, RHS,
is_bitwiselogic_op > 
m_BitwiseLogic (const LHS &L, const RHS &R)
 Matches bitwise logic operations. More...
 
template<typename LHS , typename RHS >
BinOpPred_match< LHS, RHS,
is_idiv_op > 
m_IDiv (const LHS &L, const RHS &R)
 Matches integer division operations. More...
 
template<typename T >
Exact_match< T > m_Exact (const T &SubPattern)
 
template<typename LHS , typename RHS >
CmpClass_match< LHS, RHS,
CmpInst, CmpInst::Predicate > 
m_Cmp (CmpInst::Predicate &Pred, const LHS &L, const RHS &R)
 
template<typename LHS , typename RHS >
CmpClass_match< LHS, RHS,
ICmpInst, ICmpInst::Predicate > 
m_ICmp (ICmpInst::Predicate &Pred, const LHS &L, const RHS &R)
 
template<typename LHS , typename RHS >
CmpClass_match< LHS, RHS,
FCmpInst, FCmpInst::Predicate > 
m_FCmp (FCmpInst::Predicate &Pred, const LHS &L, const RHS &R)
 
template<typename Cond , typename LHS , typename RHS >
SelectClass_match< Cond, LHS, RHS > m_Select (const Cond &C, const LHS &L, const RHS &R)
 
template<int64_t L, int64_t R, typename Cond >
SelectClass_match< Cond,
constantint_match< L >
, constantint_match< R > > 
m_SelectCst (const Cond &C)
 This matches a select of two constants, e.g. 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...
 
template<typename LHS >
not_match< LHS > m_Not (const LHS &L)
 
template<typename LHS >
neg_match< LHS > m_Neg (const LHS &L)
 Match an integer negate. More...
 
template<typename LHS >
fneg_match< LHS > m_FNeg (const LHS &L)
 Match a floating point negate. 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_ty > 
m_SMax (const LHS &L, const RHS &R)
 
template<typename LHS , typename RHS >
MaxMin_match< ICmpInst, LHS,
RHS, smin_pred_ty > 
m_SMin (const LHS &L, const RHS &R)
 
template<typename LHS , typename RHS >
MaxMin_match< ICmpInst, LHS,
RHS, umax_pred_ty > 
m_UMax (const LHS &L, const RHS &R)
 
template<typename LHS , typename RHS >
MaxMin_match< ICmpInst, LHS,
RHS, umin_pred_ty > 
m_UMin (const LHS &L, const RHS &R)
 
template<typename LHS , typename RHS >
MaxMin_match< FCmpInst, LHS,
RHS, ofmax_pred_ty > 
m_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_ty > 
m_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_ty > 
m_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_ty > 
m_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 , 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 Val_t >
Signum_match< Val_t > m_Signum (const Val_t &V)
 Matches a signum pattern. More...
 
template<typename LHS , typename RHS >
AnyBinaryOp_match< LHS, RHS, true > m_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,
true > 
m_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, true > 
m_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, true > 
m_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, true > 
m_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, true > 
m_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, true > 
m_c_Xor (const LHS &L, const RHS &R)
 Matches an Xor with LHS and RHS in either order. More...
 
template<typename LHS , typename RHS >
MaxMin_match< ICmpInst, LHS,
RHS, smin_pred_ty, true > 
m_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, true > 
m_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, true > 
m_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, true > 
m_c_UMax (const LHS &L, const RHS &R)
 Matches a UMax with LHS and RHS in either order. More...
 

Function Documentation

template<typename LHS , typename RHS >
BinaryOp_match<LHS, RHS, Instruction::Add> llvm::PatternMatch::m_Add ( const LHS &  L,
const RHS &  R 
)
inline
match_all_ones llvm::PatternMatch::m_AllOnes ( )
inline
template<typename LHS , typename RHS >
BinaryOp_match<LHS, RHS, Instruction::And> llvm::PatternMatch::m_And ( const LHS &  L,
const RHS &  R 
)
inline
match_any_zero llvm::PatternMatch::m_AnyZero ( )
inline

  • Match an arbitrary zero/null constant.

This includes zero_initializer for vectors and ConstantPointerNull for pointers. For floating point constants, this will match negative zero and positive zero

Definition at line 172 of file PatternMatch.h.

Referenced by SimplifyFAddInst(), SimplifyFDivInst(), SimplifyFMulInst(), SimplifyFRemInst(), SimplifyFSubInst(), and llvm::InstCombiner::visitFAdd().

apint_match llvm::PatternMatch::m_APInt ( const APInt *&  Res)
inline
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 1295 of file PatternMatch.h.

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

Match an arbitrary binary operation and ignore it.

Definition at line 75 of file PatternMatch.h.

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

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

Match a binary operator, capturing it if we match.

Definition at line 337 of file PatternMatch.h.

References I.

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

Definition at line 445 of file PatternMatch.h.

References L.

template<typename OpTy >
CastClass_match<OpTy, Instruction::BitCast> llvm::PatternMatch::m_BitCast ( const OpTy &  Op)
inline
template<typename Opnd0 >
m_Intrinsic_Ty<Opnd0>::Ty llvm::PatternMatch::m_BitReverse ( const Opnd0 &  Op0)
inline

Definition at line 1374 of file PatternMatch.h.

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

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 749 of file PatternMatch.h.

References L.

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

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

Definition at line 1379 of file PatternMatch.h.

Referenced by SimplifyBSwap(), and llvm::InstCombiner::visitCallInst().

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 1456 of file PatternMatch.h.

References L.

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

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

Matches a BinaryOperator with LHS and RHS in either order.

Definition at line 1441 of file PatternMatch.h.

References L.

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

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 1449 of file PatternMatch.h.

References L.

Referenced by computeKnownBitsFromAssume(), and isKnownNonNullFromDominatingCondition().

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 1463 of file PatternMatch.h.

References L.

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

template<typename LHS , typename RHS >
BinaryOp_match<LHS, RHS, Instruction::Or, true> llvm::PatternMatch::m_c_Or ( const LHS &  L,
const RHS &  R 
)
inline
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 1498 of file PatternMatch.h.

References L.

Referenced by foldICmpWithMinMax().

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 1492 of file PatternMatch.h.

References L.

Referenced by foldICmpWithMinMax().

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 1510 of file PatternMatch.h.

References L.

Referenced by foldICmpWithMinMax().

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 1504 of file PatternMatch.h.

References L.

Referenced by foldICmpWithMinMax().

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

Matches an Xor with LHS and RHS in either order.

Definition at line 1484 of file PatternMatch.h.

References L.

Referenced by computeKnownBitsFromAssume(), SimplifyOrInst(), llvm::InstCombiner::visitAnd(), llvm::InstCombiner::visitOr(), and llvm::InstCombiner::visitXor().

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

Matches any compare instruction and ignore it.

Definition at line 80 of file PatternMatch.h.

Referenced by llvm::InstCombiner::visitBranchInst(), llvm::InstCombiner::visitCallInst(), and llvm::InstCombiner::visitXor().

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 807 of file PatternMatch.h.

References L.

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 131 of file PatternMatch.h.

References L.

Referenced by m_Intrinsic().

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

Combine two pattern matchers matching L || R.

Definition at line 125 of file PatternMatch.h.

References L.

Referenced by computeKnownBitsFromAssume(), foldVecTruncToExtElt(), m_ZExtOrSExt(), and markAliveBlocks().

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

Match a Constant, capturing the value if we match.

Definition at line 343 of file PatternMatch.h.

References C.

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

Match a ConstantFP, capturing the value if we match.

Definition at line 346 of file PatternMatch.h.

References C.

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

Match a ConstantInt, capturing the value if we match.

Definition at line 340 of file PatternMatch.h.

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 423 of file PatternMatch.h.

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

Definition at line 484 of file PatternMatch.h.

References L.

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 819 of file PatternMatch.h.

References L.

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

Definition at line 526 of file PatternMatch.h.

References L.

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

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 1390 of file PatternMatch.h.

Referenced by simplifyMinnumMaxnum().

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 1384 of file PatternMatch.h.

Referenced by simplifyMinnumMaxnum().

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

Definition at line 508 of file PatternMatch.h.

References L.

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

template<typename LHS >
fneg_match<LHS> llvm::PatternMatch::m_FNeg ( const LHS &  L)
inline

Match a floating point negate.

Definition at line 1007 of file PatternMatch.h.

References L.

Referenced by llvm::InstCombiner::visitCallInst(), llvm::InstCombiner::visitFCmpInst(), and llvm::InstCombiner::visitFDiv().

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

Matches FPExt.

Definition at line 931 of file PatternMatch.h.

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

specific_fpval llvm::PatternMatch::m_FPOne ( )
inline

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

Definition at line 383 of file PatternMatch.h.

References m_SpecificFP().

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

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

Matches FPTrunc.

Definition at line 925 of file PatternMatch.h.

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 544 of file PatternMatch.h.

References L.

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

Definition at line 496 of file PatternMatch.h.

References L.

Referenced by SimplifyFAddInst(), SimplifyFSubInst(), and llvm::InstCombiner::visitCallInst().

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
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 755 of file PatternMatch.h.

References L.

Referenced by isKnownNonZero(), and SimplifyMulInst().

bind_ty<Instruction> llvm::PatternMatch::m_Instruction ( Instruction *&  I)
inline
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 1344 of file PatternMatch.h.

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

Definition at line 1349 of file PatternMatch.h.

References m_CombineAnd().

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 1354 of file PatternMatch.h.

References m_CombineAnd().

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 1361 of file PatternMatch.h.

References m_CombineAnd().

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 1368 of file PatternMatch.h.

References m_CombineAnd().

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 742 of file PatternMatch.h.

References L.

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

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

Definition at line 313 of file PatternMatch.h.

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

Definition at line 314 of file PatternMatch.h.

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

Match an arbitrary NaN constant. This includes quiet and signalling nans.

Definition at line 183 of file PatternMatch.h.

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

template<typename LHS >
neg_match<LHS> llvm::PatternMatch::m_Neg ( const LHS &  L)
inline
match_neg_zero llvm::PatternMatch::m_NegZero ( )
inline

Match an arbitrary zero/null constant.

This includes zero_initializer for vectors and ConstantPointerNull for pointers. For floating point constants, this will match negative zero but not positive zero

Definition at line 159 of file PatternMatch.h.

Referenced by SimplifyFAddInst(), and SimplifyFSubInst().

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

Definition at line 613 of file PatternMatch.h.

References llvm::MCID::Add, L, and llvm::OverflowingBinaryOperator::NoSignedWrap.

Referenced by isKnownNonZero(), and isTruePredicate().

template<typename LHS , typename RHS >
OverflowingBinaryOp_match<LHS, RHS, Instruction::Mul, OverflowingBinaryOperator::NoSignedWrap> llvm::PatternMatch::m_NSWMul ( const LHS &  L,
const RHS &  R 
)
inline
template<typename LHS , typename RHS >
OverflowingBinaryOp_match<LHS, RHS, Instruction::Shl, OverflowingBinaryOperator::NoSignedWrap> llvm::PatternMatch::m_NSWShl ( const LHS &  L,
const RHS &  R 
)
inline
template<typename LHS , typename RHS >
OverflowingBinaryOp_match<LHS, RHS, Instruction::Sub, OverflowingBinaryOperator::NoSignedWrap> llvm::PatternMatch::m_NSWSub ( const LHS &  L,
const RHS &  R 
)
inline
template<typename LHS , typename RHS >
OverflowingBinaryOp_match<LHS, RHS, Instruction::Add, OverflowingBinaryOperator::NoUnsignedWrap> llvm::PatternMatch::m_NUWAdd ( const LHS &  L,
const RHS &  R 
)
inline
template<typename LHS , typename RHS >
OverflowingBinaryOp_match<LHS, RHS, Instruction::Mul, OverflowingBinaryOperator::NoUnsignedWrap> llvm::PatternMatch::m_NUWMul ( const LHS &  L,
const RHS &  R 
)
inline
template<typename LHS , typename RHS >
OverflowingBinaryOp_match<LHS, RHS, Instruction::Shl, OverflowingBinaryOperator::NoUnsignedWrap> llvm::PatternMatch::m_NUWShl ( const LHS &  L,
const RHS &  R 
)
inline
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 654 of file PatternMatch.h.

References L, and llvm::OverflowingBinaryOperator::NoUnsignedWrap.

match_one llvm::PatternMatch::m_One ( )
inline
template<typename T >
OneUse_match<T> llvm::PatternMatch::m_OneUse ( const T &  SubPattern)
inline
template<typename LHS , typename RHS >
BinaryOp_match<LHS, RHS, Instruction::Or> llvm::PatternMatch::m_Or ( const LHS &  L,
const RHS &  R 
)
inline
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 1185 of file PatternMatch.h.

References L.

Referenced by llvm::RecurrenceDescriptor::isMinMaxSelectCmpPattern().

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 1200 of file PatternMatch.h.

References L.

Referenced by llvm::RecurrenceDescriptor::isMinMaxSelectCmpPattern().

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

Match an integer or vector power of 2.

Definition at line 306 of file PatternMatch.h.

Referenced by llvm::InstCombiner::commonShiftTransforms(), foldSelectICmpAndOr(), and visitUDivOperand().

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

Definition at line 307 of file PatternMatch.h.

template<typename OpTy >
CastClass_match<OpTy, Instruction::PtrToInt> llvm::PatternMatch::m_PtrToInt ( const OpTy &  Op)
inline
template<typename LHS , typename RHS >
BinaryOp_match<LHS, RHS, Instruction::SDiv> llvm::PatternMatch::m_SDiv ( const LHS &  L,
const RHS &  R 
)
inline
template<typename Cond , typename LHS , typename RHS >
SelectClass_match<Cond, LHS, RHS> llvm::PatternMatch::m_Select ( const Cond &  C,
const LHS &  L,
const RHS &  R 
)
inline
template<int64_t L, int64_t R, typename Cond >
SelectClass_match<Cond, constantint_match<L>, constantint_match<R> > 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 854 of file PatternMatch.h.

References m_Select().

template<typename OpTy >
CastClass_match<OpTy, Instruction::SExt> llvm::PatternMatch::m_SExt ( const OpTy &  Op)
inline
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 727 of file PatternMatch.h.

References L.

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

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

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

Definition at line 216 of file PatternMatch.h.

Referenced by isKnownToBeAPowerOfTwo(), and SimplifyAddInst().

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 1431 of file PatternMatch.h.

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

Matches SIToFP.

Definition at line 919 of file PatternMatch.h.

template<typename LHS , typename RHS >
MaxMin_match<ICmpInst, LHS, RHS, smax_pred_ty> llvm::PatternMatch::m_SMax ( const LHS &  L,
const RHS &  R 
)
inline
template<typename LHS , typename RHS >
MaxMin_match<ICmpInst, LHS, RHS, smin_pred_ty> llvm::PatternMatch::m_SMin ( const LHS &  L,
const RHS &  R 
)
inline
specificval_ty llvm::PatternMatch::m_Specific ( const Value *  V)
inline
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 380 of file PatternMatch.h.

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

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 419 of file PatternMatch.h.

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

template<typename LHS , typename RHS >
BinaryOp_match<LHS, RHS, Instruction::SRem> llvm::PatternMatch::m_SRem ( const LHS &  L,
const RHS &  R 
)
inline
template<typename LHS , typename RHS >
BinaryOp_match<LHS, RHS, Instruction::Sub> llvm::PatternMatch::m_Sub ( const LHS &  L,
const RHS &  R 
)
inline
template<typename OpTy >
CastClass_match<OpTy, Instruction::Trunc> llvm::PatternMatch::m_Trunc ( const OpTy &  Op)
inline
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 1277 of file PatternMatch.h.

References L.

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

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

Matches UIToFP.

Definition at line 913 of file PatternMatch.h.

template<typename LHS , typename RHS >
MaxMin_match<ICmpInst, LHS, RHS, umax_pred_ty> llvm::PatternMatch::m_UMax ( const LHS &  L,
const RHS &  R 
)
inline
template<typename LHS , typename RHS >
MaxMin_match<ICmpInst, LHS, RHS, umin_pred_ty> llvm::PatternMatch::m_UMin ( const LHS &  L,
const RHS &  R 
)
inline
br_match llvm::PatternMatch::m_UnconditionalBr ( BasicBlock *&  Succ)
inline

Definition at line 1030 of file PatternMatch.h.

Referenced by tryToMoveFreeBeforeNullTest().

class_match<UndefValue> llvm::PatternMatch::m_Undef ( )
inline
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 1216 of file PatternMatch.h.

References L.

Referenced by llvm::RecurrenceDescriptor::isMinMaxSelectCmpPattern().

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 1231 of file PatternMatch.h.

References L.

Referenced by llvm::RecurrenceDescriptor::isMinMaxSelectCmpPattern().

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

Match an arbitrary value and ignore it.

Definition at line 72 of file PatternMatch.h.

Referenced by canEvaluateShifted(), checkForNegativeOperand(), CombineUAddWithOverflow(), llvm::InstCombiner::commonIDivTransforms(), llvm::InstCombiner::commonShiftTransforms(), computeKnownBitsFromAssume(), computeKnownBitsFromOperator(), llvm::JumpThreadingPass::ComputeValueKnownInPredecessors(), llvm::findScalarElement(), foldAddWithConstant(), foldAndToXor(), foldBitCastBitwiseLogic(), foldBitCastSelect(), foldBoolSextMaskToSelect(), foldICmpShlOne(), foldICmpWithMinMax(), foldLogicCastConstant(), foldOrToXor(), FoldOrWithConstants(), foldSelectICmpAndOr(), llvm::InstCombiner::FoldShiftByConstant(), foldUDivShl(), foldVecTruncToExtElt(), foldXorToXor(), FoldXorWithConstants(), getMaskedTypeForICmpPair(), getSelectCondition(), hoistInsEltConst(), llvm::isImpliedCondition(), isKnownNonZero(), isKnownToBeAPowerOfTwo(), llvm::RecurrenceDescriptor::isMinMaxSelectCmpPattern(), isTruePredicate(), llvm::PatternMatch::UAddWithOverflow_match< LHS_t, RHS_t, Sum_t >::match(), llvm::PatternMatch::Signum_match< Opnd_t >::match(), matchDeMorgansLaws(), matchesAdd(), matchesOr(), processUMulZExtIdiom(), SimplifyAddInst(), SimplifyAndInst(), simplifyAndOfICmpsWithAdd(), simplifyAndOfICmpsWithSameOperands(), SimplifyAShrInst(), SimplifyBSwap(), SimplifyDiv(), SimplifyFSubInst(), SimplifyGEPInst(), simplifyICmpWithBinOp(), simplifyICmpWithMinMax(), SimplifyLShrInst(), simplifyMinnumMaxnum(), SimplifyMulInst(), SimplifyOrInst(), simplifyOrOfICmpsWithAdd(), simplifyOrOfICmpsWithSameOperands(), SimplifyRem(), simplifySelectWithFakeICmpEq(), simplifySelectWithICmpCond(), SimplifyShlInst(), SimplifySubInst(), simplifyUnsignedRangeCheck(), simplifyValueKnownNonZero(), splitMergedValStore(), llvm::AssumptionCache::updateAffectedValues(), llvm::InstCombiner::visitAdd(), llvm::InstCombiner::visitAnd(), llvm::InstCombiner::visitAShr(), llvm::InstCombiner::visitBranchInst(), llvm::InstCombiner::visitCallInst(), llvm::InstCombiner::visitFAdd(), llvm::InstCombiner::visitFCmpInst(), llvm::InstCombiner::visitFDiv(), llvm::InstCombiner::visitFMul(), llvm::InstCombiner::visitGetElementPtrInst(), llvm::InstCombiner::visitICmpInst(), llvm::InstCombiner::visitLShr(), 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::visitXor(), and llvm::InstCombiner::visitZExt().

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

Match a value, capturing it if we match.

Definition at line 331 of file PatternMatch.h.

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

Definition at line 332 of file PatternMatch.h.

template<typename LHS , typename RHS >
BinaryOp_match<LHS, RHS, Instruction::Xor> llvm::PatternMatch::m_Xor ( const LHS &  L,
const RHS &  R 
)
inline
match_zero llvm::PatternMatch::m_Zero ( )
inline
template<typename OpTy >
CastClass_match<OpTy, Instruction::ZExt> llvm::PatternMatch::m_ZExt ( const OpTy &  Op)
inline
template<typename OpTy >
match_combine_or<CastClass_match<OpTy, Instruction::ZExt>, CastClass_match<OpTy, Instruction::SExt> > llvm::PatternMatch::m_ZExtOrSExt ( const OpTy &  Op)
inline

Definition at line 907 of file PatternMatch.h.

References m_CombineOr(), m_SExt(), and m_ZExt().

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

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

Definition at line 49 of file PatternMatch.h.

References P.

Referenced by areInverseVectorBitmasks(), canEvaluateShifted(), canEvaluateShiftedShift(), canonicalizeICmpBool(), checkForNegativeOperand(), combineInstructionsOverFunction(), CombineUAddWithOverflow(), llvm::InstCombiner::commonIDivTransforms(), llvm::InstCombiner::commonIRemTransforms(), llvm::InstCombiner::commonShiftTransforms(), computeKnownBits(), computeKnownBitsFromAssume(), computeKnownBitsFromOperator(), ComputeNumSignBitsImpl(), llvm::JumpThreadingPass::ComputeValueKnownInPredecessors(), llvm::ConstantFoldBinaryInstruction(), despeculateCountZeros(), detectLog2OfHalf(), llvm::findScalarElement(), foldAddWithConstant(), foldAndOrOfEqualityCmpsWithConstants(), foldAndToXor(), foldBitCastBitwiseLogic(), foldBitCastSelect(), foldBoolSextMaskToSelect(), foldConstantInsEltIntoShuffle(), foldCttzCtlz(), foldICmpShlOne(), foldICmpWithMinMax(), foldLogicCastConstant(), foldOrToXor(), FoldOrWithConstants(), foldSelectICmpAndOr(), llvm::InstCombiner::FoldShiftByConstant(), foldShiftedShift(), foldUDivShl(), foldVecTruncToExtElt(), foldXorToXor(), FoldXorWithConstants(), llvm::getGEPInductionOperand(), getLogBase2Vector(), getMaskedTypeForICmpPair(), llvm::SCEVExpander::getRelatedExistingExpansion(), getSelectCondition(), getValueFromICmpCondition(), hoistInsEltConst(), llvm::isGuaranteedToTransferExecutionToSuccessor(), llvm::isImpliedCondition(), isKnownNonNullFromDominatingCondition(), isKnownNonZero(), isKnownToBeAPowerOfTwo(), isLoopNeverExecuted(), llvm::isSafeToSpeculativelyExecute(), isTruePredicate(), llvm::RecurrenceDescriptor::lookThroughAnd(), MaintainNoSignedWrap(), markAliveBlocks(), llvm::PatternMatch::MaxMin_match< CmpInst_t, LHS_t, RHS_t, Pred_t, Commutable >::match(), matchDeMorgansLaws(), matchesAdd(), matchesOr(), matchMinMax(), matchSelectPattern(), llvm::JumpThreadingPass::ProcessGuards(), processUMulZExtIdiom(), llvm::AssumptionCache::registerAssumption(), setLimitsForBinOp(), ShrinkDemandedConstant(), SimplifyAddInst(), SimplifyAndInst(), simplifyAndOfICmpsWithAdd(), simplifyAndOfICmpsWithSameOperands(), simplifyAndOrOfICmpsWithConstants(), SimplifyAShrInst(), simplifyAssocCastAssoc(), SimplifyBSwap(), SimplifyDiv(), simplifyDivRem(), SimplifyFAddInst(), SimplifyFDivInst(), SimplifyFMulInst(), SimplifyFRemInst(), SimplifyFSubInst(), SimplifyGEPInst(), simplifyICmpOfBools(), simplifyICmpWithBinOp(), simplifyICmpWithConstant(), simplifyICmpWithMinMax(), simplifyICmpWithZero(), SimplifyInsertValueInst(), SimplifyIntrinsic(), SimplifyLShrInst(), simplifyMinnumMaxnum(), SimplifyMulInst(), SimplifyOrInst(), simplifyOrOfICmpsWithAdd(), simplifyOrOfICmpsWithSameOperands(), SimplifyRem(), SimplifyRightShift(), simplifySelectBitTest(), simplifySelectWithFakeICmpEq(), simplifySelectWithICmpCond(), SimplifyShift(), SimplifyShlInst(), SimplifySubInst(), simplifyUnsignedRangeCheck(), simplifyValueKnownNonZero(), SimplifyXorInst(), splitMergedValStore(), ThreadCmpOverSelect(), tryToMoveFreeBeforeNullTest(), llvm::AssumptionCache::updateAffectedValues(), llvm::AssumptionCacheTracker::verifyAnalysis(), llvm::InstCombiner::visitAdd(), llvm::InstCombiner::visitAnd(), llvm::InstCombiner::visitAShr(), llvm::InstCombiner::visitBranchInst(), llvm::InstCombiner::visitCallInst(), llvm::InstCombiner::visitFAdd(), llvm::InstCombiner::visitFCmpInst(), llvm::InstCombiner::visitFDiv(), llvm::InstCombiner::visitFMul(), llvm::InstCombiner::visitFSub(), llvm::InstCombiner::visitGetElementPtrInst(), llvm::InstCombiner::visitICmpInst(), llvm::InstCombiner::visitLShr(), 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().