Lines Matching refs:Pred
76 static bool isSignBitCheck(ICmpInst::Predicate Pred, const APInt &RHS, in isSignBitCheck() argument
78 switch (Pred) { in isSignBitCheck()
105 static bool isSignTest(ICmpInst::Predicate &Pred, const APInt &C) { in isSignTest() argument
106 if (!ICmpInst::isSigned(Pred)) in isSignTest()
110 return ICmpInst::isRelational(Pred); in isSignTest()
113 if (Pred == ICmpInst::ICMP_SLT) { in isSignTest()
114 Pred = ICmpInst::ICMP_SLE; in isSignTest()
118 if (Pred == ICmpInst::ICMP_SGT) { in isSignTest()
119 Pred = ICmpInst::ICMP_SGE; in isSignTest()
1083 ICmpInst::Predicate Pred) { in foldICmpAddOpConst() argument
1092 if (Pred == ICmpInst::ICMP_ULT || Pred == ICmpInst::ICMP_ULE) { in foldICmpAddOpConst()
1101 if (Pred == ICmpInst::ICMP_UGT || Pred == ICmpInst::ICMP_UGE) in foldICmpAddOpConst()
1113 if (Pred == ICmpInst::ICMP_SLT || Pred == ICmpInst::ICMP_SLE) in foldICmpAddOpConst()
1124 assert(Pred == ICmpInst::ICMP_SGT || Pred == ICmpInst::ICMP_SGE); in foldICmpAddOpConst()
1137 auto getICmp = [&I](CmpInst::Predicate Pred, Value *LHS, Value *RHS) { in foldICmpShrConstConst() argument
1139 Pred = CmpInst::getInversePredicate(Pred); in foldICmpShrConstConst()
1140 return new ICmpInst(Pred, LHS, RHS); in foldICmpShrConstConst()
1196 auto getICmp = [&I](CmpInst::Predicate Pred, Value *LHS, Value *RHS) { in foldICmpShlConstConst() argument
1198 Pred = CmpInst::getInversePredicate(Pred); in foldICmpShlConstConst()
1199 return new ICmpInst(Pred, LHS, RHS); in foldICmpShlConstConst()
1320 CmpInst::Predicate Pred = Cmp.getPredicate(); in foldICmpWithZero() local
1323 if (match(Cmp.getOperand(1), m_Zero()) && Pred == ICmpInst::ICMP_SGT) { in foldICmpWithZero()
1328 return new ICmpInst(Pred, B, Cmp.getOperand(1)); in foldICmpWithZero()
1330 return new ICmpInst(Pred, A, Cmp.getOperand(1)); in foldICmpWithZero()
1353 CmpInst::Predicate Pred = Cmp.getPredicate(); in foldICmpWithConstant() local
1357 if (Pred == ICmpInst::ICMP_UGT && match(Op1, m_ConstantInt(CI)) && in foldICmpWithConstant()
1391 CmpInst::Predicate Pred = Cmp.getPredicate(); in foldICmpWithDominatingICmp() local
1404 ConstantRange CR = ConstantRange::makeAllowedICmpRegion(Pred, *C); in foldICmpWithDominatingICmp()
1422 bool IsSignBit = isSignBitCheck(Pred, *C, UnusedBit); in foldICmpWithDominatingICmp()
1439 ICmpInst::Predicate Pred = Cmp.getPredicate(); in foldICmpTruncConstant() local
1444 if (Pred == ICmpInst::ICMP_SLT && match(X, m_Signum(m_Value(V)))) in foldICmpTruncConstant()
1461 return new ICmpInst(Pred, X, ConstantInt::get(X->getType(), NewRHS)); in foldICmpTruncConstant()
1480 ICmpInst::Predicate Pred = Cmp.getPredicate(); in foldICmpXorConstant() local
1504 Pred = Cmp.isSigned() ? Cmp.getUnsignedPredicate() in foldICmpXorConstant()
1506 return new ICmpInst(Pred, X, ConstantInt::get(X->getType(), C ^ *XorC)); in foldICmpXorConstant()
1511 Pred = Cmp.isSigned() ? Cmp.getUnsignedPredicate() in foldICmpXorConstant()
1513 Pred = Cmp.getSwappedPredicate(Pred); in foldICmpXorConstant()
1514 return new ICmpInst(Pred, X, ConstantInt::get(X->getType(), C ^ *XorC)); in foldICmpXorConstant()
1519 if (Pred == ICmpInst::ICMP_UGT) { in foldICmpXorConstant()
1527 if (Pred == ICmpInst::ICMP_ULT) { in foldICmpXorConstant()
1766 ICmpInst::Predicate Pred = Cmp.getPredicate(); in foldICmpOrConstant() local
1770 if (Pred == ICmpInst::ICMP_SLT && match(Or, m_Signum(m_Value(V)))) in foldICmpOrConstant()
1780 Pred = (Pred == CmpInst::ICMP_EQ) ? CmpInst::ICMP_ULE : CmpInst::ICMP_UGT; in foldICmpOrConstant()
1781 return new ICmpInst(Pred, Or->getOperand(0), Or->getOperand(1)); in foldICmpOrConstant()
1792 Builder.CreateICmp(Pred, P, ConstantInt::getNullValue(P->getType())); in foldICmpOrConstant()
1794 Builder.CreateICmp(Pred, Q, ConstantInt::getNullValue(Q->getType())); in foldICmpOrConstant()
1795 auto BOpc = Pred == CmpInst::ICMP_EQ ? Instruction::And : Instruction::Or; in foldICmpOrConstant()
1806 Value *Cmp12 = Builder.CreateICmp(Pred, X1, X2); in foldICmpOrConstant()
1807 Value *Cmp34 = Builder.CreateICmp(Pred, X3, X4); in foldICmpOrConstant()
1808 auto BOpc = Pred == CmpInst::ICMP_EQ ? Instruction::And : Instruction::Or; in foldICmpOrConstant()
1825 ICmpInst::Predicate Pred = Cmp.getPredicate(); in foldICmpMulConstant() local
1826 if (isSignTest(Pred, C) && Mul->hasNoSignedWrap()) { in foldICmpMulConstant()
1828 Pred = ICmpInst::getSwappedPredicate(Pred); in foldICmpMulConstant()
1829 return new ICmpInst(Pred, Mul->getOperand(0), in foldICmpMulConstant()
1846 ICmpInst::Predicate Pred = Cmp.getPredicate(); in foldICmpShlOne() local
1854 if (Pred == ICmpInst::ICMP_ULT) in foldICmpShlOne()
1855 Pred = ICmpInst::ICMP_ULE; in foldICmpShlOne()
1856 else if (Pred == ICmpInst::ICMP_UGE) in foldICmpShlOne()
1857 Pred = ICmpInst::ICMP_UGT; in foldICmpShlOne()
1864 if (Pred == ICmpInst::ICMP_UGE) in foldICmpShlOne()
1865 Pred = ICmpInst::ICMP_EQ; in foldICmpShlOne()
1866 else if (Pred == ICmpInst::ICMP_ULT) in foldICmpShlOne()
1867 Pred = ICmpInst::ICMP_NE; in foldICmpShlOne()
1869 return new ICmpInst(Pred, Y, ConstantInt::get(ShiftType, CLog2)); in foldICmpShlOne()
1874 if (Pred == ICmpInst::ICMP_SLE) in foldICmpShlOne()
1878 if (Pred == ICmpInst::ICMP_SGT) in foldICmpShlOne()
1883 if (Pred == ICmpInst::ICMP_SLT || Pred == ICmpInst::ICMP_SLE) in foldICmpShlOne()
1888 if (Pred == ICmpInst::ICMP_SGT || Pred == ICmpInst::ICMP_SGE) in foldICmpShlOne()
1892 return new ICmpInst(Pred, Y, ConstantInt::get(ShiftType, C.logBase2())); in foldICmpShlOne()
1916 ICmpInst::Predicate Pred = Cmp.getPredicate(); in foldICmpShlConstant() local
1924 if (Pred == ICmpInst::ICMP_SGT) { in foldICmpShlConstant()
1927 return new ICmpInst(Pred, X, ConstantInt::get(ShType, ShiftedC)); in foldICmpShlConstant()
1929 if ((Pred == ICmpInst::ICMP_EQ || Pred == ICmpInst::ICMP_NE) && in foldICmpShlConstant()
1932 return new ICmpInst(Pred, X, ConstantInt::get(ShType, ShiftedC)); in foldICmpShlConstant()
1934 if (Pred == ICmpInst::ICMP_SLT) { in foldICmpShlConstant()
1941 return new ICmpInst(Pred, X, ConstantInt::get(ShType, ShiftedC)); in foldICmpShlConstant()
1946 if (isSignTest(Pred, C)) in foldICmpShlConstant()
1947 return new ICmpInst(Pred, X, Constant::getNullValue(ShType)); in foldICmpShlConstant()
1954 if (Pred == ICmpInst::ICMP_UGT) { in foldICmpShlConstant()
1957 return new ICmpInst(Pred, X, ConstantInt::get(ShType, ShiftedC)); in foldICmpShlConstant()
1959 if ((Pred == ICmpInst::ICMP_EQ || Pred == ICmpInst::ICMP_NE) && in foldICmpShlConstant()
1962 return new ICmpInst(Pred, X, ConstantInt::get(ShType, ShiftedC)); in foldICmpShlConstant()
1964 if (Pred == ICmpInst::ICMP_ULT) { in foldICmpShlConstant()
1971 return new ICmpInst(Pred, X, ConstantInt::get(ShType, ShiftedC)); in foldICmpShlConstant()
1982 return new ICmpInst(Pred, And, LShrC); in foldICmpShlConstant()
1987 if (Shl->hasOneUse() && isSignBitCheck(Pred, C, TrueIfSigned)) { in foldICmpShlConstant()
2011 return new ICmpInst(Pred, Builder.CreateTrunc(X, TruncTy), NewC); in foldICmpShlConstant()
2024 CmpInst::Predicate Pred = Cmp.getPredicate(); in foldICmpShrConstant() local
2027 return new ICmpInst(Pred, X, Cmp.getOperand(1)); in foldICmpShrConstant()
2052 if (Pred == CmpInst::ICMP_SLT || (Pred == CmpInst::ICMP_SGT && IsExact)) { in foldICmpShrConstant()
2057 return new ICmpInst(Pred, X, ConstantInt::get(ShrTy, ShiftedC)); in foldICmpShrConstant()
2059 if (Pred == CmpInst::ICMP_SGT) { in foldICmpShrConstant()
2064 return new ICmpInst(Pred, X, ConstantInt::get(ShrTy, ShiftedC)); in foldICmpShrConstant()
2067 if (Pred == CmpInst::ICMP_ULT || (Pred == CmpInst::ICMP_UGT && IsExact)) { in foldICmpShrConstant()
2072 return new ICmpInst(Pred, X, ConstantInt::get(ShrTy, ShiftedC)); in foldICmpShrConstant()
2074 if (Pred == CmpInst::ICMP_UGT) { in foldICmpShrConstant()
2078 return new ICmpInst(Pred, X, ConstantInt::get(ShrTy, ShiftedC)); in foldICmpShrConstant()
2097 return new ICmpInst(Pred, X, ConstantInt::get(ShrTy, C << ShAmtVal)); in foldICmpShrConstant()
2105 return new ICmpInst(Pred, And, ConstantInt::get(ShrTy, C << ShAmtVal)); in foldICmpShrConstant()
2185 ICmpInst::Predicate Pred = Cmp.getPredicate(); in foldICmpDivConstant() local
2254 Pred = ICmpInst::getSwappedPredicate(Pred); in foldICmpDivConstant()
2258 switch (Pred) { in foldICmpDivConstant()
2293 return new ICmpInst(Pred, X, ConstantInt::get(Div->getType(), LoBound)); in foldICmpDivConstant()
2300 if (Pred == ICmpInst::ICMP_UGT) in foldICmpDivConstant()
2315 ICmpInst::Predicate Pred = Cmp.getPredicate(); in foldICmpSubConstant() local
2324 if (Pred == ICmpInst::ICMP_SGT && C.isAllOnesValue()) in foldICmpSubConstant()
2328 if (Pred == ICmpInst::ICMP_SGT && C.isNullValue()) in foldICmpSubConstant()
2332 if (Pred == ICmpInst::ICMP_SLT && C.isNullValue()) in foldICmpSubConstant()
2336 if (Pred == ICmpInst::ICMP_SLT && C.isOneValue()) in foldICmpSubConstant()
2346 if (Pred == ICmpInst::ICMP_ULT && C.isPowerOf2() && in foldICmpSubConstant()
2352 if (Pred == ICmpInst::ICMP_UGT && (C + 1).isPowerOf2() && (*C2 & C) == C) in foldICmpSubConstant()
2370 CmpInst::Predicate Pred = Cmp.getPredicate(); in foldICmpAddConstant() local
2379 (Pred == ICmpInst::ICMP_SGT || Pred == ICmpInst::ICMP_SLT)) || in foldICmpAddConstant()
2381 (Pred == ICmpInst::ICMP_UGT || Pred == ICmpInst::ICMP_ULT))) { in foldICmpAddConstant()
2390 return new ICmpInst(Pred, X, ConstantInt::get(Ty, NewC)); in foldICmpAddConstant()
2393 auto CR = ConstantRange::makeExactICmpRegion(Pred, C).subtract(*C2); in foldICmpAddConstant()
2411 if (Pred == ICmpInst::ICMP_ULT && C.isPowerOf2() && (*C2 & (C - 1)) == 0) in foldICmpAddConstant()
2418 if (Pred == ICmpInst::ICMP_UGT && (C + 1).isPowerOf2() && (*C2 & C) == 0) in foldICmpAddConstant()
2519 auto Pred = Cmp.getPredicate(); in foldICmpBitCastConstant() local
2528 return new ICmpInst(Pred, Extract, NewC); in foldICmpBitCastConstant()
2630 ICmpInst::Predicate Pred = Cmp.getPredicate(); in foldICmpBinOpEqualityWithConstant() local
2631 bool isICMP_NE = Pred == ICmpInst::ICMP_NE; in foldICmpBinOpEqualityWithConstant()
2642 return new ICmpInst(Pred, NewRem, in foldICmpBinOpEqualityWithConstant()
2653 return new ICmpInst(Pred, BOp0, SubC); in foldICmpBinOpEqualityWithConstant()
2659 return new ICmpInst(Pred, BOp0, NegVal); in foldICmpBinOpEqualityWithConstant()
2661 return new ICmpInst(Pred, NegVal, BOp1); in foldICmpBinOpEqualityWithConstant()
2665 return new ICmpInst(Pred, BOp0, Neg); in foldICmpBinOpEqualityWithConstant()
2675 return new ICmpInst(Pred, BOp0, ConstantExpr::getXor(RHS, BOC)); in foldICmpBinOpEqualityWithConstant()
2678 return new ICmpInst(Pred, BOp0, BOp1); in foldICmpBinOpEqualityWithConstant()
2688 return new ICmpInst(Pred, BOp1, SubC); in foldICmpBinOpEqualityWithConstant()
2691 return new ICmpInst(Pred, BOp0, BOp1); in foldICmpBinOpEqualityWithConstant()
2703 return new ICmpInst(Pred, And, NotBOC); in foldICmpBinOpEqualityWithConstant()
2742 return new ICmpInst(Pred, BOp0, Constant::getNullValue(RHS->getType())); in foldICmpBinOpEqualityWithConstant()
3109 const CmpInst::Predicate Pred = I.getPredicate(); in foldICmpBinOp() local
3116 Pred == ICmpInst::ICMP_ULT) in foldICmpBinOp()
3117 return new ICmpInst(Pred, Builder.CreateNot(Op1), X); in foldICmpBinOp()
3119 Pred == ICmpInst::ICMP_UGT) in foldICmpBinOp()
3120 return new ICmpInst(Pred, X, Builder.CreateNot(Op0)); in foldICmpBinOp()
3125 ICmpInst::isEquality(Pred) || in foldICmpBinOp()
3126 (CmpInst::isUnsigned(Pred) && BO0->hasNoUnsignedWrap()) || in foldICmpBinOp()
3127 (CmpInst::isSigned(Pred) && BO0->hasNoSignedWrap()); in foldICmpBinOp()
3130 ICmpInst::isEquality(Pred) || in foldICmpBinOp()
3131 (CmpInst::isUnsigned(Pred) && BO1->hasNoUnsignedWrap()) || in foldICmpBinOp()
3132 (CmpInst::isSigned(Pred) && BO1->hasNoSignedWrap()); in foldICmpBinOp()
3148 return new ICmpInst(Pred, A == Op1 ? B : A, in foldICmpBinOp()
3153 return new ICmpInst(Pred, Constant::getNullValue(Op0->getType()), in foldICmpBinOp()
3181 return new ICmpInst(Pred, Y, Z); in foldICmpBinOp()
3185 if (A && NoOp0WrapProblem && Pred == CmpInst::ICMP_SLT && in foldICmpBinOp()
3190 if (A && NoOp0WrapProblem && Pred == CmpInst::ICMP_SGE && in foldICmpBinOp()
3195 if (A && NoOp0WrapProblem && Pred == CmpInst::ICMP_SLE && match(B, m_One())) in foldICmpBinOp()
3199 if (A && NoOp0WrapProblem && Pred == CmpInst::ICMP_SGT && match(B, m_One())) in foldICmpBinOp()
3203 if (C && NoOp1WrapProblem && Pred == CmpInst::ICMP_SGT && in foldICmpBinOp()
3208 if (C && NoOp1WrapProblem && Pred == CmpInst::ICMP_SLE && in foldICmpBinOp()
3213 if (C && NoOp1WrapProblem && Pred == CmpInst::ICMP_SGE && match(D, m_One())) in foldICmpBinOp()
3217 if (C && NoOp1WrapProblem && Pred == CmpInst::ICMP_SLT && match(D, m_One())) in foldICmpBinOp()
3230 if (A && NoOp0WrapProblem && Pred == CmpInst::ICMP_ULE && match(B, m_One())) in foldICmpBinOp()
3234 if (A && NoOp0WrapProblem && Pred == CmpInst::ICMP_UGT && match(B, m_One())) in foldICmpBinOp()
3238 if (C && NoOp1WrapProblem && Pred == CmpInst::ICMP_UGE && match(D, m_One())) in foldICmpBinOp()
3242 if (C && NoOp1WrapProblem && Pred == CmpInst::ICMP_ULT && match(D, m_One())) in foldICmpBinOp()
3264 return new ICmpInst(Pred, NewAdd, C); in foldICmpBinOp()
3268 return new ICmpInst(Pred, A, NewAdd); in foldICmpBinOp()
3290 return new ICmpInst(Pred, Constant::getNullValue(Op1->getType()), B); in foldICmpBinOp()
3293 return new ICmpInst(Pred, D, Constant::getNullValue(Op0->getType())); in foldICmpBinOp()
3296 if (A == Op1 && Pred == ICmpInst::ICMP_UGT) in foldICmpBinOp()
3299 if (C == Op0 && Pred == ICmpInst::ICMP_ULT) in foldICmpBinOp()
3306 return new ICmpInst(Pred, A, C); in foldICmpBinOp()
3311 return new ICmpInst(Pred, D, B); in foldICmpBinOp()
3314 if (NoOp0WrapProblem && ICmpInst::isSigned(Pred)) { in foldICmpBinOp()
3334 switch (SRem == BO0 ? ICmpInst::getSwappedPredicate(Pred) : Pred) { in foldICmpBinOp()
3361 return new ICmpInst(Pred, BO0->getOperand(0), BO1->getOperand(0)); in foldICmpBinOp()
3397 return new ICmpInst(Pred, And1, And2); in foldICmpBinOp()
3402 return new ICmpInst(Pred, BO0->getOperand(0), BO1->getOperand(0)); in foldICmpBinOp()
3410 return new ICmpInst(Pred, BO0->getOperand(0), BO1->getOperand(0)); in foldICmpBinOp()
3415 return new ICmpInst(Pred, BO0->getOperand(0), BO1->getOperand(0)); in foldICmpBinOp()
3420 return new ICmpInst(Pred, BO0->getOperand(0), BO1->getOperand(0)); in foldICmpBinOp()
3429 return new ICmpInst(Pred, BO0->getOperand(0), BO1->getOperand(0)); in foldICmpBinOp()
3439 if (match(BO0, BitwiseAnd) && Pred == ICmpInst::ICMP_ULT) { in foldICmpBinOp()
3456 ICmpInst::Predicate Pred = Cmp.getPredicate(); in foldICmpWithMinMax() local
3466 Pred = Cmp.getSwappedPredicate(); in foldICmpWithMinMax()
3473 if (Pred == CmpInst::ICMP_EQ || Pred == CmpInst::ICMP_SGE) in foldICmpWithMinMax()
3478 if (Pred == CmpInst::ICMP_NE || Pred == CmpInst::ICMP_SLT) in foldICmpWithMinMax()
3490 if (Pred == CmpInst::ICMP_EQ || Pred == CmpInst::ICMP_SLE) in foldICmpWithMinMax()
3495 if (Pred == CmpInst::ICMP_NE || Pred == CmpInst::ICMP_SGT) in foldICmpWithMinMax()
3507 if (Pred == CmpInst::ICMP_EQ || Pred == CmpInst::ICMP_UGE) in foldICmpWithMinMax()
3512 if (Pred == CmpInst::ICMP_NE || Pred == CmpInst::ICMP_ULT) in foldICmpWithMinMax()
3524 if (Pred == CmpInst::ICMP_EQ || Pred == CmpInst::ICMP_ULE) in foldICmpWithMinMax()
3529 if (Pred == CmpInst::ICMP_NE || Pred == CmpInst::ICMP_UGT) in foldICmpWithMinMax()
3546 const CmpInst::Predicate Pred = I.getPredicate(); in foldICmpEquality() local
3551 return new ICmpInst(Pred, OtherVal, Constant::getNullValue(A->getType())); in foldICmpEquality()
3561 return new ICmpInst(Pred, A, Xor); in foldICmpEquality()
3566 return new ICmpInst(Pred, B, D); in foldICmpEquality()
3568 return new ICmpInst(Pred, B, C); in foldICmpEquality()
3570 return new ICmpInst(Pred, A, D); in foldICmpEquality()
3572 return new ICmpInst(Pred, A, C); in foldICmpEquality()
3579 return new ICmpInst(Pred, OtherVal, Constant::getNullValue(A->getType())); in foldICmpEquality()
3624 return new ICmpInst(Pred, A, Builder.CreateTrunc(B, A->getType())); in foldICmpEquality()
3637 Pred == ICmpInst::ICMP_NE ? ICmpInst::ICMP_UGE : ICmpInst::ICMP_ULT; in foldICmpEquality()
3654 return new ICmpInst(Pred, And, Constant::getNullValue(Cst1->getType())); in foldICmpEquality()
3678 return new ICmpInst(Pred, Mask, Builder.getInt(CmpV)); in foldICmpEquality()
3689 return new ICmpInst(Pred, A, B); in foldICmpEquality()
4331 ICmpInst::Predicate Pred = I.getPredicate(); in foldICmpUsingKnownBits() local
4370 return new ICmpInst(Pred, ConstantExpr::getIntegerValue(Ty, Op0Min), Op1); in foldICmpUsingKnownBits()
4372 return new ICmpInst(Pred, Op0, ConstantExpr::getIntegerValue(Ty, Op1Min)); in foldICmpUsingKnownBits()
4376 switch (Pred) { in foldICmpUsingKnownBits()
4382 return Pred == CmpInst::ICMP_EQ in foldICmpUsingKnownBits()
4407 auto NewPred = ICmpInst::getInversePredicate(Pred); in foldICmpUsingKnownBits()
4414 Pred == CmpInst::ICMP_EQ ? CmpInst::ICMP_UGE : CmpInst::ICMP_ULT; in foldICmpUsingKnownBits()
4426 auto NewPred = ICmpInst::getInversePredicate(Pred); in foldICmpUsingKnownBits()
4558 ICmpInst::Predicate Pred = I.getPredicate(); in canonicalizeCmpWithConstant() local
4559 if (Pred != ICmpInst::ICMP_SLE && Pred != ICmpInst::ICMP_SGE && in canonicalizeCmpWithConstant()
4560 Pred != ICmpInst::ICMP_ULE && Pred != ICmpInst::ICMP_UGE) in canonicalizeCmpWithConstant()
4575 bool IsLE = (Pred == ICmpInst::ICMP_SLE || Pred == ICmpInst::ICMP_ULE); in canonicalizeCmpWithConstant()
4694 ICmpInst::Predicate Pred, NewPred; in foldICmpWithHighBitMask() local
4697 m_c_ICmp(Pred, m_OneUse(m_Shl(m_One(), m_Value(Y))), m_Value(X)))) { in foldICmpWithHighBitMask()
4700 Pred = Cmp.getSwappedPredicate(); in foldICmpWithHighBitMask()
4702 switch (Pred) { in foldICmpWithHighBitMask()
4712 } else if (match(&Cmp, m_c_ICmp(Pred, in foldICmpWithHighBitMask()
4723 Pred = Cmp.getSwappedPredicate(); in foldICmpWithHighBitMask()
4725 switch (Pred) { in foldICmpWithHighBitMask()
4842 ICmpInst::Predicate Pred = I.getPredicate(); in visitICmpInst() local
4846 if (Pred == ICmpInst::ICMP_UGT && C->isMaxSignedValue()) { in visitICmpInst()
4852 if (Pred == ICmpInst::ICMP_ULT && C->isMinSignedValue()) { in visitICmpInst()
4891 if ((Pred == ICmpInst::ICMP_EQ || Pred == ICmpInst::ICMP_SLT || in visitICmpInst()
4892 Pred == ICmpInst::ICMP_NE || Pred == ICmpInst::ICMP_SGT) && in visitICmpInst()
4894 return new ICmpInst(Pred, X, ConstantInt::getNullValue(X->getType())); in visitICmpInst()
4897 if (Pred == ICmpInst::ICMP_SLT && match(Op1, m_One())) in visitICmpInst()
4898 return new ICmpInst(Pred, X, ConstantInt::get(X->getType(), 1)); in visitICmpInst()
4901 if (Pred == ICmpInst::ICMP_SGT && match(Op1, m_AllOnes())) in visitICmpInst()
4902 return new ICmpInst(Pred, X, ConstantInt::getAllOnesValue(X->getType())); in visitICmpInst()
4910 return new ICmpInst(Pred, X, ConstantInt::getNullValue(X->getType())); in visitICmpInst()
5116 ICmpInst::Predicate Pred; in foldFCmpIntToFPConst() local
5121 Pred = ICmpInst::ICMP_EQ; in foldFCmpIntToFPConst()
5125 Pred = LHSUnsigned ? ICmpInst::ICMP_UGT : ICmpInst::ICMP_SGT; in foldFCmpIntToFPConst()
5129 Pred = LHSUnsigned ? ICmpInst::ICMP_UGE : ICmpInst::ICMP_SGE; in foldFCmpIntToFPConst()
5133 Pred = LHSUnsigned ? ICmpInst::ICMP_ULT : ICmpInst::ICMP_SLT; in foldFCmpIntToFPConst()
5137 Pred = LHSUnsigned ? ICmpInst::ICMP_ULE : ICmpInst::ICMP_SLE; in foldFCmpIntToFPConst()
5141 Pred = ICmpInst::ICMP_NE; in foldFCmpIntToFPConst()
5162 if (Pred == ICmpInst::ICMP_NE || Pred == ICmpInst::ICMP_SLT || in foldFCmpIntToFPConst()
5163 Pred == ICmpInst::ICMP_SLE) in foldFCmpIntToFPConst()
5174 if (Pred == ICmpInst::ICMP_NE || Pred == ICmpInst::ICMP_ULT || in foldFCmpIntToFPConst()
5175 Pred == ICmpInst::ICMP_ULE) in foldFCmpIntToFPConst()
5187 if (Pred == ICmpInst::ICMP_NE || Pred == ICmpInst::ICMP_SGT || in foldFCmpIntToFPConst()
5188 Pred == ICmpInst::ICMP_SGE) in foldFCmpIntToFPConst()
5198 if (Pred == ICmpInst::ICMP_NE || Pred == ICmpInst::ICMP_UGT || in foldFCmpIntToFPConst()
5199 Pred == ICmpInst::ICMP_UGE) in foldFCmpIntToFPConst()
5220 switch (Pred) { in foldFCmpIntToFPConst()
5236 Pred = ICmpInst::ICMP_SLT; in foldFCmpIntToFPConst()
5243 Pred = ICmpInst::ICMP_ULE; in foldFCmpIntToFPConst()
5249 Pred = ICmpInst::ICMP_SLE; in foldFCmpIntToFPConst()
5261 Pred = ICmpInst::ICMP_SGE; in foldFCmpIntToFPConst()
5268 Pred = ICmpInst::ICMP_UGT; in foldFCmpIntToFPConst()
5274 Pred = ICmpInst::ICMP_SGT; in foldFCmpIntToFPConst()
5282 return new ICmpInst(Pred, LHSI->getOperand(0), RHSInt); in foldFCmpIntToFPConst()
5301 FCmpInst::Predicate Pred = I.getPredicate(); in foldFCmpReciprocalAndZero() local
5304 if ((Pred != FCmpInst::FCMP_OGT) && (Pred != FCmpInst::FCMP_OLT) && in foldFCmpReciprocalAndZero()
5305 (Pred != FCmpInst::FCMP_OGE) && (Pred != FCmpInst::FCMP_OLE)) in foldFCmpReciprocalAndZero()
5327 Pred = I.getSwappedPredicate(); in foldFCmpReciprocalAndZero()
5329 return new FCmpInst(Pred, LHSI->getOperand(1), RHSC, "", &I); in foldFCmpReciprocalAndZero()
5407 const CmpInst::Predicate Pred = I.getPredicate(); in visitFCmpInst() local
5409 if (Value *V = SimplifyFCmpInst(Pred, Op0, Op1, I.getFastMathFlags(), in visitFCmpInst()
5415 switch (Pred) { in visitFCmpInst()
5439 if (Pred == CmpInst::FCMP_ORD || Pred == CmpInst::FCMP_UNO) { in visitFCmpInst()
5525 return new FCmpInst(Pred, X, Y, "", &I); in visitFCmpInst()
5544 return new FCmpInst(Pred, X, NewC, "", &I); in visitFCmpInst()