Lines Matching refs:CmpInst
90 CmpInst::Predicate ExpectedPred, Pred1, Pred2; in foldSelectWithBinaryOp()
133 static bool isSameCompare(Value *V, CmpInst::Predicate Pred, Value *LHS, in isSameCompare()
135 CmpInst *Cmp = dyn_cast<CmpInst>(V); in isSameCompare()
138 CmpInst::Predicate CPred = Cmp->getPredicate(); in isSameCompare()
142 return CPred == CmpInst::getSwappedPredicate(Pred) && CLHS == RHS && in isSameCompare()
151 static Value *simplifyCmpSelCase(CmpInst::Predicate Pred, Value *LHS, in simplifyCmpSelCase()
168 static Value *simplifyCmpSelTrueCase(CmpInst::Predicate Pred, Value *LHS, in simplifyCmpSelTrueCase()
177 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()
565 static Value *threadCmpOverPHI(CmpInst::Predicate Pred, Value *LHS, Value *RHS, in threadCmpOverPHI()
574 Pred = CmpInst::getSwappedPredicate(Pred); in threadCmpOverPHI()
759 isImpliedByDomCondition(CmpInst::ICMP_EQ, Op0, Op1, Q.CxtI, Q.DL); in simplifyByDomEq()
1037 if (isICmpTrue(CmpInst::ICMP_SLT, Y, NegDividendC, Q, MaxRecurse) || in isDivZero()
1038 isICmpTrue(CmpInst::ICMP_SGT, Y, PosDividendC, Q, MaxRecurse)) in isDivZero()
1046 return isICmpTrue(CmpInst::ICMP_NE, X, Y, Q, MaxRecurse); in isDivZero()
1053 if (isICmpTrue(CmpInst::ICMP_SGT, X, NegDivisorC, Q, MaxRecurse) && in isDivZero()
1054 isICmpTrue(CmpInst::ICMP_SLT, X, PosDivisorC, Q, MaxRecurse)) in isDivZero()
2599 return CmpInst::makeCmpResultType(Op->getType()); in getCompareTy()
2605 static Value *extractEquivalentCondition(Value *V, CmpInst::Predicate Pred, in extractEquivalentCondition()
2610 CmpInst *Cmp = dyn_cast<CmpInst>(SI->getCondition()); in extractEquivalentCondition()
2616 if (Pred == CmpInst::getSwappedPredicate(Cmp->getPredicate()) && in extractEquivalentCondition()
2714 static Constant *computePointerICmp(CmpInst::Predicate Pred, Value *LHS, in computePointerICmp()
2728 case CmpInst::ICMP_EQ: in computePointerICmp()
2729 case CmpInst::ICMP_NE: in computePointerICmp()
2734 case CmpInst::ICMP_UGT: in computePointerICmp()
2735 case CmpInst::ICMP_UGE: in computePointerICmp()
2736 case CmpInst::ICMP_ULT: in computePointerICmp()
2737 case CmpInst::ICMP_ULE: in computePointerICmp()
2766 if (Pred == CmpInst::ICMP_EQ || Pred == CmpInst::ICMP_NE) { in computePointerICmp()
2789 !CmpInst::isTrueWhenEqual(Pred)); in computePointerICmp()
2817 !CmpInst::isTrueWhenEqual(Pred)); in computePointerICmp()
2858 CmpInst::isFalseWhenEqual(Pred)); in computePointerICmp()
2867 static Value *simplifyICmpOfBools(CmpInst::Predicate Pred, Value *LHS, in simplifyICmpOfBools()
2887 case CmpInst::ICMP_NE: // X != 0 -> X in simplifyICmpOfBools()
2888 case CmpInst::ICMP_UGT: // X >u 0 -> X in simplifyICmpOfBools()
2889 case CmpInst::ICMP_SLT: // X <s 0 -> X in simplifyICmpOfBools()
2892 case CmpInst::ICMP_EQ: // not(X) == 0 -> X != 0 -> X in simplifyICmpOfBools()
2893 case CmpInst::ICMP_ULE: // not(X) <=u 0 -> X >u 0 -> X in simplifyICmpOfBools()
2894 case CmpInst::ICMP_SGE: // not(X) >=s 0 -> X <s 0 -> X in simplifyICmpOfBools()
2899 case CmpInst::ICMP_ULT: // X <u 0 -> false in simplifyICmpOfBools()
2900 case CmpInst::ICMP_SGT: // X >s 0 -> false in simplifyICmpOfBools()
2903 case CmpInst::ICMP_UGE: // X >=u 0 -> true in simplifyICmpOfBools()
2904 case CmpInst::ICMP_SLE: // X <=s 0 -> true in simplifyICmpOfBools()
2912 case CmpInst::ICMP_EQ: // X == 1 -> X in simplifyICmpOfBools()
2913 case CmpInst::ICMP_UGE: // X >=u 1 -> X in simplifyICmpOfBools()
2914 case CmpInst::ICMP_SLE: // X <=s -1 -> X in simplifyICmpOfBools()
2917 case CmpInst::ICMP_NE: // not(X) != 1 -> X == 1 -> X in simplifyICmpOfBools()
2918 case CmpInst::ICMP_ULT: // not(X) <=u 1 -> X >=u 1 -> X in simplifyICmpOfBools()
2919 case CmpInst::ICMP_SGT: // not(X) >s 1 -> X <=s -1 -> X in simplifyICmpOfBools()
2924 case CmpInst::ICMP_UGT: // X >u 1 -> false in simplifyICmpOfBools()
2925 case CmpInst::ICMP_SLT: // X <s -1 -> false in simplifyICmpOfBools()
2928 case CmpInst::ICMP_ULE: // X <=u 1 -> true in simplifyICmpOfBools()
2929 case CmpInst::ICMP_SGE: // X >=s -1 -> true in simplifyICmpOfBools()
2970 static Value *simplifyICmpWithZero(CmpInst::Predicate Pred, Value *LHS, in simplifyICmpWithZero()
3032 static Value *simplifyICmpWithConstant(CmpInst::Predicate Pred, Value *LHS, in simplifyICmpWithConstant()
3060 computeConstantRange(LHS, CmpInst::isSigned(Pred), IIQ.UseInstrInfo); in simplifyICmpWithConstant()
3081 static Value *simplifyICmpWithBinOpOnLHS(CmpInst::Predicate Pred, in simplifyICmpWithBinOpOnLHS()
3238 static bool trySimplifyICmpWithAdds(CmpInst::Predicate Pred, Value *LHS, in trySimplifyICmpWithAdds()
3241 if (Pred != CmpInst::ICMP_SLT || !IIQ.UseInstrInfo) in trySimplifyICmpWithAdds()
3263 static Value *simplifyICmpWithBinOp(CmpInst::Predicate Pred, Value *LHS, in simplifyICmpWithBinOp()
3278 (CmpInst::isUnsigned(Pred) && in simplifyICmpWithBinOp()
3280 (CmpInst::isSigned(Pred) && in simplifyICmpWithBinOp()
3288 (CmpInst::isUnsigned(Pred) && in simplifyICmpWithBinOp()
3290 (CmpInst::isSigned(Pred) && in simplifyICmpWithBinOp()
3347 if (!CmpInst::isUnsigned(Pred) && match(LHS, m_Neg(m_ZExt(m_Value())))) { in simplifyICmpWithBinOp()
3497 static Value *simplifyICmpWithMinMax(CmpInst::Predicate Pred, Value *LHS, in simplifyICmpWithMinMax()
3502 CmpInst::Predicate P = CmpInst::BAD_ICMP_PREDICATE; in simplifyICmpWithMinMax()
3503 CmpInst::Predicate EqP; // Chosen so that "A == max/min(A,B)" iff "A EqP B". in simplifyICmpWithMinMax()
3509 EqP = CmpInst::ICMP_SGE; // "A == smax(A, B)" iff "A sge B". in simplifyICmpWithMinMax()
3516 EqP = CmpInst::ICMP_SGE; // "A == smax(A, B)" iff "A sge B". in simplifyICmpWithMinMax()
3518 P = CmpInst::getSwappedPredicate(Pred); in simplifyICmpWithMinMax()
3523 EqP = CmpInst::ICMP_SLE; // "A == smin(A, B)" iff "A sle B". in simplifyICmpWithMinMax()
3526 P = CmpInst::getSwappedPredicate(Pred); in simplifyICmpWithMinMax()
3531 EqP = CmpInst::ICMP_SLE; // "A == smin(A, B)" iff "A sle B". in simplifyICmpWithMinMax()
3536 if (P != CmpInst::BAD_ICMP_PREDICATE) { in simplifyICmpWithMinMax()
3541 case CmpInst::ICMP_EQ: in simplifyICmpWithMinMax()
3542 case CmpInst::ICMP_SLE: in simplifyICmpWithMinMax()
3554 case CmpInst::ICMP_NE: in simplifyICmpWithMinMax()
3555 case CmpInst::ICMP_SGT: { in simplifyICmpWithMinMax()
3556 CmpInst::Predicate InvEqP = CmpInst::getInversePredicate(EqP); in simplifyICmpWithMinMax()
3569 case CmpInst::ICMP_SGE: in simplifyICmpWithMinMax()
3572 case CmpInst::ICMP_SLT: in simplifyICmpWithMinMax()
3579 P = CmpInst::BAD_ICMP_PREDICATE; in simplifyICmpWithMinMax()
3583 EqP = CmpInst::ICMP_UGE; // "A == umax(A, B)" iff "A uge B". in simplifyICmpWithMinMax()
3590 EqP = CmpInst::ICMP_UGE; // "A == umax(A, B)" iff "A uge B". in simplifyICmpWithMinMax()
3592 P = CmpInst::getSwappedPredicate(Pred); in simplifyICmpWithMinMax()
3597 EqP = CmpInst::ICMP_ULE; // "A == umin(A, B)" iff "A ule B". in simplifyICmpWithMinMax()
3600 P = CmpInst::getSwappedPredicate(Pred); in simplifyICmpWithMinMax()
3605 EqP = CmpInst::ICMP_ULE; // "A == umin(A, B)" iff "A ule B". in simplifyICmpWithMinMax()
3610 if (P != CmpInst::BAD_ICMP_PREDICATE) { in simplifyICmpWithMinMax()
3615 case CmpInst::ICMP_EQ: in simplifyICmpWithMinMax()
3616 case CmpInst::ICMP_ULE: in simplifyICmpWithMinMax()
3628 case CmpInst::ICMP_NE: in simplifyICmpWithMinMax()
3629 case CmpInst::ICMP_UGT: { in simplifyICmpWithMinMax()
3630 CmpInst::Predicate InvEqP = CmpInst::getInversePredicate(EqP); in simplifyICmpWithMinMax()
3643 case CmpInst::ICMP_UGE: in simplifyICmpWithMinMax()
3645 case CmpInst::ICMP_ULT: in simplifyICmpWithMinMax()
3663 if (Pred == CmpInst::ICMP_SGE) in simplifyICmpWithMinMax()
3666 if (Pred == CmpInst::ICMP_SLT) in simplifyICmpWithMinMax()
3672 if (Pred == CmpInst::ICMP_UGE) in simplifyICmpWithMinMax()
3675 if (Pred == CmpInst::ICMP_ULT) in simplifyICmpWithMinMax()
3682 static Value *simplifyICmpWithDominatingAssume(CmpInst::Predicate Predicate, in simplifyICmpWithDominatingAssume()
3705 static Value *simplifyICmpWithIntrinsicOnLHS(CmpInst::Predicate Pred, in simplifyICmpWithIntrinsicOnLHS()
3739 CmpInst::Predicate Pred = (CmpInst::Predicate)Predicate; in simplifyICmpInst()
3740 assert(CmpInst::isIntPredicate(Pred) && "Not an integer compare!"); in simplifyICmpInst()
3748 Pred = CmpInst::getSwappedPredicate(Pred); in simplifyICmpInst()
3767 return ConstantInt::get(ITy, CmpInst::isTrueWhenEqual(Pred)); in simplifyICmpInst()
3796 if (LHS_CR.icmp(CmpInst::getInversePredicate(Pred), RHS_CR)) in simplifyICmpInst()
4064 CmpInst::Predicate Pred = (CmpInst::Predicate)Predicate; in simplifyFCmpInst()
4065 assert(CmpInst::isFPPredicate(Pred) && "Not an FP compare!"); in simplifyFCmpInst()
4074 Pred = CmpInst::getSwappedPredicate(Pred); in simplifyFCmpInst()
4094 return ConstantInt::get(RetTy, CmpInst::isUnordered(Pred)); in simplifyFCmpInst()
4099 if (CmpInst::isTrueWhenEqual(Pred)) in simplifyFCmpInst()
4101 if (CmpInst::isFalseWhenEqual(Pred)) in simplifyFCmpInst()
4152 return ConstantInt::get(RetTy, CmpInst::isUnordered(Pred)); in simplifyFCmpInst()
4553 if (MMPred == CmpInst::getStrictPredicate(Pred)) in simplifyCmpSelOfMaxMin()
4561 if (Pred == CmpInst::ICMP_EQ) in simplifyCmpSelOfMaxMin()
4565 if (Pred == CmpInst::ICMP_NE) in simplifyCmpSelOfMaxMin()
4572 ICmpInst::Predicate InvPred = CmpInst::getInversePredicate(Pred); in simplifyCmpSelOfMaxMin()
4573 if (MMPred == CmpInst::getStrictPredicate(InvPred)) in simplifyCmpSelOfMaxMin()
6051 if (CmpInst::isIntPredicate((CmpInst::Predicate)Predicate)) in simplifyCmpInst()