Lines Matching refs:CmpInst

91   CmpInst::Predicate ExpectedPred, Pred1, Pred2;  in foldSelectWithBinaryOp()
134 static bool isSameCompare(Value *V, CmpInst::Predicate Pred, Value *LHS, in isSameCompare()
136 CmpInst *Cmp = dyn_cast<CmpInst>(V); in isSameCompare()
139 CmpInst::Predicate CPred = Cmp->getPredicate(); in isSameCompare()
143 return CPred == CmpInst::getSwappedPredicate(Pred) && CLHS == RHS && in isSameCompare()
152 static Value *simplifyCmpSelCase(CmpInst::Predicate Pred, Value *LHS, in simplifyCmpSelCase()
169 static Value *simplifyCmpSelTrueCase(CmpInst::Predicate Pred, Value *LHS, in simplifyCmpSelTrueCase()
178 static Value *simplifyCmpSelFalseCase(CmpInst::Predicate Pred, Value *LHS, in simplifyCmpSelFalseCase()
473 static Value *threadCmpOverSelect(CmpInst::Predicate Pred, Value *LHS, in threadCmpOverSelect()
483 Pred = CmpInst::getSwappedPredicate(Pred); in threadCmpOverSelect()
566 static Value *threadCmpOverPHI(CmpInst::Predicate Pred, Value *LHS, Value *RHS, in threadCmpOverPHI()
575 Pred = CmpInst::getSwappedPredicate(Pred); in threadCmpOverPHI()
760 isImpliedByDomCondition(CmpInst::ICMP_EQ, Op0, Op1, Q.CxtI, Q.DL); in simplifyByDomEq()
1038 if (isICmpTrue(CmpInst::ICMP_SLT, Y, NegDividendC, Q, MaxRecurse) || in isDivZero()
1039 isICmpTrue(CmpInst::ICMP_SGT, Y, PosDividendC, Q, MaxRecurse)) in isDivZero()
1047 return isICmpTrue(CmpInst::ICMP_NE, X, Y, Q, MaxRecurse); in isDivZero()
1054 if (isICmpTrue(CmpInst::ICMP_SGT, X, NegDivisorC, Q, MaxRecurse) && in isDivZero()
1055 isICmpTrue(CmpInst::ICMP_SLT, X, PosDivisorC, Q, MaxRecurse)) in isDivZero()
2606 return CmpInst::makeCmpResultType(Op->getType()); in getCompareTy()
2612 static Value *extractEquivalentCondition(Value *V, CmpInst::Predicate Pred, in extractEquivalentCondition()
2617 CmpInst *Cmp = dyn_cast<CmpInst>(SI->getCondition()); in extractEquivalentCondition()
2623 if (Pred == CmpInst::getSwappedPredicate(Cmp->getPredicate()) && in extractEquivalentCondition()
2721 static Constant *computePointerICmp(CmpInst::Predicate Pred, Value *LHS, in computePointerICmp()
2733 case CmpInst::ICMP_EQ: in computePointerICmp()
2734 case CmpInst::ICMP_NE: in computePointerICmp()
2739 case CmpInst::ICMP_UGT: in computePointerICmp()
2740 case CmpInst::ICMP_UGE: in computePointerICmp()
2741 case CmpInst::ICMP_ULT: in computePointerICmp()
2742 case CmpInst::ICMP_ULE: in computePointerICmp()
2771 if (Pred == CmpInst::ICMP_EQ || Pred == CmpInst::ICMP_NE) { in computePointerICmp()
2794 !CmpInst::isTrueWhenEqual(Pred)); in computePointerICmp()
2822 !CmpInst::isTrueWhenEqual(Pred)); in computePointerICmp()
2861 CmpInst::isFalseWhenEqual(Pred)); in computePointerICmp()
2870 static Value *simplifyICmpOfBools(CmpInst::Predicate Pred, Value *LHS, in simplifyICmpOfBools()
2890 case CmpInst::ICMP_NE: // X != 0 -> X in simplifyICmpOfBools()
2891 case CmpInst::ICMP_UGT: // X >u 0 -> X in simplifyICmpOfBools()
2892 case CmpInst::ICMP_SLT: // X <s 0 -> X in simplifyICmpOfBools()
2895 case CmpInst::ICMP_EQ: // not(X) == 0 -> X != 0 -> X in simplifyICmpOfBools()
2896 case CmpInst::ICMP_ULE: // not(X) <=u 0 -> X >u 0 -> X in simplifyICmpOfBools()
2897 case CmpInst::ICMP_SGE: // not(X) >=s 0 -> X <s 0 -> X in simplifyICmpOfBools()
2902 case CmpInst::ICMP_ULT: // X <u 0 -> false in simplifyICmpOfBools()
2903 case CmpInst::ICMP_SGT: // X >s 0 -> false in simplifyICmpOfBools()
2906 case CmpInst::ICMP_UGE: // X >=u 0 -> true in simplifyICmpOfBools()
2907 case CmpInst::ICMP_SLE: // X <=s 0 -> true in simplifyICmpOfBools()
2915 case CmpInst::ICMP_EQ: // X == 1 -> X in simplifyICmpOfBools()
2916 case CmpInst::ICMP_UGE: // X >=u 1 -> X in simplifyICmpOfBools()
2917 case CmpInst::ICMP_SLE: // X <=s -1 -> X in simplifyICmpOfBools()
2920 case CmpInst::ICMP_NE: // not(X) != 1 -> X == 1 -> X in simplifyICmpOfBools()
2921 case CmpInst::ICMP_ULT: // not(X) <=u 1 -> X >=u 1 -> X in simplifyICmpOfBools()
2922 case CmpInst::ICMP_SGT: // not(X) >s 1 -> X <=s -1 -> X in simplifyICmpOfBools()
2927 case CmpInst::ICMP_UGT: // X >u 1 -> false in simplifyICmpOfBools()
2928 case CmpInst::ICMP_SLT: // X <s -1 -> false in simplifyICmpOfBools()
2931 case CmpInst::ICMP_ULE: // X <=u 1 -> true in simplifyICmpOfBools()
2932 case CmpInst::ICMP_SGE: // X >=s -1 -> true in simplifyICmpOfBools()
2973 static Value *simplifyICmpWithZero(CmpInst::Predicate Pred, Value *LHS, in simplifyICmpWithZero()
3033 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()
3754 CmpInst::Predicate Pred = (CmpInst::Predicate)Predicate; in simplifyICmpInst()
3755 assert(CmpInst::isIntPredicate(Pred) && "Not an integer compare!"); in simplifyICmpInst()
3763 Pred = CmpInst::getSwappedPredicate(Pred); in simplifyICmpInst()
3782 return ConstantInt::get(ITy, CmpInst::isTrueWhenEqual(Pred)); in simplifyICmpInst()
3802 if (LhsCr->icmp(CmpInst::getInversePredicate(Pred), *RhsCr)) in simplifyICmpInst()
4071 CmpInst::Predicate Pred = (CmpInst::Predicate)Predicate; in simplifyFCmpInst()
4072 assert(CmpInst::isFPPredicate(Pred) && "Not an FP compare!"); in simplifyFCmpInst()
4081 Pred = CmpInst::getSwappedPredicate(Pred); in simplifyFCmpInst()
4101 return ConstantInt::get(RetTy, CmpInst::isUnordered(Pred)); in simplifyFCmpInst()
4106 if (CmpInst::isTrueWhenEqual(Pred)) in simplifyFCmpInst()
4108 if (CmpInst::isFalseWhenEqual(Pred)) in simplifyFCmpInst()
4127 return ConstantInt::get(RetTy, Pred == CmpInst::FCMP_UNO); in simplifyFCmpInst()
4165 return ConstantInt::get(RetTy, CmpInst::isUnordered(Pred)); in simplifyFCmpInst()
4579 if (MMPred == CmpInst::getStrictPredicate(Pred)) in simplifyCmpSelOfMaxMin()
4587 if (Pred == CmpInst::ICMP_EQ) in simplifyCmpSelOfMaxMin()
4591 if (Pred == CmpInst::ICMP_NE) in simplifyCmpSelOfMaxMin()
4598 ICmpInst::Predicate InvPred = CmpInst::getInversePredicate(Pred); in simplifyCmpSelOfMaxMin()
4599 if (MMPred == CmpInst::getStrictPredicate(InvPred)) in simplifyCmpSelOfMaxMin()
6093 if (CmpInst::isIntPredicate((CmpInst::Predicate)Predicate)) in simplifyCmpInst()
6559 if (isICmpTrue(CmpInst::ICMP_EQ, Op0, Op1, Q, RecursionLimit)) in simplifyBinaryIntrinsic()