Lines Matching refs:Cmp

769         Value *Cmp = Builder.CreateICmp(ICmpInst::getSignedPredicate(Cond),  in foldGEPICmp()  local
771 return replaceInstUsesWith(I, Cmp); in foldGEPICmp()
1201 Instruction *InstCombinerImpl::foldICmpWithZero(ICmpInst &Cmp) { in foldICmpWithZero() argument
1202 CmpInst::Predicate Pred = Cmp.getPredicate(); in foldICmpWithZero()
1203 if (!match(Cmp.getOperand(1), m_Zero())) in foldICmpWithZero()
1209 if (match(Cmp.getOperand(0), m_SMin(m_Value(A), m_Value(B)))) { in foldICmpWithZero()
1210 if (isKnownPositive(A, SQ.getWithInstruction(&Cmp))) in foldICmpWithZero()
1211 return new ICmpInst(Pred, B, Cmp.getOperand(1)); in foldICmpWithZero()
1212 if (isKnownPositive(B, SQ.getWithInstruction(&Cmp))) in foldICmpWithZero()
1213 return new ICmpInst(Pred, A, Cmp.getOperand(1)); in foldICmpWithZero()
1217 if (Instruction *New = foldIRemByPowerOfTwoToBitTest(Cmp)) in foldICmpWithZero()
1225 if (match(Cmp.getOperand(0), m_URem(m_Value(X), m_Value(Y))) && in foldICmpWithZero()
1227 KnownBits XKnown = computeKnownBits(X, 0, &Cmp); in foldICmpWithZero()
1228 KnownBits YKnown = computeKnownBits(Y, 0, &Cmp); in foldICmpWithZero()
1230 return new ICmpInst(Pred, X, Cmp.getOperand(1)); in foldICmpWithZero()
1235 if (match(Cmp.getOperand(0), m_Mul(m_Value(X), m_Value(Y))) && in foldICmpWithZero()
1238 KnownBits XKnown = computeKnownBits(X, 0, &Cmp); in foldICmpWithZero()
1242 return new ICmpInst(Pred, Y, Cmp.getOperand(1)); in foldICmpWithZero()
1244 KnownBits YKnown = computeKnownBits(Y, 0, &Cmp); in foldICmpWithZero()
1248 return new ICmpInst(Pred, X, Cmp.getOperand(1)); in foldICmpWithZero()
1250 auto *BO0 = cast<OverflowingBinaryOperator>(Cmp.getOperand(0)); in foldICmpWithZero()
1252 const SimplifyQuery Q = SQ.getWithInstruction(&Cmp); in foldICmpWithZero()
1259 return new ICmpInst(Pred, Y, Cmp.getOperand(1)); in foldICmpWithZero()
1264 return new ICmpInst(Pred, X, Cmp.getOperand(1)); in foldICmpWithZero()
1283 Instruction *InstCombinerImpl::foldICmpWithConstant(ICmpInst &Cmp) { in foldICmpWithConstant() argument
1295 CmpInst::Predicate Pred = Cmp.getPredicate(); in foldICmpWithConstant()
1296 Value *Op0 = Cmp.getOperand(0), *Op1 = Cmp.getOperand(1); in foldICmpWithConstant()
1301 if (Instruction *Res = processUGT_ADDCST_ADD(Cmp, A, B, CI2, CI, *this)) in foldICmpWithConstant()
1320 PHINode *NewPhi = Builder.CreatePHI(Cmp.getType(), Phi->getNumOperands()); in foldICmpWithConstant()
1323 return replaceInstUsesWith(Cmp, NewPhi); in foldICmpWithConstant()
1326 if (Instruction *R = tryFoldInstWithCtpopWithNot(&Cmp)) in foldICmpWithConstant()
1333 Instruction *InstCombinerImpl::foldICmpWithDominatingICmp(ICmpInst &Cmp) { in foldICmpWithDominatingICmp() argument
1336 Value *X = Cmp.getOperand(0), *Y = Cmp.getOperand(1); in foldICmpWithDominatingICmp()
1342 CmpInst::Predicate Pred = Cmp.getPredicate(); in foldICmpWithDominatingICmp()
1363 return replaceInstUsesWith(Cmp, Builder.getFalse()); in foldICmpWithDominatingICmp()
1365 return replaceInstUsesWith(Cmp, Builder.getTrue()); in foldICmpWithDominatingICmp()
1374 if (Cmp.isEquality() || (IsSignBit && hasBranchUse(Cmp))) in foldICmpWithDominatingICmp()
1379 if (Cmp.hasOneUse() && in foldICmpWithDominatingICmp()
1380 match(Cmp.user_back(), m_MaxOrMin(m_Value(), m_Value()))) in foldICmpWithDominatingICmp()
1393 if (DT.dominates(Edge0, Cmp.getParent())) { in foldICmpWithDominatingICmp()
1398 if (DT.dominates(Edge1, Cmp.getParent())) in foldICmpWithDominatingICmp()
1408 Instruction *InstCombinerImpl::foldICmpTruncConstant(ICmpInst &Cmp, in foldICmpTruncConstant() argument
1411 ICmpInst::Predicate Pred = Cmp.getPredicate(); in foldICmpTruncConstant()
1428 if (Cmp.isEquality() && match(X, m_Shl(m_One(), m_Value(Y)))) { in foldICmpTruncConstant()
1432 auto NewPred = (Pred == Cmp.ICMP_EQ) ? Cmp.ICMP_UGE : Cmp.ICMP_ULT; in foldICmpTruncConstant()
1441 if (Cmp.isEquality() && Trunc->hasOneUse()) { in foldICmpTruncConstant()
1454 KnownBits Known = computeKnownBits(X, 0, &Cmp); in foldICmpTruncConstant()
1486 InstCombinerImpl::foldICmpTruncWithTruncOrExt(ICmpInst &Cmp, in foldICmpTruncWithTruncOrExt() argument
1488 if (Cmp.isSigned()) in foldICmpTruncWithTruncOrExt()
1495 if (match(&Cmp, m_ICmp(Pred, m_Trunc(m_Value(X)), m_Trunc(m_Value(Y))))) { in foldICmpTruncWithTruncOrExt()
1497 (!Cmp.getOperand(0)->hasOneUse() || !Cmp.getOperand(1)->hasOneUse())) in foldICmpTruncWithTruncOrExt()
1502 Pred = Cmp.getSwappedPredicate(Pred); in foldICmpTruncWithTruncOrExt()
1506 else if (match(&Cmp, m_c_ICmp(Pred, m_Trunc(m_Value(X)), in foldICmpTruncWithTruncOrExt()
1513 Type *TruncTy = Cmp.getOperand(0)->getType(); in foldICmpTruncWithTruncOrExt()
1539 Instruction *InstCombinerImpl::foldICmpXorConstant(ICmpInst &Cmp, in foldICmpXorConstant() argument
1542 if (Instruction *I = foldICmpXorShiftConst(Cmp, Xor, C)) in foldICmpXorConstant()
1553 ICmpInst::Predicate Pred = Cmp.getPredicate(); in foldICmpXorConstant()
1555 if (isSignBitCheck(Cmp.getPredicate(), C, TrueIfSigned)) { in foldICmpXorConstant()
1560 return replaceOperand(Cmp, 0, X); in foldICmpXorConstant()
1573 if (!Cmp.isEquality() && XorC->isSignMask()) { in foldICmpXorConstant()
1574 Pred = Cmp.getFlippedSignednessPredicate(); in foldICmpXorConstant()
1579 if (!Cmp.isEquality() && XorC->isMaxSignedValue()) { in foldICmpXorConstant()
1580 Pred = Cmp.getFlippedSignednessPredicate(); in foldICmpXorConstant()
1581 Pred = Cmp.getSwappedPredicate(Pred); in foldICmpXorConstant()
1611 Instruction *InstCombinerImpl::foldICmpXorShiftConst(ICmpInst &Cmp, in foldICmpXorShiftConst() argument
1614 CmpInst::Predicate Pred = Cmp.getPredicate(); in foldICmpXorShiftConst()
1640 Instruction *InstCombinerImpl::foldICmpAndShift(ICmpInst &Cmp, in foldICmpAndShift() argument
1664 if (Cmp.isSigned() && (C2.isNegative() || C1.isNegative())) in foldICmpAndShift()
1678 if (Cmp.isSigned() && (NewAndCst.isNegative() || NewCmpCst.isNegative())) in foldICmpAndShift()
1695 if (Cmp.getPredicate() == ICmpInst::ICMP_EQ) in foldICmpAndShift()
1696 return replaceInstUsesWith(Cmp, ConstantInt::getFalse(Cmp.getType())); in foldICmpAndShift()
1697 if (Cmp.getPredicate() == ICmpInst::ICMP_NE) in foldICmpAndShift()
1698 return replaceInstUsesWith(Cmp, ConstantInt::getTrue(Cmp.getType())); in foldICmpAndShift()
1702 return new ICmpInst(Cmp.getPredicate(), in foldICmpAndShift()
1710 if (Shift->hasOneUse() && C1.isZero() && Cmp.isEquality() && in foldICmpAndShift()
1719 return replaceOperand(Cmp, 0, NewAnd); in foldICmpAndShift()
1726 Instruction *InstCombinerImpl::foldICmpAndConstConst(ICmpInst &Cmp, in foldICmpAndConstConst() argument
1729 bool isICMP_NE = Cmp.getPredicate() == ICmpInst::ICMP_NE; in foldICmpAndConstConst()
1734 if (isICMP_NE && Cmp.getType()->isVectorTy() && C1.isZero() && in foldICmpAndConstConst()
1736 return new TruncInst(And->getOperand(0), Cmp.getType()); in foldICmpAndConstConst()
1747 if (Cmp.isEquality() && C1.isZero()) { in foldICmpAndConstConst()
1781 (Cmp.isEquality() || (!C1.isNegative() && !C2->isNegative()))) { in foldICmpAndConstConst()
1785 if (!Cmp.getType()->isVectorTy()) { in foldICmpAndConstConst()
1791 return new ICmpInst(Cmp.getPredicate(), NewAnd, ZextC1); in foldICmpAndConstConst()
1795 if (Instruction *I = foldICmpAndShift(Cmp, And, C1, *C2)) in foldICmpAndConstConst()
1802 if (!Cmp.isSigned() && C1.isZero() && And->getOperand(0)->hasOneUse() && in foldICmpAndConstConst()
1825 return replaceOperand(Cmp, 0, NewAnd); in foldICmpAndConstConst()
1834 Instruction *InstCombinerImpl::foldICmpAndConstant(ICmpInst &Cmp, in foldICmpAndConstant() argument
1837 if (Instruction *I = foldICmpAndConstConst(Cmp, And, C)) in foldICmpAndConstant()
1840 const ICmpInst::Predicate Pred = Cmp.getPredicate(); in foldICmpAndConstant()
1872 foldCmpLoadFromIndexedGlobal(LI, GEP, GV, Cmp, C2)) in foldICmpAndConstant()
1875 if (!Cmp.isEquality()) in foldICmpAndConstant()
1881 if (Cmp.getOperand(1) == Y && C.isNegatedPowerOf2()) { in foldICmpAndConstant()
1884 return new ICmpInst(NewPred, X, SubOne(cast<Constant>(Cmp.getOperand(1)))); in foldICmpAndConstant()
1897 assert(Cmp.isEquality() && "Not expecting non-equality predicates"); in foldICmpAndConstant()
1907 return replaceInstUsesWith(Cmp, R); in foldICmpAndConstant()
1929 static Value *foldICmpOrXorSubChain(ICmpInst &Cmp, BinaryOperator *Or, in foldICmpOrXorSubChain() argument
1974 ICmpInst::Predicate Pred = Cmp.getPredicate(); in foldICmpOrXorSubChain()
1988 Instruction *InstCombinerImpl::foldICmpOrConstant(ICmpInst &Cmp, in foldICmpOrConstant() argument
1991 ICmpInst::Predicate Pred = Cmp.getPredicate(); in foldICmpOrConstant()
2002 if (match(OrOp1, m_APInt(MaskC)) && Cmp.isEquality()) { in foldICmpOrConstant()
2057 if (!Cmp.isEquality() || !C.isZero() || !Or->hasOneUse()) in foldICmpOrConstant()
2072 if (Value *V = foldICmpOrXorSubChain(Cmp, Or, Builder)) in foldICmpOrConstant()
2073 return replaceInstUsesWith(Cmp, V); in foldICmpOrConstant()
2079 Instruction *InstCombinerImpl::foldICmpMulConstant(ICmpInst &Cmp, in foldICmpMulConstant() argument
2082 ICmpInst::Predicate Pred = Cmp.getPredicate(); in foldICmpMulConstant()
2089 if (Cmp.isEquality() && C.isZero() && X == Mul->getOperand(1) && in foldICmpMulConstant()
2112 if (Cmp.isEquality()) { in foldICmpMulConstant()
2170 static Instruction *foldICmpShlOne(ICmpInst &Cmp, Instruction *Shl, in foldICmpShlOne() argument
2179 ICmpInst::Predicate Pred = Cmp.getPredicate(); in foldICmpShlOne()
2180 if (Cmp.isUnsigned()) { in foldICmpShlOne()
2195 } else if (Cmp.isSigned()) { in foldICmpShlOne()
2214 Instruction *InstCombinerImpl::foldICmpShlConstant(ICmpInst &Cmp, in foldICmpShlConstant() argument
2218 if (Cmp.isEquality() && match(Shl->getOperand(0), m_APInt(ShiftVal))) in foldICmpShlConstant()
2219 return foldICmpShlConstConst(Cmp, Shl->getOperand(1), C, *ShiftVal); in foldICmpShlConstant()
2221 ICmpInst::Predicate Pred = Cmp.getPredicate(); in foldICmpShlConstant()
2228 return new ICmpInst(Pred, Shl->getOperand(0), Cmp.getOperand(1)); in foldICmpShlConstant()
2234 return new ICmpInst(Pred, Shl->getOperand(0), Cmp.getOperand(1)); in foldICmpShlConstant()
2245 return new ICmpInst(Pred, Shl->getOperand(0), Cmp.getOperand(1)); in foldICmpShlConstant()
2249 return foldICmpShlOne(Cmp, Shl, C); in foldICmpShlConstant()
2310 if (Cmp.isEquality() && Shl->hasOneUse()) { in foldICmpShlConstant()
2333 if (Cmp.isUnsigned() && Shl->hasOneUse()) { in foldICmpShlConstant()
2362 Type *TruncTy = IntegerType::get(Cmp.getContext(), TypeBits - Amt); in foldICmpShlConstant()
2374 Instruction *InstCombinerImpl::foldICmpShrConstant(ICmpInst &Cmp, in foldICmpShrConstant() argument
2380 CmpInst::Predicate Pred = Cmp.getPredicate(); in foldICmpShrConstant()
2381 if (Cmp.isEquality() && Shr->isExact() && C.isZero()) in foldICmpShrConstant()
2382 return new ICmpInst(Pred, X, Cmp.getOperand(1)); in foldICmpShrConstant()
2387 if (Cmp.isEquality()) in foldICmpShrConstant()
2388 return foldICmpShrConstConst(Cmp, Shr->getOperand(1), C, *ShiftValC); in foldICmpShrConstant()
2489 if (!Cmp.isEquality()) in foldICmpShrConstant()
2528 Instruction *InstCombinerImpl::foldICmpSRemConstant(ICmpInst &Cmp, in foldICmpSRemConstant() argument
2534 const ICmpInst::Predicate Pred = Cmp.getPredicate(); in foldICmpSRemConstant()
2579 Instruction *InstCombinerImpl::foldICmpUDivConstant(ICmpInst &Cmp, in foldICmpUDivConstant() argument
2582 ICmpInst::Predicate Pred = Cmp.getPredicate(); in foldICmpUDivConstant()
2612 Instruction *InstCombinerImpl::foldICmpDivConstant(ICmpInst &Cmp, in foldICmpDivConstant() argument
2615 ICmpInst::Predicate Pred = Cmp.getPredicate(); in foldICmpDivConstant()
2629 if (Cmp.isEquality() && Div->hasOneUse() && C.isSignBitSet() && in foldICmpDivConstant()
2655 if (!Cmp.isEquality() && DivIsSigned != Cmp.isSigned()) in foldICmpDivConstant()
2752 return replaceInstUsesWith(Cmp, Builder.getFalse()); in foldICmpDivConstant()
2760 Cmp, insertRangeTest(X, LoBound, HiBound, DivIsSigned, true)); in foldICmpDivConstant()
2763 return replaceInstUsesWith(Cmp, Builder.getTrue()); in foldICmpDivConstant()
2771 Cmp, insertRangeTest(X, LoBound, HiBound, DivIsSigned, false)); in foldICmpDivConstant()
2775 return replaceInstUsesWith(Cmp, Builder.getTrue()); in foldICmpDivConstant()
2777 return replaceInstUsesWith(Cmp, Builder.getFalse()); in foldICmpDivConstant()
2782 return replaceInstUsesWith(Cmp, Builder.getFalse()); in foldICmpDivConstant()
2784 return replaceInstUsesWith(Cmp, Builder.getTrue()); in foldICmpDivConstant()
2794 Instruction *InstCombinerImpl::foldICmpSubConstant(ICmpInst &Cmp, in foldICmpSubConstant() argument
2798 ICmpInst::Predicate Pred = Cmp.getPredicate(); in foldICmpSubConstant()
2804 if (Cmp.isEquality() && match(X, m_ImmConstant(SubC))) { in foldICmpSubConstant()
2812 ICmpInst::Predicate SwappedPred = Cmp.getSwappedPredicate(); in foldICmpSubConstant()
2816 ((Cmp.isUnsigned() && HasNUW) || (Cmp.isSigned() && HasNSW)) && in foldICmpSubConstant()
2817 !subWithOverflow(SubResult, *C2, C, Cmp.isSigned())) in foldICmpSubConstant()
2826 if (Cmp.isEquality() && C.isZero() && in foldICmpSubConstant()
2929 Instruction *InstCombinerImpl::foldICmpAddConstant(ICmpInst &Cmp, in foldICmpAddConstant() argument
2937 const CmpInst::Predicate Pred = Cmp.getPredicate(); in foldICmpAddConstant()
2961 return replaceInstUsesWith(Cmp, Cond); in foldICmpAddConstant()
2964 if (Cmp.isEquality() || !match(Y, m_APInt(C2))) in foldICmpAddConstant()
2979 Cmp.isSigned() ? C.ssub_ov(*C2, Overflow) : C.usub_ov(*C2, Overflow); in foldICmpAddConstant()
2991 if (Cmp.isSigned()) { in foldICmpAddConstant()
3027 const SimplifyQuery Q = SQ.getWithInstruction(&Cmp); in foldICmpAddConstant()
3114 Instruction *InstCombinerImpl::foldICmpSelectConstant(ICmpInst &Cmp, in foldICmpSelectConstant() argument
3126 if (Cmp.hasOneUse() && in foldICmpSelectConstant()
3132 ConstantExpr::getCompare(Cmp.getPredicate(), C1LessThan, C) in foldICmpSelectConstant()
3135 ConstantExpr::getCompare(Cmp.getPredicate(), C2Equal, C) in foldICmpSelectConstant()
3138 ConstantExpr::getCompare(Cmp.getPredicate(), C3GreaterThan, C) in foldICmpSelectConstant()
3160 return replaceInstUsesWith(Cmp, Cond); in foldICmpSelectConstant()
3165 Instruction *InstCombinerImpl::foldICmpBitCast(ICmpInst &Cmp) { in foldICmpBitCast() argument
3166 auto *Bitcast = dyn_cast<BitCastInst>(Cmp.getOperand(0)); in foldICmpBitCast()
3170 ICmpInst::Predicate Pred = Cmp.getPredicate(); in foldICmpBitCast()
3171 Value *Op1 = Cmp.getOperand(1); in foldICmpBitCast()
3206 if (Cmp.isEquality() && match(Op1, m_Zero())) in foldICmpBitCast()
3241 if (!match(Cmp.getOperand(1), m_APInt(C)) || !DstType->isIntegerTy() || in foldICmpBitCast()
3252 if (Cmp.isEquality() && C->isAllOnes() && Bitcast->hasOneUse()) { in foldICmpBitCast()
3264 if (Cmp.isEquality() && C->isZero() && Bitcast->hasOneUse() && in foldICmpBitCast()
3305 Instruction *InstCombinerImpl::foldICmpInstWithConstant(ICmpInst &Cmp) { in foldICmpInstWithConstant() argument
3308 if (match(Cmp.getOperand(1), m_APInt(C))) { in foldICmpInstWithConstant()
3309 if (auto *BO = dyn_cast<BinaryOperator>(Cmp.getOperand(0))) in foldICmpInstWithConstant()
3310 if (Instruction *I = foldICmpBinOpWithConstant(Cmp, BO, *C)) in foldICmpInstWithConstant()
3313 if (auto *SI = dyn_cast<SelectInst>(Cmp.getOperand(0))) in foldICmpInstWithConstant()
3317 if (auto *ConstRHS = dyn_cast<ConstantInt>(Cmp.getOperand(1))) in foldICmpInstWithConstant()
3318 if (Instruction *I = foldICmpSelectConstant(Cmp, SI, ConstRHS)) in foldICmpInstWithConstant()
3321 if (auto *TI = dyn_cast<TruncInst>(Cmp.getOperand(0))) in foldICmpInstWithConstant()
3322 if (Instruction *I = foldICmpTruncConstant(Cmp, TI, *C)) in foldICmpInstWithConstant()
3325 if (auto *II = dyn_cast<IntrinsicInst>(Cmp.getOperand(0))) in foldICmpInstWithConstant()
3326 if (Instruction *I = foldICmpIntrinsicWithConstant(Cmp, II, *C)) in foldICmpInstWithConstant()
3332 Value *Cmp0 = Cmp.getOperand(0); in foldICmpInstWithConstant()
3334 if (C->isZero() && Cmp.isEquality() && Cmp0->hasOneUse() && in foldICmpInstWithConstant()
3341 return new ICmpInst(Cmp.getPredicate(), X, Y); in foldICmpInstWithConstant()
3344 if (match(Cmp.getOperand(1), m_APIntAllowUndef(C))) in foldICmpInstWithConstant()
3345 return foldICmpInstWithConstantAllowUndef(Cmp, *C); in foldICmpInstWithConstant()
3353 ICmpInst &Cmp, BinaryOperator *BO, const APInt &C) { in foldICmpBinOpEqualityWithConstant() argument
3356 if (!Cmp.isEquality()) in foldICmpBinOpEqualityWithConstant()
3359 ICmpInst::Predicate Pred = Cmp.getPredicate(); in foldICmpBinOpEqualityWithConstant()
3361 Constant *RHS = cast<Constant>(Cmp.getOperand(1)); in foldICmpBinOpEqualityWithConstant()
3437 Cmp.getOperand(1), BO); in foldICmpBinOpEqualityWithConstant()
3497 ICmpInst &Cmp, IntrinsicInst *II, const APInt &C) { in foldICmpEqIntrinsicWithConstant() argument
3500 const ICmpInst::Predicate Pred = Cmp.getPredicate(); in foldICmpEqIntrinsicWithConstant()
3604 foldICmpIntrinsicWithIntrinsic(ICmpInst &Cmp, in foldICmpIntrinsicWithIntrinsic() argument
3606 assert(Cmp.isEquality()); in foldICmpIntrinsicWithIntrinsic()
3608 ICmpInst::Predicate Pred = Cmp.getPredicate(); in foldICmpIntrinsicWithIntrinsic()
3609 Value *Op0 = Cmp.getOperand(0); in foldICmpIntrinsicWithIntrinsic()
3610 Value *Op1 = Cmp.getOperand(1); in foldICmpIntrinsicWithIntrinsic()
3660 InstCombinerImpl::foldICmpInstWithConstantAllowUndef(ICmpInst &Cmp, in foldICmpInstWithConstantAllowUndef() argument
3662 const ICmpInst::Predicate Pred = Cmp.getPredicate(); in foldICmpInstWithConstantAllowUndef()
3663 if (auto *II = dyn_cast<IntrinsicInst>(Cmp.getOperand(0))) { in foldICmpInstWithConstantAllowUndef()
3669 if (Cmp.isEquality() && II->getArgOperand(0) == II->getArgOperand(1)) { in foldICmpInstWithConstantAllowUndef()
3672 return new ICmpInst(Pred, II->getArgOperand(0), Cmp.getOperand(1)); in foldICmpInstWithConstantAllowUndef()
3682 Instruction *InstCombinerImpl::foldICmpBinOpWithConstant(ICmpInst &Cmp, in foldICmpBinOpWithConstant() argument
3687 if (Instruction *I = foldICmpXorConstant(Cmp, BO, C)) in foldICmpBinOpWithConstant()
3691 if (Instruction *I = foldICmpAndConstant(Cmp, BO, C)) in foldICmpBinOpWithConstant()
3695 if (Instruction *I = foldICmpOrConstant(Cmp, BO, C)) in foldICmpBinOpWithConstant()
3699 if (Instruction *I = foldICmpMulConstant(Cmp, BO, C)) in foldICmpBinOpWithConstant()
3703 if (Instruction *I = foldICmpShlConstant(Cmp, BO, C)) in foldICmpBinOpWithConstant()
3708 if (Instruction *I = foldICmpShrConstant(Cmp, BO, C)) in foldICmpBinOpWithConstant()
3712 if (Instruction *I = foldICmpSRemConstant(Cmp, BO, C)) in foldICmpBinOpWithConstant()
3716 if (Instruction *I = foldICmpUDivConstant(Cmp, BO, C)) in foldICmpBinOpWithConstant()
3720 if (Instruction *I = foldICmpDivConstant(Cmp, BO, C)) in foldICmpBinOpWithConstant()
3724 if (Instruction *I = foldICmpSubConstant(Cmp, BO, C)) in foldICmpBinOpWithConstant()
3728 if (Instruction *I = foldICmpAddConstant(Cmp, BO, C)) in foldICmpBinOpWithConstant()
3736 return foldICmpBinOpEqualityWithConstant(Cmp, BO, C); in foldICmpBinOpWithConstant()
3825 Instruction *InstCombinerImpl::foldICmpIntrinsicWithConstant(ICmpInst &Cmp, in foldICmpIntrinsicWithConstant() argument
3828 ICmpInst::Predicate Pred = Cmp.getPredicate(); in foldICmpIntrinsicWithConstant()
3841 const SimplifyQuery Q = SQ.getWithInstruction(&Cmp); in foldICmpIntrinsicWithConstant()
3842 if (Instruction *R = foldCtpopPow2Test(Cmp, II, C, Builder, Q)) in foldICmpIntrinsicWithConstant()
3847 if (Cmp.isEquality()) in foldICmpIntrinsicWithConstant()
3848 return foldICmpEqIntrinsicWithConstant(Cmp, II, C); in foldICmpIntrinsicWithConstant()
6164 auto isMinMaxCmp = [&](Instruction &Cmp) { in foldICmpUsingKnownBits() argument
6165 if (!Cmp.hasOneUse()) in foldICmpUsingKnownBits()
6168 SelectPatternFlavor SPF = matchSelectPattern(Cmp.user_back(), A, B).Flavor; in foldICmpUsingKnownBits()
6650 static Instruction *foldICmpWithHighBitMask(ICmpInst &Cmp, in foldICmpWithHighBitMask() argument
6654 if (match(&Cmp, in foldICmpWithHighBitMask()
6666 } else if (match(&Cmp, m_c_ICmp(Pred, in foldICmpWithHighBitMask()
6693 static Instruction *foldVectorCmp(CmpInst &Cmp, in foldVectorCmp() argument
6695 const CmpInst::Predicate Pred = Cmp.getPredicate(); in foldVectorCmp()
6696 Value *LHS = Cmp.getOperand(0), *RHS = Cmp.getOperand(1); in foldVectorCmp()
6700 Value *V = Builder.CreateCmp(Pred, X, Y, Cmp.getName()); in foldVectorCmp()
6702 I->copyIRFlags(&Cmp); in foldVectorCmp()
6703 Module *M = Cmp.getModule(); in foldVectorCmp()
7183 Value *Cmp = Builder.CreateICmp(Pred, SLTZero, Y, I.getName()); in visitICmpInst() local
7184 return replaceInstUsesWith(I, Cmp); in visitICmpInst()