Lines Matching refs:CmpInst

85   CmpInst::Predicate ExpectedPred, Pred1, Pred2;  in foldSelectWithBinaryOp()
128 static bool isSameCompare(Value *V, CmpInst::Predicate Pred, Value *LHS, in isSameCompare()
130 CmpInst *Cmp = dyn_cast<CmpInst>(V); in isSameCompare()
133 CmpInst::Predicate CPred = Cmp->getPredicate(); in isSameCompare()
137 return CPred == CmpInst::getSwappedPredicate(Pred) && CLHS == RHS && in isSameCompare()
146 static Value *simplifyCmpSelCase(CmpInst::Predicate Pred, Value *LHS, in simplifyCmpSelCase()
163 static Value *simplifyCmpSelTrueCase(CmpInst::Predicate Pred, Value *LHS, in simplifyCmpSelTrueCase()
172 static Value *simplifyCmpSelFalseCase(CmpInst::Predicate Pred, Value *LHS, in simplifyCmpSelFalseCase()
472 static Value *threadCmpOverSelect(CmpInst::Predicate Pred, Value *LHS, in threadCmpOverSelect()
482 Pred = CmpInst::getSwappedPredicate(Pred); in threadCmpOverSelect()
561 static Value *threadCmpOverPHI(CmpInst::Predicate Pred, Value *LHS, Value *RHS, in threadCmpOverPHI()
570 Pred = CmpInst::getSwappedPredicate(Pred); in threadCmpOverPHI()
1062 if (isICmpTrue(CmpInst::ICMP_SLT, Y, NegDividendC, Q, MaxRecurse) || in isDivZero()
1063 isICmpTrue(CmpInst::ICMP_SGT, Y, PosDividendC, Q, MaxRecurse)) in isDivZero()
1071 return isICmpTrue(CmpInst::ICMP_NE, X, Y, Q, MaxRecurse); in isDivZero()
1078 if (isICmpTrue(CmpInst::ICMP_SGT, X, NegDivisorC, Q, MaxRecurse) && in isDivZero()
1079 isICmpTrue(CmpInst::ICMP_SLT, X, PosDivisorC, Q, MaxRecurse)) in isDivZero()
2554 return CmpInst::makeCmpResultType(Op->getType()); in getCompareTy()
2560 static Value *extractEquivalentCondition(Value *V, CmpInst::Predicate Pred, in extractEquivalentCondition()
2565 CmpInst *Cmp = dyn_cast<CmpInst>(SI->getCondition()); in extractEquivalentCondition()
2571 if (Pred == CmpInst::getSwappedPredicate(Cmp->getPredicate()) && in extractEquivalentCondition()
2669 static Constant *computePointerICmp(CmpInst::Predicate Pred, Value *LHS, in computePointerICmp()
2685 return ConstantInt::get(getCompareTy(LHS), !CmpInst::isTrueWhenEqual(Pred)); in computePointerICmp()
2693 case CmpInst::ICMP_EQ: in computePointerICmp()
2694 case CmpInst::ICMP_NE: in computePointerICmp()
2699 case CmpInst::ICMP_UGT: in computePointerICmp()
2700 case CmpInst::ICMP_UGE: in computePointerICmp()
2701 case CmpInst::ICMP_ULT: in computePointerICmp()
2702 case CmpInst::ICMP_ULE: in computePointerICmp()
2729 if (Pred == CmpInst::ICMP_EQ || Pred == CmpInst::ICMP_NE) { in computePointerICmp()
2752 !CmpInst::isTrueWhenEqual(Pred)); in computePointerICmp()
2780 !CmpInst::isTrueWhenEqual(Pred)); in computePointerICmp()
2798 CmpInst::isFalseWhenEqual(Pred)); in computePointerICmp()
2806 static Value *simplifyICmpOfBools(CmpInst::Predicate Pred, Value *LHS, in simplifyICmpOfBools()
2826 case CmpInst::ICMP_NE: // X != 0 -> X in simplifyICmpOfBools()
2827 case CmpInst::ICMP_UGT: // X >u 0 -> X in simplifyICmpOfBools()
2828 case CmpInst::ICMP_SLT: // X <s 0 -> X in simplifyICmpOfBools()
2831 case CmpInst::ICMP_EQ: // not(X) == 0 -> X != 0 -> X in simplifyICmpOfBools()
2832 case CmpInst::ICMP_ULE: // not(X) <=u 0 -> X >u 0 -> X in simplifyICmpOfBools()
2833 case CmpInst::ICMP_SGE: // not(X) >=s 0 -> X <s 0 -> X in simplifyICmpOfBools()
2838 case CmpInst::ICMP_ULT: // X <u 0 -> false in simplifyICmpOfBools()
2839 case CmpInst::ICMP_SGT: // X >s 0 -> false in simplifyICmpOfBools()
2842 case CmpInst::ICMP_UGE: // X >=u 0 -> true in simplifyICmpOfBools()
2843 case CmpInst::ICMP_SLE: // X <=s 0 -> true in simplifyICmpOfBools()
2851 case CmpInst::ICMP_EQ: // X == 1 -> X in simplifyICmpOfBools()
2852 case CmpInst::ICMP_UGE: // X >=u 1 -> X in simplifyICmpOfBools()
2853 case CmpInst::ICMP_SLE: // X <=s -1 -> X in simplifyICmpOfBools()
2856 case CmpInst::ICMP_NE: // not(X) != 1 -> X == 1 -> X in simplifyICmpOfBools()
2857 case CmpInst::ICMP_ULT: // not(X) <=u 1 -> X >=u 1 -> X in simplifyICmpOfBools()
2858 case CmpInst::ICMP_SGT: // not(X) >s 1 -> X <=s -1 -> X in simplifyICmpOfBools()
2863 case CmpInst::ICMP_UGT: // X >u 1 -> false in simplifyICmpOfBools()
2864 case CmpInst::ICMP_SLT: // X <s -1 -> false in simplifyICmpOfBools()
2867 case CmpInst::ICMP_ULE: // X <=u 1 -> true in simplifyICmpOfBools()
2868 case CmpInst::ICMP_SGE: // X >=s -1 -> true in simplifyICmpOfBools()
2904 static Value *simplifyICmpWithZero(CmpInst::Predicate Pred, Value *LHS, in simplifyICmpWithZero()
2966 static Value *simplifyICmpWithConstant(CmpInst::Predicate Pred, Value *LHS, in simplifyICmpWithConstant()
2994 computeConstantRange(LHS, CmpInst::isSigned(Pred), IIQ.UseInstrInfo); in simplifyICmpWithConstant()
3015 static Value *simplifyICmpWithBinOpOnLHS(CmpInst::Predicate Pred, in simplifyICmpWithBinOpOnLHS()
3166 static bool trySimplifyICmpWithAdds(CmpInst::Predicate Pred, Value *LHS, in trySimplifyICmpWithAdds()
3169 if (Pred != CmpInst::ICMP_SLT) in trySimplifyICmpWithAdds()
3191 static Value *simplifyICmpWithBinOp(CmpInst::Predicate Pred, Value *LHS, in simplifyICmpWithBinOp()
3206 (CmpInst::isUnsigned(Pred) && in simplifyICmpWithBinOp()
3208 (CmpInst::isSigned(Pred) && in simplifyICmpWithBinOp()
3216 (CmpInst::isUnsigned(Pred) && in simplifyICmpWithBinOp()
3218 (CmpInst::isSigned(Pred) && in simplifyICmpWithBinOp()
3275 if (!CmpInst::isUnsigned(Pred) && match(LHS, m_Neg(m_ZExt(m_Value())))) { in simplifyICmpWithBinOp()
3375 static Value *simplifyICmpWithMinMax(CmpInst::Predicate Pred, Value *LHS, in simplifyICmpWithMinMax()
3380 CmpInst::Predicate P = CmpInst::BAD_ICMP_PREDICATE; in simplifyICmpWithMinMax()
3381 CmpInst::Predicate EqP; // Chosen so that "A == max/min(A,B)" iff "A EqP B". in simplifyICmpWithMinMax()
3387 EqP = CmpInst::ICMP_SGE; // "A == smax(A, B)" iff "A sge B". in simplifyICmpWithMinMax()
3394 EqP = CmpInst::ICMP_SGE; // "A == smax(A, B)" iff "A sge B". in simplifyICmpWithMinMax()
3396 P = CmpInst::getSwappedPredicate(Pred); in simplifyICmpWithMinMax()
3401 EqP = CmpInst::ICMP_SLE; // "A == smin(A, B)" iff "A sle B". in simplifyICmpWithMinMax()
3404 P = CmpInst::getSwappedPredicate(Pred); in simplifyICmpWithMinMax()
3409 EqP = CmpInst::ICMP_SLE; // "A == smin(A, B)" iff "A sle B". in simplifyICmpWithMinMax()
3414 if (P != CmpInst::BAD_ICMP_PREDICATE) { in simplifyICmpWithMinMax()
3419 case CmpInst::ICMP_EQ: in simplifyICmpWithMinMax()
3420 case CmpInst::ICMP_SLE: in simplifyICmpWithMinMax()
3432 case CmpInst::ICMP_NE: in simplifyICmpWithMinMax()
3433 case CmpInst::ICMP_SGT: { in simplifyICmpWithMinMax()
3434 CmpInst::Predicate InvEqP = CmpInst::getInversePredicate(EqP); in simplifyICmpWithMinMax()
3447 case CmpInst::ICMP_SGE: in simplifyICmpWithMinMax()
3450 case CmpInst::ICMP_SLT: in simplifyICmpWithMinMax()
3457 P = CmpInst::BAD_ICMP_PREDICATE; in simplifyICmpWithMinMax()
3461 EqP = CmpInst::ICMP_UGE; // "A == umax(A, B)" iff "A uge B". in simplifyICmpWithMinMax()
3468 EqP = CmpInst::ICMP_UGE; // "A == umax(A, B)" iff "A uge B". in simplifyICmpWithMinMax()
3470 P = CmpInst::getSwappedPredicate(Pred); in simplifyICmpWithMinMax()
3475 EqP = CmpInst::ICMP_ULE; // "A == umin(A, B)" iff "A ule B". in simplifyICmpWithMinMax()
3478 P = CmpInst::getSwappedPredicate(Pred); in simplifyICmpWithMinMax()
3483 EqP = CmpInst::ICMP_ULE; // "A == umin(A, B)" iff "A ule B". in simplifyICmpWithMinMax()
3488 if (P != CmpInst::BAD_ICMP_PREDICATE) { in simplifyICmpWithMinMax()
3493 case CmpInst::ICMP_EQ: in simplifyICmpWithMinMax()
3494 case CmpInst::ICMP_ULE: in simplifyICmpWithMinMax()
3506 case CmpInst::ICMP_NE: in simplifyICmpWithMinMax()
3507 case CmpInst::ICMP_UGT: { in simplifyICmpWithMinMax()
3508 CmpInst::Predicate InvEqP = CmpInst::getInversePredicate(EqP); in simplifyICmpWithMinMax()
3521 case CmpInst::ICMP_UGE: in simplifyICmpWithMinMax()
3523 case CmpInst::ICMP_ULT: in simplifyICmpWithMinMax()
3541 if (Pred == CmpInst::ICMP_SGE) in simplifyICmpWithMinMax()
3544 if (Pred == CmpInst::ICMP_SLT) in simplifyICmpWithMinMax()
3550 if (Pred == CmpInst::ICMP_UGE) in simplifyICmpWithMinMax()
3553 if (Pred == CmpInst::ICMP_ULT) in simplifyICmpWithMinMax()
3560 static Value *simplifyICmpWithDominatingAssume(CmpInst::Predicate Predicate, in simplifyICmpWithDominatingAssume()
3587 CmpInst::Predicate Pred = (CmpInst::Predicate)Predicate; in simplifyICmpInst()
3588 assert(CmpInst::isIntPredicate(Pred) && "Not an integer compare!"); in simplifyICmpInst()
3596 Pred = CmpInst::getSwappedPredicate(Pred); in simplifyICmpInst()
3615 return ConstantInt::get(ITy, CmpInst::isTrueWhenEqual(Pred)); in simplifyICmpInst()
3644 if (LHS_CR.icmp(CmpInst::getInversePredicate(Pred), RHS_CR)) in simplifyICmpInst()
3886 CmpInst::Predicate Pred = (CmpInst::Predicate)Predicate; in simplifyFCmpInst()
3887 assert(CmpInst::isFPPredicate(Pred) && "Not an FP compare!"); in simplifyFCmpInst()
3896 Pred = CmpInst::getSwappedPredicate(Pred); in simplifyFCmpInst()
3916 return ConstantInt::get(RetTy, CmpInst::isUnordered(Pred)); in simplifyFCmpInst()
3928 return ConstantInt::get(RetTy, CmpInst::isUnordered(Pred)); in simplifyFCmpInst()
3933 if (CmpInst::isTrueWhenEqual(Pred)) in simplifyFCmpInst()
3935 if (CmpInst::isFalseWhenEqual(Pred)) in simplifyFCmpInst()
4164 if (CmpInst *C = dyn_cast<CmpInst>(I)) in simplifyWithOpReplaced()
5547 if (CmpInst::isIntPredicate((CmpInst::Predicate)Predicate)) in simplifyCmpInst()