Lines Matching refs:LHS

378   BinaryOp_match(const LHS_t &LHS, const RHS_t &RHS) : L(LHS), R(RHS) {}
393 template<typename LHS, typename RHS>
394 inline BinaryOp_match<LHS, RHS, Instruction::Add>
395 m_Add(const LHS &L, const RHS &R) {
396 return BinaryOp_match<LHS, RHS, Instruction::Add>(L, R);
399 template<typename LHS, typename RHS>
400 inline BinaryOp_match<LHS, RHS, Instruction::FAdd>
401 m_FAdd(const LHS &L, const RHS &R) {
402 return BinaryOp_match<LHS, RHS, Instruction::FAdd>(L, R);
405 template<typename LHS, typename RHS>
406 inline BinaryOp_match<LHS, RHS, Instruction::Sub>
407 m_Sub(const LHS &L, const RHS &R) {
408 return BinaryOp_match<LHS, RHS, Instruction::Sub>(L, R);
411 template<typename LHS, typename RHS>
412 inline BinaryOp_match<LHS, RHS, Instruction::FSub>
413 m_FSub(const LHS &L, const RHS &R) {
414 return BinaryOp_match<LHS, RHS, Instruction::FSub>(L, R);
417 template<typename LHS, typename RHS>
418 inline BinaryOp_match<LHS, RHS, Instruction::Mul>
419 m_Mul(const LHS &L, const RHS &R) {
420 return BinaryOp_match<LHS, RHS, Instruction::Mul>(L, R);
423 template<typename LHS, typename RHS>
424 inline BinaryOp_match<LHS, RHS, Instruction::FMul>
425 m_FMul(const LHS &L, const RHS &R) {
426 return BinaryOp_match<LHS, RHS, Instruction::FMul>(L, R);
429 template<typename LHS, typename RHS>
430 inline BinaryOp_match<LHS, RHS, Instruction::UDiv>
431 m_UDiv(const LHS &L, const RHS &R) {
432 return BinaryOp_match<LHS, RHS, Instruction::UDiv>(L, R);
435 template<typename LHS, typename RHS>
436 inline BinaryOp_match<LHS, RHS, Instruction::SDiv>
437 m_SDiv(const LHS &L, const RHS &R) {
438 return BinaryOp_match<LHS, RHS, Instruction::SDiv>(L, R);
441 template<typename LHS, typename RHS>
442 inline BinaryOp_match<LHS, RHS, Instruction::FDiv>
443 m_FDiv(const LHS &L, const RHS &R) {
444 return BinaryOp_match<LHS, RHS, Instruction::FDiv>(L, R);
447 template<typename LHS, typename RHS>
448 inline BinaryOp_match<LHS, RHS, Instruction::URem>
449 m_URem(const LHS &L, const RHS &R) {
450 return BinaryOp_match<LHS, RHS, Instruction::URem>(L, R);
453 template<typename LHS, typename RHS>
454 inline BinaryOp_match<LHS, RHS, Instruction::SRem>
455 m_SRem(const LHS &L, const RHS &R) {
456 return BinaryOp_match<LHS, RHS, Instruction::SRem>(L, R);
459 template<typename LHS, typename RHS>
460 inline BinaryOp_match<LHS, RHS, Instruction::FRem>
461 m_FRem(const LHS &L, const RHS &R) {
462 return BinaryOp_match<LHS, RHS, Instruction::FRem>(L, R);
465 template<typename LHS, typename RHS>
466 inline BinaryOp_match<LHS, RHS, Instruction::And>
467 m_And(const LHS &L, const RHS &R) {
468 return BinaryOp_match<LHS, RHS, Instruction::And>(L, R);
471 template<typename LHS, typename RHS>
472 inline BinaryOp_match<LHS, RHS, Instruction::Or>
473 m_Or(const LHS &L, const RHS &R) {
474 return BinaryOp_match<LHS, RHS, Instruction::Or>(L, R);
477 template<typename LHS, typename RHS>
478 inline BinaryOp_match<LHS, RHS, Instruction::Xor>
479 m_Xor(const LHS &L, const RHS &R) {
480 return BinaryOp_match<LHS, RHS, Instruction::Xor>(L, R);
483 template<typename LHS, typename RHS>
484 inline BinaryOp_match<LHS, RHS, Instruction::Shl>
485 m_Shl(const LHS &L, const RHS &R) {
486 return BinaryOp_match<LHS, RHS, Instruction::Shl>(L, R);
489 template<typename LHS, typename RHS>
490 inline BinaryOp_match<LHS, RHS, Instruction::LShr>
491 m_LShr(const LHS &L, const RHS &R) {
492 return BinaryOp_match<LHS, RHS, Instruction::LShr>(L, R);
495 template<typename LHS, typename RHS>
496 inline BinaryOp_match<LHS, RHS, Instruction::AShr>
497 m_AShr(const LHS &L, const RHS &R) {
498 return BinaryOp_match<LHS, RHS, Instruction::AShr>(L, R);
506 OverflowingBinaryOp_match(const LHS_t &LHS, const RHS_t &RHS) : L(LHS), R(RHS) {}
525 template <typename LHS, typename RHS>
526 inline OverflowingBinaryOp_match<LHS, RHS, Instruction::Add,
528 m_NSWAdd(const LHS &L, const RHS &R) {
529 return OverflowingBinaryOp_match<LHS, RHS, Instruction::Add,
533 template <typename LHS, typename RHS>
534 inline OverflowingBinaryOp_match<LHS, RHS, Instruction::Sub,
536 m_NSWSub(const LHS &L, const RHS &R) {
537 return OverflowingBinaryOp_match<LHS, RHS, Instruction::Sub,
541 template <typename LHS, typename RHS>
542 inline OverflowingBinaryOp_match<LHS, RHS, Instruction::Mul,
544 m_NSWMul(const LHS &L, const RHS &R) {
545 return OverflowingBinaryOp_match<LHS, RHS, Instruction::Mul,
549 template <typename LHS, typename RHS>
550 inline OverflowingBinaryOp_match<LHS, RHS, Instruction::Shl,
552 m_NSWShl(const LHS &L, const RHS &R) {
553 return OverflowingBinaryOp_match<LHS, RHS, Instruction::Shl,
558 template <typename LHS, typename RHS>
559 inline OverflowingBinaryOp_match<LHS, RHS, Instruction::Add,
561 m_NUWAdd(const LHS &L, const RHS &R) {
562 return OverflowingBinaryOp_match<LHS, RHS, Instruction::Add,
566 template <typename LHS, typename RHS>
567 inline OverflowingBinaryOp_match<LHS, RHS, Instruction::Sub,
569 m_NUWSub(const LHS &L, const RHS &R) {
570 return OverflowingBinaryOp_match<LHS, RHS, Instruction::Sub,
574 template <typename LHS, typename RHS>
575 inline OverflowingBinaryOp_match<LHS, RHS, Instruction::Mul,
577 m_NUWMul(const LHS &L, const RHS &R) {
578 return OverflowingBinaryOp_match<LHS, RHS, Instruction::Mul,
582 template <typename LHS, typename RHS>
583 inline OverflowingBinaryOp_match<LHS, RHS, Instruction::Shl,
585 m_NUWShl(const LHS &L, const RHS &R) {
586 return OverflowingBinaryOp_match<LHS, RHS, Instruction::Shl,
599 BinOp2_match(const LHS_t &LHS, const RHS_t &RHS) : L(LHS), R(RHS) {}
616 template<typename LHS, typename RHS>
617 inline BinOp2_match<LHS, RHS, Instruction::LShr, Instruction::AShr>
618 m_Shr(const LHS &L, const RHS &R) {
619 return BinOp2_match<LHS, RHS, Instruction::LShr, Instruction::AShr>(L, R);
623 template<typename LHS, typename RHS>
624 inline BinOp2_match<LHS, RHS, Instruction::LShr, Instruction::Shl>
625 m_LogicalShift(const LHS &L, const RHS &R) {
626 return BinOp2_match<LHS, RHS, Instruction::LShr, Instruction::Shl>(L, R);
630 template<typename LHS, typename RHS>
631 inline BinOp2_match<LHS, RHS, Instruction::SDiv, Instruction::UDiv>
632 m_IDiv(const LHS &L, const RHS &R) {
633 return BinOp2_match<LHS, RHS, Instruction::SDiv, Instruction::UDiv>(L, R);
666 CmpClass_match(PredicateTy &Pred, const LHS_t &LHS, const RHS_t &RHS)
667 : Predicate(Pred), L(LHS), R(RHS) {}
680 template<typename LHS, typename RHS>
681 inline CmpClass_match<LHS, RHS, ICmpInst, ICmpInst::Predicate>
682 m_ICmp(ICmpInst::Predicate &Pred, const LHS &L, const RHS &R) {
683 return CmpClass_match<LHS, RHS,
687 template<typename LHS, typename RHS>
688 inline CmpClass_match<LHS, RHS, FCmpInst, FCmpInst::Predicate>
689 m_FCmp(FCmpInst::Predicate &Pred, const LHS &L, const RHS &R) {
690 return CmpClass_match<LHS, RHS,
704 SelectClass_match(const Cond_t &Cond, const LHS_t &LHS,
706 : C(Cond), L(LHS), R(RHS) {}
718 template<typename Cond, typename LHS, typename RHS>
719 inline SelectClass_match<Cond, LHS, RHS>
720 m_Select(const Cond &C, const LHS &L, const RHS &R) {
721 return SelectClass_match<Cond, LHS, RHS>(C, L, R);
808 not_match(const LHS_t &LHS) : L(LHS) {}
818 bool matchIfNot(Value *LHS, Value *RHS) {
823 L.match(LHS);
827 template<typename LHS>
828 inline not_match<LHS> m_Not(const LHS &L) { return L; }
835 neg_match(const LHS_t &LHS) : L(LHS) {}
845 bool matchIfNeg(Value *LHS, Value *RHS) {
846 return ((isa<ConstantInt>(LHS) && cast<ConstantInt>(LHS)->isZero()) ||
847 isa<ConstantAggregateZero>(LHS)) &&
853 template<typename LHS>
854 inline neg_match<LHS> m_Neg(const LHS &L) { return L; }
861 fneg_match(const LHS_t &LHS) : L(LHS) {}
871 bool matchIfFNeg(Value *LHS, Value *RHS) {
872 if (ConstantFP *C = dyn_cast<ConstantFP>(LHS))
879 template<typename LHS>
880 inline fneg_match<LHS> m_FNeg(const LHS &L) { return L; }
941 MaxMin_match(const LHS_t &LHS, const RHS_t &RHS)
942 : L(LHS), R(RHS) {}
957 Value *LHS = Cmp->getOperand(0);
959 if ((TrueVal != LHS || FalseVal != RHS) &&
960 (TrueVal != RHS || FalseVal != LHS))
962 typename CmpInst_t::Predicate Pred = LHS == TrueVal ?
968 return L.match(LHS) && R.match(RHS);
1028 template<typename LHS, typename RHS>
1029 inline MaxMin_match<ICmpInst, LHS, RHS, smax_pred_ty>
1030 m_SMax(const LHS &L, const RHS &R) {
1031 return MaxMin_match<ICmpInst, LHS, RHS, smax_pred_ty>(L, R);
1034 template<typename LHS, typename RHS>
1035 inline MaxMin_match<ICmpInst, LHS, RHS, smin_pred_ty>
1036 m_SMin(const LHS &L, const RHS &R) {
1037 return MaxMin_match<ICmpInst, LHS, RHS, smin_pred_ty>(L, R);
1040 template<typename LHS, typename RHS>
1041 inline MaxMin_match<ICmpInst, LHS, RHS, umax_pred_ty>
1042 m_UMax(const LHS &L, const RHS &R) {
1043 return MaxMin_match<ICmpInst, LHS, RHS, umax_pred_ty>(L, R);
1046 template<typename LHS, typename RHS>
1047 inline MaxMin_match<ICmpInst, LHS, RHS, umin_pred_ty>
1048 m_UMin(const LHS &L, const RHS &R) {
1049 return MaxMin_match<ICmpInst, LHS, RHS, umin_pred_ty>(L, R);
1061 template<typename LHS, typename RHS>
1062 inline MaxMin_match<FCmpInst, LHS, RHS, ofmax_pred_ty>
1063 m_OrdFMax(const LHS &L, const RHS &R) {
1064 return MaxMin_match<FCmpInst, LHS, RHS, ofmax_pred_ty>(L, R);
1076 template<typename LHS, typename RHS>
1077 inline MaxMin_match<FCmpInst, LHS, RHS, ofmin_pred_ty>
1078 m_OrdFMin(const LHS &L, const RHS &R) {
1079 return MaxMin_match<FCmpInst, LHS, RHS, ofmin_pred_ty>(L, R);
1091 template<typename LHS, typename RHS>
1092 inline MaxMin_match<FCmpInst, LHS, RHS, ufmax_pred_ty>
1093 m_UnordFMax(const LHS &L, const RHS &R) {
1094 return MaxMin_match<FCmpInst, LHS, RHS, ufmax_pred_ty>(L, R);
1106 template<typename LHS, typename RHS>
1107 inline MaxMin_match<FCmpInst, LHS, RHS, ufmin_pred_ty>
1108 m_UnordFMin(const LHS &L, const RHS &R) {
1109 return MaxMin_match<FCmpInst, LHS, RHS, ufmin_pred_ty>(L, R);