Lines Matching refs:Pred
77 static bool isSignTest(ICmpInst::Predicate &Pred, const APInt &C) { in isSignTest() argument
78 if (!ICmpInst::isSigned(Pred)) in isSignTest()
82 return ICmpInst::isRelational(Pred); in isSignTest()
85 if (Pred == ICmpInst::ICMP_SLT) { in isSignTest()
86 Pred = ICmpInst::ICMP_SLE; in isSignTest()
90 if (Pred == ICmpInst::ICMP_SGT) { in isSignTest()
91 Pred = ICmpInst::ICMP_SGE; in isSignTest()
1089 ICmpInst::Predicate Pred) { in foldICmpAddOpConst() argument
1098 if (Pred == ICmpInst::ICMP_ULT || Pred == ICmpInst::ICMP_ULE) { in foldICmpAddOpConst()
1107 if (Pred == ICmpInst::ICMP_UGT || Pred == ICmpInst::ICMP_UGE) in foldICmpAddOpConst()
1119 if (Pred == ICmpInst::ICMP_SLT || Pred == ICmpInst::ICMP_SLE) in foldICmpAddOpConst()
1130 assert(Pred == ICmpInst::ICMP_SGT || Pred == ICmpInst::ICMP_SGE); in foldICmpAddOpConst()
1143 auto getICmp = [&I](CmpInst::Predicate Pred, Value *LHS, Value *RHS) { in foldICmpShrConstConst() argument
1145 Pred = CmpInst::getInversePredicate(Pred); in foldICmpShrConstConst()
1146 return new ICmpInst(Pred, LHS, RHS); in foldICmpShrConstConst()
1202 auto getICmp = [&I](CmpInst::Predicate Pred, Value *LHS, Value *RHS) { in foldICmpShlConstConst() argument
1204 Pred = CmpInst::getInversePredicate(Pred); in foldICmpShlConstConst()
1205 return new ICmpInst(Pred, LHS, RHS); in foldICmpShlConstConst()
1333 ICmpInst::Predicate Pred; in foldIRemByPowerOfTwoToBitTest() local
1335 if (!match(&I, m_ICmp(Pred, m_OneUse(m_IRem(m_Value(X), m_Value(Y))), in foldIRemByPowerOfTwoToBitTest()
1343 return ICmpInst::Create(Instruction::ICmp, Pred, Masked, Zero); in foldIRemByPowerOfTwoToBitTest()
1350 ICmpInst::Predicate Pred; in foldSignBitTest() local
1351 if (!I.isEquality() || !match(&I, m_ICmp(Pred, m_Instruction(Val), m_Zero()))) in foldSignBitTest()
1373 Pred == ICmpInst::ICMP_EQ ? ICmpInst::ICMP_SGE in foldSignBitTest()
1380 CmpInst::Predicate Pred = Cmp.getPredicate(); in foldICmpWithZero() local
1385 if (Pred == ICmpInst::ICMP_SGT) { in foldICmpWithZero()
1390 return new ICmpInst(Pred, B, Cmp.getOperand(1)); in foldICmpWithZero()
1392 return new ICmpInst(Pred, A, Cmp.getOperand(1)); in foldICmpWithZero()
1405 ICmpInst::isEquality(Pred)) { in foldICmpWithZero()
1409 return new ICmpInst(Pred, X, Cmp.getOperand(1)); in foldICmpWithZero()
1432 CmpInst::Predicate Pred = Cmp.getPredicate(); in foldICmpWithConstant() local
1436 if (Pred == ICmpInst::ICMP_UGT && match(Op1, m_ConstantInt(CI)) && in foldICmpWithConstant()
1455 auto *BoolInput = ConstantExpr::getCompare(Pred, Input, C); in foldICmpWithConstant()
1491 CmpInst::Predicate Pred = Cmp.getPredicate(); in foldICmpWithDominatingICmp() local
1504 ConstantRange CR = ConstantRange::makeExactICmpRegion(Pred, *C); in foldICmpWithDominatingICmp()
1522 bool IsSignBit = isSignBitCheck(Pred, *C, UnusedBit); in foldICmpWithDominatingICmp()
1545 ICmpInst::Predicate Pred = Cmp.getPredicate(); in foldICmpTruncConstant() local
1550 if (Pred == ICmpInst::ICMP_SLT && match(X, m_Signum(m_Value(V)))) in foldICmpTruncConstant()
1567 return new ICmpInst(Pred, X, ConstantInt::get(X->getType(), NewRHS)); in foldICmpTruncConstant()
1577 if (isSignBitCheck(Pred, C, TrueIfSigned) && in foldICmpTruncConstant()
1602 ICmpInst::Predicate Pred = Cmp.getPredicate(); in foldICmpXorConstant() local
1623 Pred = Cmp.getFlippedSignednessPredicate(); in foldICmpXorConstant()
1624 return new ICmpInst(Pred, X, ConstantInt::get(X->getType(), C ^ *XorC)); in foldICmpXorConstant()
1629 Pred = Cmp.getFlippedSignednessPredicate(); in foldICmpXorConstant()
1630 Pred = Cmp.getSwappedPredicate(Pred); in foldICmpXorConstant()
1631 return new ICmpInst(Pred, X, ConstantInt::get(X->getType(), C ^ *XorC)); in foldICmpXorConstant()
1636 if (Pred == ICmpInst::ICMP_UGT) { in foldICmpXorConstant()
1644 if (Pred == ICmpInst::ICMP_ULT) { in foldICmpXorConstant()
1858 const ICmpInst::Predicate Pred = Cmp.getPredicate(); in foldICmpAndConstant() local
1860 if (isSignBitCheck(Pred, C, TrueIfNeg)) { in foldICmpAndConstant()
1894 Pred == CmpInst::ICMP_EQ ? CmpInst::ICMP_UGT : CmpInst::ICMP_ULE; in foldICmpAndConstant()
1910 Pred == CmpInst::ICMP_EQ ? CmpInst::ICMP_SGE : CmpInst::ICMP_SLT; in foldICmpAndConstant()
1922 ICmpInst::Predicate Pred = Cmp.getPredicate(); in foldICmpOrConstant() local
1926 if (Pred == ICmpInst::ICMP_SLT && match(Or, m_Signum(m_Value(V)))) in foldICmpOrConstant()
1938 Pred = (Pred == CmpInst::ICMP_EQ) ? CmpInst::ICMP_ULE : CmpInst::ICMP_UGT; in foldICmpOrConstant()
1939 return new ICmpInst(Pred, OrOp0, OrOp1); in foldICmpOrConstant()
1949 return new ICmpInst(Pred, And, NewC); in foldICmpOrConstant()
1961 Builder.CreateICmp(Pred, P, ConstantInt::getNullValue(P->getType())); in foldICmpOrConstant()
1963 Builder.CreateICmp(Pred, Q, ConstantInt::getNullValue(Q->getType())); in foldICmpOrConstant()
1964 auto BOpc = Pred == CmpInst::ICMP_EQ ? Instruction::And : Instruction::Or; in foldICmpOrConstant()
1975 Value *Cmp12 = Builder.CreateICmp(Pred, X1, X2); in foldICmpOrConstant()
1976 Value *Cmp34 = Builder.CreateICmp(Pred, X3, X4); in foldICmpOrConstant()
1977 auto BOpc = Pred == CmpInst::ICMP_EQ ? Instruction::And : Instruction::Or; in foldICmpOrConstant()
1994 ICmpInst::Predicate Pred = Cmp.getPredicate(); in foldICmpMulConstant() local
1995 if (isSignTest(Pred, C) && Mul->hasNoSignedWrap()) { in foldICmpMulConstant()
1997 Pred = ICmpInst::getSwappedPredicate(Pred); in foldICmpMulConstant()
1998 return new ICmpInst(Pred, Mul->getOperand(0), in foldICmpMulConstant()
2008 return new ICmpInst(Pred, Mul->getOperand(0), NewC); in foldICmpMulConstant()
2013 return new ICmpInst(Pred, Mul->getOperand(0), NewC); in foldICmpMulConstant()
2030 ICmpInst::Predicate Pred = Cmp.getPredicate(); in foldICmpShlOne() local
2038 if (Pred == ICmpInst::ICMP_ULT) in foldICmpShlOne()
2039 Pred = ICmpInst::ICMP_ULE; in foldICmpShlOne()
2040 else if (Pred == ICmpInst::ICMP_UGE) in foldICmpShlOne()
2041 Pred = ICmpInst::ICMP_UGT; in foldICmpShlOne()
2048 if (Pred == ICmpInst::ICMP_UGE) in foldICmpShlOne()
2049 Pred = ICmpInst::ICMP_EQ; in foldICmpShlOne()
2050 else if (Pred == ICmpInst::ICMP_ULT) in foldICmpShlOne()
2051 Pred = ICmpInst::ICMP_NE; in foldICmpShlOne()
2053 return new ICmpInst(Pred, Y, ConstantInt::get(ShiftType, CLog2)); in foldICmpShlOne()
2058 if (Pred == ICmpInst::ICMP_SLE) in foldICmpShlOne()
2062 if (Pred == ICmpInst::ICMP_SGT) in foldICmpShlOne()
2067 if (Pred == ICmpInst::ICMP_SLT || Pred == ICmpInst::ICMP_SLE) in foldICmpShlOne()
2072 if (Pred == ICmpInst::ICMP_SGT || Pred == ICmpInst::ICMP_SGE) in foldICmpShlOne()
2076 return new ICmpInst(Pred, Y, ConstantInt::get(ShiftType, C.logBase2())); in foldICmpShlOne()
2100 ICmpInst::Predicate Pred = Cmp.getPredicate(); in foldICmpShlConstant() local
2108 if (Pred == ICmpInst::ICMP_SGT) { in foldICmpShlConstant()
2111 return new ICmpInst(Pred, X, ConstantInt::get(ShType, ShiftedC)); in foldICmpShlConstant()
2113 if ((Pred == ICmpInst::ICMP_EQ || Pred == ICmpInst::ICMP_NE) && in foldICmpShlConstant()
2116 return new ICmpInst(Pred, X, ConstantInt::get(ShType, ShiftedC)); in foldICmpShlConstant()
2118 if (Pred == ICmpInst::ICMP_SLT) { in foldICmpShlConstant()
2125 return new ICmpInst(Pred, X, ConstantInt::get(ShType, ShiftedC)); in foldICmpShlConstant()
2130 if (isSignTest(Pred, C)) in foldICmpShlConstant()
2131 return new ICmpInst(Pred, X, Constant::getNullValue(ShType)); in foldICmpShlConstant()
2138 if (Pred == ICmpInst::ICMP_UGT) { in foldICmpShlConstant()
2141 return new ICmpInst(Pred, X, ConstantInt::get(ShType, ShiftedC)); in foldICmpShlConstant()
2143 if ((Pred == ICmpInst::ICMP_EQ || Pred == ICmpInst::ICMP_NE) && in foldICmpShlConstant()
2146 return new ICmpInst(Pred, X, ConstantInt::get(ShType, ShiftedC)); in foldICmpShlConstant()
2148 if (Pred == ICmpInst::ICMP_ULT) { in foldICmpShlConstant()
2155 return new ICmpInst(Pred, X, ConstantInt::get(ShType, ShiftedC)); in foldICmpShlConstant()
2166 return new ICmpInst(Pred, And, LShrC); in foldICmpShlConstant()
2171 if (Shl->hasOneUse() && isSignBitCheck(Pred, C, TrueIfSigned)) { in foldICmpShlConstant()
2185 (Pred == ICmpInst::ICMP_ULE || Pred == ICmpInst::ICMP_UGT)) { in foldICmpShlConstant()
2187 return new ICmpInst(Pred == ICmpInst::ICMP_ULE ? ICmpInst::ICMP_EQ in foldICmpShlConstant()
2193 (Pred == ICmpInst::ICMP_ULT || Pred == ICmpInst::ICMP_UGE)) { in foldICmpShlConstant()
2196 return new ICmpInst(Pred == ICmpInst::ICMP_ULT ? ICmpInst::ICMP_EQ in foldICmpShlConstant()
2216 return new ICmpInst(Pred, Builder.CreateTrunc(X, TruncTy), NewC); in foldICmpShlConstant()
2229 CmpInst::Predicate Pred = Cmp.getPredicate(); in foldICmpShrConstant() local
2232 return new ICmpInst(Pred, X, Cmp.getOperand(1)); in foldICmpShrConstant()
2257 if (Pred == CmpInst::ICMP_SLT || (Pred == CmpInst::ICMP_SGT && IsExact)) { in foldICmpShrConstant()
2262 return new ICmpInst(Pred, X, ConstantInt::get(ShrTy, ShiftedC)); in foldICmpShrConstant()
2264 if (Pred == CmpInst::ICMP_SGT) { in foldICmpShrConstant()
2269 return new ICmpInst(Pred, X, ConstantInt::get(ShrTy, ShiftedC)); in foldICmpShrConstant()
2277 if (Pred == CmpInst::ICMP_UGT) { in foldICmpShrConstant()
2281 if (Pred == CmpInst::ICMP_ULT) { in foldICmpShrConstant()
2287 if (Pred == CmpInst::ICMP_ULT || (Pred == CmpInst::ICMP_UGT && IsExact)) { in foldICmpShrConstant()
2292 return new ICmpInst(Pred, X, ConstantInt::get(ShrTy, ShiftedC)); in foldICmpShrConstant()
2294 if (Pred == CmpInst::ICMP_UGT) { in foldICmpShrConstant()
2298 return new ICmpInst(Pred, X, ConstantInt::get(ShrTy, ShiftedC)); in foldICmpShrConstant()
2317 return new ICmpInst(Pred, X, ConstantInt::get(ShrTy, C << ShAmtVal)); in foldICmpShrConstant()
2321 if (Pred == CmpInst::ICMP_EQ) in foldICmpShrConstant()
2335 return new ICmpInst(Pred, And, ConstantInt::get(ShrTy, C << ShAmtVal)); in foldICmpShrConstant()
2347 const ICmpInst::Predicate Pred = Cmp.getPredicate(); in foldICmpSRemConstant() local
2348 if (Pred != ICmpInst::ICMP_SGT && Pred != ICmpInst::ICMP_SLT) in foldICmpSRemConstant()
2370 if (Pred == ICmpInst::ICMP_SGT) in foldICmpSRemConstant()
2453 ICmpInst::Predicate Pred = Cmp.getPredicate(); in foldICmpDivConstant() local
2522 Pred = ICmpInst::getSwappedPredicate(Pred); in foldICmpDivConstant()
2526 switch (Pred) { in foldICmpDivConstant()
2561 return new ICmpInst(Pred, X, ConstantInt::get(Div->getType(), LoBound)); in foldICmpDivConstant()
2568 if (Pred == ICmpInst::ICMP_UGT) in foldICmpDivConstant()
2583 ICmpInst::Predicate Pred = Cmp.getPredicate(); in foldICmpSubConstant() local
2607 if (Pred == ICmpInst::ICMP_SGT && C.isAllOnesValue()) in foldICmpSubConstant()
2611 if (Pred == ICmpInst::ICMP_SGT && C.isNullValue()) in foldICmpSubConstant()
2615 if (Pred == ICmpInst::ICMP_SLT && C.isNullValue()) in foldICmpSubConstant()
2619 if (Pred == ICmpInst::ICMP_SLT && C.isOneValue()) in foldICmpSubConstant()
2628 if (Pred == ICmpInst::ICMP_ULT && C.isPowerOf2() && in foldICmpSubConstant()
2634 if (Pred == ICmpInst::ICMP_UGT && (C + 1).isPowerOf2() && (*C2 & C) == C) in foldICmpSubConstant()
2652 const CmpInst::Predicate Pred = Cmp.getPredicate(); in foldICmpAddConstant() local
2658 (Pred == ICmpInst::ICMP_SGT || Pred == ICmpInst::ICMP_SLT)) || in foldICmpAddConstant()
2660 (Pred == ICmpInst::ICMP_UGT || Pred == ICmpInst::ICMP_ULT))) { in foldICmpAddConstant()
2669 return new ICmpInst(Pred, X, ConstantInt::get(Ty, NewC)); in foldICmpAddConstant()
2672 auto CR = ConstantRange::makeExactICmpRegion(Pred, C).subtract(*C2); in foldICmpAddConstant()
2694 if (Pred == CmpInst::ICMP_UGT && C == *C2 + SMax) in foldICmpAddConstant()
2698 if (Pred == CmpInst::ICMP_ULT && C == *C2 + SMin) in foldICmpAddConstant()
2702 if (Pred == CmpInst::ICMP_SGT && C == *C2 - 1) in foldICmpAddConstant()
2706 if (Pred == CmpInst::ICMP_SLT && C == *C2) in foldICmpAddConstant()
2715 if (Pred == ICmpInst::ICMP_ULT && C.isPowerOf2() && (*C2 & (C - 1)) == 0) in foldICmpAddConstant()
2722 if (Pred == ICmpInst::ICMP_UGT && (C + 1).isPowerOf2() && (*C2 & C) == 0) in foldICmpAddConstant()
2839 ICmpInst::Predicate Pred = Cmp.getPredicate(); in foldICmpBitCast() local
2853 if ((Pred == ICmpInst::ICMP_EQ || Pred == ICmpInst::ICMP_SLT || in foldICmpBitCast()
2854 Pred == ICmpInst::ICMP_NE || Pred == ICmpInst::ICMP_SGT) && in foldICmpBitCast()
2856 return new ICmpInst(Pred, X, ConstantInt::getNullValue(X->getType())); in foldICmpBitCast()
2859 if (Pred == ICmpInst::ICMP_SLT && match(Op1, m_One())) in foldICmpBitCast()
2860 return new ICmpInst(Pred, X, ConstantInt::get(X->getType(), 1)); in foldICmpBitCast()
2863 if (Pred == ICmpInst::ICMP_SGT && match(Op1, m_AllOnes())) in foldICmpBitCast()
2864 return new ICmpInst(Pred, X, in foldICmpBitCast()
2873 return new ICmpInst(Pred, X, ConstantInt::getNullValue(X->getType())); in foldICmpBitCast()
2882 InstCombiner::isSignBitCheck(Pred, *C, TrueIfSigned)) { in foldICmpBitCast()
2917 return new ICmpInst(Pred, BCSrcOp, Op1); in foldICmpBitCast()
2949 return new ICmpInst(Pred, Extract, NewC); in foldICmpBitCast()
3050 ICmpInst::Predicate Pred = Cmp.getPredicate(); in foldICmpBinOpEqualityWithConstant() local
3051 bool isICMP_NE = Pred == ICmpInst::ICMP_NE; in foldICmpBinOpEqualityWithConstant()
3062 return new ICmpInst(Pred, NewRem, in foldICmpBinOpEqualityWithConstant()
3071 return new ICmpInst(Pred, BOp0, ConstantExpr::getSub(RHS, BOC)); in foldICmpBinOpEqualityWithConstant()
3076 return new ICmpInst(Pred, BOp0, NegVal); in foldICmpBinOpEqualityWithConstant()
3078 return new ICmpInst(Pred, NegVal, BOp1); in foldICmpBinOpEqualityWithConstant()
3082 return new ICmpInst(Pred, BOp0, Neg); in foldICmpBinOpEqualityWithConstant()
3092 return new ICmpInst(Pred, BOp0, ConstantExpr::getXor(RHS, BOC)); in foldICmpBinOpEqualityWithConstant()
3095 return new ICmpInst(Pred, BOp0, BOp1); in foldICmpBinOpEqualityWithConstant()
3105 return new ICmpInst(Pred, BOp1, ConstantExpr::getSub(BOC, RHS)); in foldICmpBinOpEqualityWithConstant()
3108 return new ICmpInst(Pred, BOp0, BOp1); in foldICmpBinOpEqualityWithConstant()
3120 return new ICmpInst(Pred, And, NotBOC); in foldICmpBinOpEqualityWithConstant()
3236 ICmpInst::Predicate Pred = Cmp.getPredicate(); in foldICmpIntrinsicWithConstant() local
3241 if (C == BitWidth - 1 && Pred == ICmpInst::ICMP_UGT) in foldICmpIntrinsicWithConstant()
3245 if (C == BitWidth && Pred == ICmpInst::ICMP_ULT) in foldICmpIntrinsicWithConstant()
3252 if (Pred == ICmpInst::ICMP_UGT && C.ult(BitWidth)) { in foldICmpIntrinsicWithConstant()
3260 if (Pred == ICmpInst::ICMP_ULT && C.uge(1) && C.ule(BitWidth)) { in foldICmpIntrinsicWithConstant()
3274 if (Pred == ICmpInst::ICMP_UGT && C.ult(BitWidth)) { in foldICmpIntrinsicWithConstant()
3282 if (Pred == ICmpInst::ICMP_ULT && C.uge(1) && C.ule(BitWidth)) { in foldICmpIntrinsicWithConstant()
3755 ICmpInst::Predicate Pred; in foldUnsignedMultiplicationOverflowCheck() local
3761 match(&I, m_c_ICmp(Pred, m_OneUse(m_UDiv(m_AllOnes(), m_Value(X))), in foldUnsignedMultiplicationOverflowCheck()
3766 switch (Pred) { in foldUnsignedMultiplicationOverflowCheck()
3778 match(&I, m_c_ICmp(Pred, m_Value(Y), in foldUnsignedMultiplicationOverflowCheck()
3783 NeedNegation = Pred == ICmpInst::Predicate::ICMP_EQ; in foldUnsignedMultiplicationOverflowCheck()
3817 CmpInst::Predicate Pred; in foldICmpXNegX() local
3819 if (!match(&I, m_c_ICmp(Pred, m_NSWNeg(m_Value(X)), m_Deferred(X)))) in foldICmpXNegX()
3822 if (ICmpInst::isSigned(Pred)) in foldICmpXNegX()
3823 Pred = ICmpInst::getSwappedPredicate(Pred); in foldICmpXNegX()
3824 else if (ICmpInst::isUnsigned(Pred)) in foldICmpXNegX()
3825 Pred = ICmpInst::getSignedPredicate(Pred); in foldICmpXNegX()
3828 return ICmpInst::Create(Instruction::ICmp, Pred, X, in foldICmpXNegX()
3850 const CmpInst::Predicate Pred = I.getPredicate(); in foldICmpBinOp() local
3856 (Pred == ICmpInst::ICMP_ULT || Pred == ICmpInst::ICMP_UGE)) in foldICmpBinOp()
3857 return new ICmpInst(Pred, Builder.CreateNot(Op1), X); in foldICmpBinOp()
3860 (Pred == ICmpInst::ICMP_UGT || Pred == ICmpInst::ICMP_ULE)) in foldICmpBinOp()
3861 return new ICmpInst(Pred, X, Builder.CreateNot(Op0)); in foldICmpBinOp()
3866 ICmpInst::isEquality(Pred) || in foldICmpBinOp()
3867 (CmpInst::isUnsigned(Pred) && BO0->hasNoUnsignedWrap()) || in foldICmpBinOp()
3868 (CmpInst::isSigned(Pred) && BO0->hasNoSignedWrap()); in foldICmpBinOp()
3871 ICmpInst::isEquality(Pred) || in foldICmpBinOp()
3872 (CmpInst::isUnsigned(Pred) && BO1->hasNoUnsignedWrap()) || in foldICmpBinOp()
3873 (CmpInst::isSigned(Pred) && BO1->hasNoSignedWrap()); in foldICmpBinOp()
3890 return new ICmpInst(Pred, A == Op1 ? B : A, in foldICmpBinOp()
3896 return new ICmpInst(Pred, Constant::getNullValue(Op0->getType()), in foldICmpBinOp()
3922 return new ICmpInst(Pred, Y, Z); in foldICmpBinOp()
3926 if (A && NoOp0WrapProblem && Pred == CmpInst::ICMP_SLT && in foldICmpBinOp()
3931 if (A && NoOp0WrapProblem && Pred == CmpInst::ICMP_SGE && in foldICmpBinOp()
3936 if (A && NoOp0WrapProblem && Pred == CmpInst::ICMP_SLE && match(B, m_One())) in foldICmpBinOp()
3940 if (A && NoOp0WrapProblem && Pred == CmpInst::ICMP_SGT && match(B, m_One())) in foldICmpBinOp()
3944 if (C && NoOp1WrapProblem && Pred == CmpInst::ICMP_SGT && in foldICmpBinOp()
3949 if (C && NoOp1WrapProblem && Pred == CmpInst::ICMP_SLE && in foldICmpBinOp()
3954 if (C && NoOp1WrapProblem && Pred == CmpInst::ICMP_SGE && match(D, m_One())) in foldICmpBinOp()
3958 if (C && NoOp1WrapProblem && Pred == CmpInst::ICMP_SLT && match(D, m_One())) in foldICmpBinOp()
3971 if (A && NoOp0WrapProblem && Pred == CmpInst::ICMP_ULE && match(B, m_One())) in foldICmpBinOp()
3975 if (A && NoOp0WrapProblem && Pred == CmpInst::ICMP_UGT && match(B, m_One())) in foldICmpBinOp()
3979 if (C && NoOp1WrapProblem && Pred == CmpInst::ICMP_UGE && match(D, m_One())) in foldICmpBinOp()
3983 if (C && NoOp1WrapProblem && Pred == CmpInst::ICMP_ULT && match(D, m_One())) in foldICmpBinOp()
4007 return new ICmpInst(Pred, NewAdd, C); in foldICmpBinOp()
4013 return new ICmpInst(Pred, A, NewAdd); in foldICmpBinOp()
4035 return new ICmpInst(Pred, Constant::getNullValue(Op1->getType()), B); in foldICmpBinOp()
4038 return new ICmpInst(Pred, D, Constant::getNullValue(Op0->getType())); in foldICmpBinOp()
4042 if (A == Op1 && (Pred == ICmpInst::ICMP_UGT || Pred == ICmpInst::ICMP_ULE)) in foldICmpBinOp()
4043 return new ICmpInst(Pred, B, A); in foldICmpBinOp()
4045 if (C == Op0 && (Pred == ICmpInst::ICMP_ULT || Pred == ICmpInst::ICMP_UGE)) in foldICmpBinOp()
4046 return new ICmpInst(Pred, C, D); in foldICmpBinOp()
4048 if (A == Op1 && (Pred == ICmpInst::ICMP_UGE || Pred == ICmpInst::ICMP_ULT) && in foldICmpBinOp()
4050 return new ICmpInst(CmpInst::getFlippedStrictnessPredicate(Pred), B, A); in foldICmpBinOp()
4052 if (C == Op0 && (Pred == ICmpInst::ICMP_ULE || Pred == ICmpInst::ICMP_UGT) && in foldICmpBinOp()
4054 return new ICmpInst(CmpInst::getFlippedStrictnessPredicate(Pred), C, D); in foldICmpBinOp()
4058 return new ICmpInst(Pred, A, C); in foldICmpBinOp()
4062 return new ICmpInst(Pred, D, B); in foldICmpBinOp()
4065 if (NoOp0WrapProblem && ICmpInst::isSigned(Pred)) { in foldICmpBinOp()
4084 return new ICmpInst(Pred, X, Y); in foldICmpBinOp()
4098 switch (SRem == BO0 ? ICmpInst::getSwappedPredicate(Pred) : Pred) { in foldICmpBinOp()
4125 return new ICmpInst(Pred, BO0->getOperand(0), BO1->getOperand(0)); in foldICmpBinOp()
4159 return new ICmpInst(Pred, And1, And2); in foldICmpBinOp()
4168 return new ICmpInst(Pred, BO0->getOperand(0), BO1->getOperand(0)); in foldICmpBinOp()
4173 return new ICmpInst(Pred, BO0->getOperand(0), BO1->getOperand(0)); in foldICmpBinOp()
4178 return new ICmpInst(Pred, BO0->getOperand(0), BO1->getOperand(0)); in foldICmpBinOp()
4187 return new ICmpInst(Pred, BO0->getOperand(0), BO1->getOperand(0)); in foldICmpBinOp()
4197 if (match(BO0, BitwiseAnd) && Pred == ICmpInst::ICMP_ULT) { in foldICmpBinOp()
4220 ICmpInst::Predicate Pred = Cmp.getPredicate(); in foldICmpWithMinMax() local
4230 Pred = Cmp.getSwappedPredicate(); in foldICmpWithMinMax()
4237 if (Pred == CmpInst::ICMP_EQ || Pred == CmpInst::ICMP_SGE) in foldICmpWithMinMax()
4242 if (Pred == CmpInst::ICMP_NE || Pred == CmpInst::ICMP_SLT) in foldICmpWithMinMax()
4254 if (Pred == CmpInst::ICMP_EQ || Pred == CmpInst::ICMP_SLE) in foldICmpWithMinMax()
4259 if (Pred == CmpInst::ICMP_NE || Pred == CmpInst::ICMP_SGT) in foldICmpWithMinMax()
4271 if (Pred == CmpInst::ICMP_EQ || Pred == CmpInst::ICMP_UGE) in foldICmpWithMinMax()
4276 if (Pred == CmpInst::ICMP_NE || Pred == CmpInst::ICMP_ULT) in foldICmpWithMinMax()
4288 if (Pred == CmpInst::ICMP_EQ || Pred == CmpInst::ICMP_ULE) in foldICmpWithMinMax()
4293 if (Pred == CmpInst::ICMP_NE || Pred == CmpInst::ICMP_UGT) in foldICmpWithMinMax()
4310 const CmpInst::Predicate Pred = I.getPredicate(); in foldICmpEquality() local
4315 return new ICmpInst(Pred, OtherVal, Constant::getNullValue(A->getType())); in foldICmpEquality()
4325 return new ICmpInst(Pred, A, Xor); in foldICmpEquality()
4330 return new ICmpInst(Pred, B, D); in foldICmpEquality()
4332 return new ICmpInst(Pred, B, C); in foldICmpEquality()
4334 return new ICmpInst(Pred, A, D); in foldICmpEquality()
4336 return new ICmpInst(Pred, A, C); in foldICmpEquality()
4343 return new ICmpInst(Pred, OtherVal, Constant::getNullValue(A->getType())); in foldICmpEquality()
4372 return new ICmpInst(Pred, Op1, Constant::getNullValue(Op1->getType())); in foldICmpEquality()
4386 return new ICmpInst(Pred, A, Builder.CreateTrunc(B, A->getType())); in foldICmpEquality()
4399 Pred == ICmpInst::ICMP_NE ? ICmpInst::ICMP_UGE : ICmpInst::ICMP_ULT; in foldICmpEquality()
4416 return new ICmpInst(Pred, And, Constant::getNullValue(Cst1->getType())); in foldICmpEquality()
4440 return new ICmpInst(Pred, Mask, Builder.getInt(CmpV)); in foldICmpEquality()
4451 return new ICmpInst(Pred, A, B); in foldICmpEquality()
4472 return Pred == ICmpInst::ICMP_EQ in foldICmpEquality()
5114 ICmpInst::Predicate Pred = I.getPredicate(); in foldICmpUsingKnownBits() local
5157 return new ICmpInst(Pred, ConstantExpr::getIntegerValue(Ty, Op0Min), Op1); in foldICmpUsingKnownBits()
5159 return new ICmpInst(Pred, Op0, ConstantExpr::getIntegerValue(Ty, Op1Min)); in foldICmpUsingKnownBits()
5176 switch (Pred) { in foldICmpUsingKnownBits()
5240 switch (Pred) { in foldICmpUsingKnownBits()
5247 I, ConstantInt::getBool(I.getType(), Pred == CmpInst::ICMP_NE)); in foldICmpUsingKnownBits()
5269 auto NewPred = ICmpInst::getInversePredicate(Pred); in foldICmpUsingKnownBits()
5276 Pred == CmpInst::ICMP_EQ ? CmpInst::ICMP_UGE : CmpInst::ICMP_ULT; in foldICmpUsingKnownBits()
5288 auto NewPred = ICmpInst::getInversePredicate(Pred); in foldICmpUsingKnownBits()
5371 InstCombiner::getFlippedStrictnessPredicateAndConstant(CmpInst::Predicate Pred, in getFlippedStrictnessPredicateAndConstant() argument
5373 assert(ICmpInst::isRelational(Pred) && ICmpInst::isIntPredicate(Pred) && in getFlippedStrictnessPredicateAndConstant()
5377 bool IsSigned = ICmpInst::isSigned(Pred); in getFlippedStrictnessPredicateAndConstant()
5379 CmpInst::Predicate UnsignedPred = ICmpInst::getUnsignedPredicate(Pred); in getFlippedStrictnessPredicateAndConstant()
5427 CmpInst::Predicate NewPred = CmpInst::getFlippedStrictnessPredicate(Pred); in getFlippedStrictnessPredicateAndConstant()
5440 ICmpInst::Predicate Pred = I.getPredicate(); in canonicalizeCmpWithConstant() local
5441 if (ICmpInst::isEquality(Pred) || !ICmpInst::isIntPredicate(Pred) || in canonicalizeCmpWithConstant()
5442 InstCombiner::isCanonicalPredicate(Pred)) in canonicalizeCmpWithConstant()
5452 InstCombiner::getFlippedStrictnessPredicateAndConstant(Pred, Op1C); in canonicalizeCmpWithConstant()
5463 CmpInst::Predicate Pred = I.getPredicate(); in canonicalizeICmpPredicate() local
5464 if (InstCombiner::isCanonicalPredicate(Pred)) in canonicalizeICmpPredicate()
5473 I.setPredicate(CmpInst::getInversePredicate(Pred)); in canonicalizeICmpPredicate()
5564 ICmpInst::Predicate Pred, NewPred; in foldICmpWithHighBitMask() local
5567 m_c_ICmp(Pred, m_OneUse(m_Shl(m_One(), m_Value(Y))), m_Value(X)))) { in foldICmpWithHighBitMask()
5568 switch (Pred) { in foldICmpWithHighBitMask()
5578 } else if (match(&Cmp, m_c_ICmp(Pred, in foldICmpWithHighBitMask()
5587 switch (Pred) { in foldICmpWithHighBitMask()
5607 const CmpInst::Predicate Pred = Cmp.getPredicate(); in foldVectorCmp() local
5620 Value *NewCmp = Builder.CreateCmp(Pred, V1, V2); in foldVectorCmp()
5641 Value *NewCmp = Builder.CreateCmp(Pred, V1, C); in foldVectorCmp()
5652 CmpInst::Predicate Pred = I.getPredicate(); in foldICmpOfUAddOv() local
5660 ((Pred == ICmpInst::ICMP_ULT && (Op1 == A || Op1 == B)) || in foldICmpOfUAddOv()
5661 (Pred == ICmpInst::ICMP_EQ && match(Op1, m_ZeroInt()) && in foldICmpOfUAddOv()
5663 (Pred == ICmpInst::ICMP_NE && match(Op1, m_AllOnes()) && in foldICmpOfUAddOv()
5670 Pred == ICmpInst::ICMP_UGT && (Op0 == A || Op0 == B)) in foldICmpOfUAddOv()
5764 ICmpInst::Predicate Pred = I.getPredicate(); in visitICmpInst() local
5768 if (Pred == ICmpInst::ICMP_UGT && C->isMaxSignedValue()) { in visitICmpInst()
5774 if (Pred == ICmpInst::ICMP_ULT && C->isMinSignedValue()) { in visitICmpInst()
5987 ICmpInst::Predicate Pred; in foldFCmpIntToFPConst() local
5992 Pred = ICmpInst::ICMP_EQ; in foldFCmpIntToFPConst()
5996 Pred = LHSUnsigned ? ICmpInst::ICMP_UGT : ICmpInst::ICMP_SGT; in foldFCmpIntToFPConst()
6000 Pred = LHSUnsigned ? ICmpInst::ICMP_UGE : ICmpInst::ICMP_SGE; in foldFCmpIntToFPConst()
6004 Pred = LHSUnsigned ? ICmpInst::ICMP_ULT : ICmpInst::ICMP_SLT; in foldFCmpIntToFPConst()
6008 Pred = LHSUnsigned ? ICmpInst::ICMP_ULE : ICmpInst::ICMP_SLE; in foldFCmpIntToFPConst()
6012 Pred = ICmpInst::ICMP_NE; in foldFCmpIntToFPConst()
6033 if (Pred == ICmpInst::ICMP_NE || Pred == ICmpInst::ICMP_SLT || in foldFCmpIntToFPConst()
6034 Pred == ICmpInst::ICMP_SLE) in foldFCmpIntToFPConst()
6045 if (Pred == ICmpInst::ICMP_NE || Pred == ICmpInst::ICMP_ULT || in foldFCmpIntToFPConst()
6046 Pred == ICmpInst::ICMP_ULE) in foldFCmpIntToFPConst()
6058 if (Pred == ICmpInst::ICMP_NE || Pred == ICmpInst::ICMP_SGT || in foldFCmpIntToFPConst()
6059 Pred == ICmpInst::ICMP_SGE) in foldFCmpIntToFPConst()
6069 if (Pred == ICmpInst::ICMP_NE || Pred == ICmpInst::ICMP_UGT || in foldFCmpIntToFPConst()
6070 Pred == ICmpInst::ICMP_UGE) in foldFCmpIntToFPConst()
6091 switch (Pred) { in foldFCmpIntToFPConst()
6107 Pred = ICmpInst::ICMP_SLT; in foldFCmpIntToFPConst()
6114 Pred = ICmpInst::ICMP_ULE; in foldFCmpIntToFPConst()
6120 Pred = ICmpInst::ICMP_SLE; in foldFCmpIntToFPConst()
6132 Pred = ICmpInst::ICMP_SGE; in foldFCmpIntToFPConst()
6139 Pred = ICmpInst::ICMP_UGT; in foldFCmpIntToFPConst()
6145 Pred = ICmpInst::ICMP_SGT; in foldFCmpIntToFPConst()
6153 return new ICmpInst(Pred, LHSI->getOperand(0), RHSInt); in foldFCmpIntToFPConst()
6172 FCmpInst::Predicate Pred = I.getPredicate(); in foldFCmpReciprocalAndZero() local
6175 if ((Pred != FCmpInst::FCMP_OGT) && (Pred != FCmpInst::FCMP_OLT) && in foldFCmpReciprocalAndZero()
6176 (Pred != FCmpInst::FCMP_OGE) && (Pred != FCmpInst::FCMP_OLE)) in foldFCmpReciprocalAndZero()
6198 Pred = I.getSwappedPredicate(); in foldFCmpReciprocalAndZero()
6200 return new FCmpInst(Pred, LHSI->getOperand(1), RHSC, "", &I); in foldFCmpReciprocalAndZero()
6277 const CmpInst::Predicate Pred = I.getPredicate(); in visitFCmpInst() local
6279 if (Value *V = SimplifyFCmpInst(Pred, Op0, Op1, I.getFastMathFlags(), in visitFCmpInst()
6287 switch (Pred) { in visitFCmpInst()
6311 if (Pred == CmpInst::FCMP_ORD || Pred == CmpInst::FCMP_UNO) { in visitFCmpInst()
6392 return new FCmpInst(Pred, X, Y, "", &I); in visitFCmpInst()
6410 return new FCmpInst(Pred, X, NewC, "", &I); in visitFCmpInst()
6428 if (Pred == FCmpInst::FCMP_OLT) { in visitFCmpInst()