Lines Matching refs:ICmpInst
120 static bool isSignBitCheck(ICmpInst::Predicate pred, ConstantInt *RHS, in isSignBitCheck()
123 case ICmpInst::ICMP_SLT: // True if LHS s< 0 in isSignBitCheck()
126 case ICmpInst::ICMP_SLE: // True if LHS s<= RHS and RHS == -1 in isSignBitCheck()
129 case ICmpInst::ICMP_SGT: // True if LHS s> -1 in isSignBitCheck()
132 case ICmpInst::ICMP_UGT: in isSignBitCheck()
136 case ICmpInst::ICMP_UGE: in isSignBitCheck()
148 static bool isSignTest(ICmpInst::Predicate &pred, const ConstantInt *RHS) { in isSignTest()
149 if (!ICmpInst::isSigned(pred)) in isSignTest()
153 return ICmpInst::isRelational(pred); in isSignTest()
156 if (pred == ICmpInst::ICMP_SLT) { in isSignTest()
157 pred = ICmpInst::ICMP_SLE; in isSignTest()
161 if (pred == ICmpInst::ICMP_SGT) { in isSignTest()
162 pred = ICmpInst::ICMP_SGE; in isSignTest()
413 return new ICmpInst(ICmpInst::ICMP_EQ, Idx, FirstTrueIdx); in FoldCmpLoadFromIndexedGlobal()
433 return new ICmpInst(ICmpInst::ICMP_NE, Idx, FirstFalseIdx); in FoldCmpLoadFromIndexedGlobal()
455 return new ICmpInst(ICmpInst::ICMP_ULT, Idx, End); in FoldCmpLoadFromIndexedGlobal()
469 return new ICmpInst(ICmpInst::ICMP_UGT, Idx, End); in FoldCmpLoadFromIndexedGlobal()
492 return new ICmpInst(ICmpInst::ICMP_NE, V, ConstantInt::get(Ty, 0)); in FoldCmpLoadFromIndexedGlobal()
608 ICmpInst::Predicate Cond, in FoldGEPICmp()
615 if (ICmpInst::isSigned(Cond)) in FoldGEPICmp()
634 return new ICmpInst(ICmpInst::getSignedPredicate(Cond), Offset, in FoldGEPICmp()
652 return new ICmpInst(Cond, GEPLHS->getOperand(0), GEPRHS->getOperand(0)); in FoldGEPICmp()
678 Value *Cmp = Builder->CreateICmp(ICmpInst::getSignedPredicate(Cond), in FoldGEPICmp()
691 ICmpInst::getSwappedPredicate(Cond), I); in FoldGEPICmp()
717 Builder->getInt1(ICmpInst::isTrueWhenEqual(Cond))); in FoldGEPICmp()
723 return new ICmpInst(ICmpInst::getSignedPredicate(Cond), LHSV, RHSV); in FoldGEPICmp()
734 return new ICmpInst(ICmpInst::getSignedPredicate(Cond), L, R); in FoldGEPICmp()
743 ICmpInst::Predicate Pred) { in FoldICmpAddOpCst()
751 if (Pred == ICmpInst::ICMP_ULT || Pred == ICmpInst::ICMP_ULE) { in FoldICmpAddOpCst()
754 return new ICmpInst(ICmpInst::ICMP_UGT, X, R); in FoldICmpAddOpCst()
760 if (Pred == ICmpInst::ICMP_UGT || Pred == ICmpInst::ICMP_UGE) in FoldICmpAddOpCst()
761 return new ICmpInst(ICmpInst::ICMP_ULT, X, ConstantExpr::getNeg(CI)); in FoldICmpAddOpCst()
773 if (Pred == ICmpInst::ICMP_SLT || Pred == ICmpInst::ICMP_SLE) in FoldICmpAddOpCst()
774 return new ICmpInst(ICmpInst::ICMP_SGT, X, ConstantExpr::getSub(SMax, CI)); in FoldICmpAddOpCst()
783 assert(Pred == ICmpInst::ICMP_SGT || Pred == ICmpInst::ICMP_SGE); in FoldICmpAddOpCst()
785 return new ICmpInst(ICmpInst::ICMP_SLT, X, ConstantExpr::getSub(SMax, C)); in FoldICmpAddOpCst()
790 Instruction *InstCombiner::FoldICmpDivCst(ICmpInst &ICI, BinaryOperator *DivI, in FoldICmpDivCst()
829 ICmpInst::Predicate Pred = ICI.getPredicate(); in FoldICmpDivCst()
899 Pred = ICmpInst::getSwappedPredicate(Pred); in FoldICmpDivCst()
905 case ICmpInst::ICMP_EQ: in FoldICmpDivCst()
909 return new ICmpInst(DivIsSigned ? ICmpInst::ICMP_SGE : in FoldICmpDivCst()
910 ICmpInst::ICMP_UGE, X, LoBound); in FoldICmpDivCst()
912 return new ICmpInst(DivIsSigned ? ICmpInst::ICMP_SLT : in FoldICmpDivCst()
913 ICmpInst::ICMP_ULT, X, HiBound); in FoldICmpDivCst()
916 case ICmpInst::ICMP_NE: in FoldICmpDivCst()
920 return new ICmpInst(DivIsSigned ? ICmpInst::ICMP_SLT : in FoldICmpDivCst()
921 ICmpInst::ICMP_ULT, X, LoBound); in FoldICmpDivCst()
923 return new ICmpInst(DivIsSigned ? ICmpInst::ICMP_SGE : in FoldICmpDivCst()
924 ICmpInst::ICMP_UGE, X, HiBound); in FoldICmpDivCst()
927 case ICmpInst::ICMP_ULT: in FoldICmpDivCst()
928 case ICmpInst::ICMP_SLT: in FoldICmpDivCst()
933 return new ICmpInst(Pred, X, LoBound); in FoldICmpDivCst()
934 case ICmpInst::ICMP_UGT: in FoldICmpDivCst()
935 case ICmpInst::ICMP_SGT: in FoldICmpDivCst()
940 if (Pred == ICmpInst::ICMP_UGT) in FoldICmpDivCst()
941 return new ICmpInst(ICmpInst::ICMP_UGE, X, HiBound); in FoldICmpDivCst()
942 return new ICmpInst(ICmpInst::ICMP_SGE, X, HiBound); in FoldICmpDivCst()
947 Instruction *InstCombiner::FoldICmpShrCst(ICmpInst &ICI, BinaryOperator *Shr, in FoldICmpShrCst()
1010 bool IsICMP_NE = ICI.getPredicate() == ICmpInst::ICMP_NE; in FoldICmpShrCst()
1019 return new ICmpInst(ICI.getPredicate(), Shr->getOperand(0), ShiftedCmpRHS); in FoldICmpShrCst()
1028 return new ICmpInst(ICI.getPredicate(), And, ShiftedCmpRHS); in FoldICmpShrCst()
1036 Instruction *InstCombiner::FoldICmpCstShrCst(ICmpInst &I, Value *Op, Value *A, in FoldICmpCstShrCst()
1050 return new ICmpInst(Pred, LHS, RHS); in FoldICmpCstShrCst()
1096 Instruction *InstCombiner::FoldICmpCstShlCst(ICmpInst &I, Value *Op, Value *A, in FoldICmpCstShlCst()
1110 return new ICmpInst(Pred, LHS, RHS); in FoldICmpCstShlCst()
1141 Instruction *InstCombiner::visitICmpInstWithInstAndIntCst(ICmpInst &ICI, in visitICmpInstWithInstAndIntCst()
1161 return new ICmpInst(ICI.getPredicate(), LHSI->getOperand(0), in visitICmpInstWithInstAndIntCst()
1171 if ((ICI.getPredicate() == ICmpInst::ICMP_SLT && RHSV == 0) || in visitICmpInstWithInstAndIntCst()
1172 (ICI.getPredicate() == ICmpInst::ICMP_SGT && RHSV.isAllOnesValue())) { in visitICmpInstWithInstAndIntCst()
1184 bool isTrueIfPositive = ICI.getPredicate() == ICmpInst::ICMP_SGT; in visitICmpInstWithInstAndIntCst()
1190 return new ICmpInst(ICmpInst::ICMP_SGT, CompareVal, in visitICmpInstWithInstAndIntCst()
1193 return new ICmpInst(ICmpInst::ICMP_SLT, CompareVal, in visitICmpInstWithInstAndIntCst()
1201 ICmpInst::Predicate Pred = ICI.isSigned() in visitICmpInstWithInstAndIntCst()
1204 return new ICmpInst(Pred, LHSI->getOperand(0), in visitICmpInstWithInstAndIntCst()
1211 ICmpInst::Predicate Pred = ICI.isSigned() in visitICmpInstWithInstAndIntCst()
1215 return new ICmpInst(Pred, LHSI->getOperand(0), in visitICmpInstWithInstAndIntCst()
1222 if (ICI.getPredicate() == ICmpInst::ICMP_UGT && in visitICmpInstWithInstAndIntCst()
1224 return new ICmpInst(ICmpInst::ICMP_ULT, LHSI->getOperand(0), XorCst); in visitICmpInstWithInstAndIntCst()
1228 if (ICI.getPredicate() == ICmpInst::ICMP_ULT && in visitICmpInstWithInstAndIntCst()
1230 return new ICmpInst(ICmpInst::ICMP_UGE, LHSI->getOperand(0), XorCst); in visitICmpInstWithInstAndIntCst()
1252 return new ICmpInst(ICI.getPredicate(), NewAnd, in visitICmpInstWithInstAndIntCst()
1268 return new ICmpInst(ICI.getPredicate(), NewAnd, in visitICmpInstWithInstAndIntCst()
1334 if (ICI.getPredicate() == ICmpInst::ICMP_EQ) in visitICmpInstWithInstAndIntCst()
1336 if (ICI.getPredicate() == ICmpInst::ICMP_NE) in visitICmpInstWithInstAndIntCst()
1420 if (ICI.getPredicate() == ICmpInst::ICMP_UGT) { in visitICmpInstWithInstAndIntCst()
1424 return new ICmpInst(ICmpInst::ICMP_NE, LHSI, in visitICmpInstWithInstAndIntCst()
1446 return new ICmpInst( in visitICmpInstWithInstAndIntCst()
1447 ICI.getPredicate() == ICmpInst::ICMP_EQ ? ICmpInst::ICMP_UGT in visitICmpInstWithInstAndIntCst()
1448 : ICmpInst::ICMP_ULE, in visitICmpInstWithInstAndIntCst()
1464 if (ICI.getPredicate() == ICmpInst::ICMP_EQ) in visitICmpInstWithInstAndIntCst()
1479 ICmpInst::Predicate pred = ICI.getPredicate(); in visitICmpInstWithInstAndIntCst()
1482 return new ICmpInst(Val->isNegative() ? in visitICmpInstWithInstAndIntCst()
1483 ICmpInst::getSwappedPredicate(pred) : pred, in visitICmpInstWithInstAndIntCst()
1498 ICmpInst::Predicate Pred = ICI.getPredicate(); in visitICmpInstWithInstAndIntCst()
1505 if (Pred == ICmpInst::ICMP_ULT) in visitICmpInstWithInstAndIntCst()
1506 Pred = ICmpInst::ICMP_ULE; in visitICmpInstWithInstAndIntCst()
1507 else if (Pred == ICmpInst::ICMP_UGE) in visitICmpInstWithInstAndIntCst()
1508 Pred = ICmpInst::ICMP_UGT; in visitICmpInstWithInstAndIntCst()
1515 if (Pred == ICmpInst::ICMP_UGE) in visitICmpInstWithInstAndIntCst()
1516 Pred = ICmpInst::ICMP_EQ; in visitICmpInstWithInstAndIntCst()
1517 else if (Pred == ICmpInst::ICMP_ULT) in visitICmpInstWithInstAndIntCst()
1518 Pred = ICmpInst::ICMP_NE; in visitICmpInstWithInstAndIntCst()
1521 return new ICmpInst(Pred, X, in visitICmpInstWithInstAndIntCst()
1526 if (Pred == ICmpInst::ICMP_SLE) in visitICmpInstWithInstAndIntCst()
1527 return new ICmpInst(ICmpInst::ICMP_EQ, X, in visitICmpInstWithInstAndIntCst()
1531 if (Pred == ICmpInst::ICMP_SGT) in visitICmpInstWithInstAndIntCst()
1532 return new ICmpInst(ICmpInst::ICMP_NE, X, in visitICmpInstWithInstAndIntCst()
1537 if (Pred == ICmpInst::ICMP_SLT || Pred == ICmpInst::ICMP_SLE) in visitICmpInstWithInstAndIntCst()
1538 return new ICmpInst(ICmpInst::ICMP_EQ, X, in visitICmpInstWithInstAndIntCst()
1543 if (Pred == ICmpInst::ICMP_SGT || Pred == ICmpInst::ICMP_SGE) in visitICmpInstWithInstAndIntCst()
1544 return new ICmpInst(ICmpInst::ICMP_NE, X, in visitICmpInstWithInstAndIntCst()
1549 return new ICmpInst( in visitICmpInstWithInstAndIntCst()
1569 bool IsICMP_NE = ICI.getPredicate() == ICmpInst::ICMP_NE; in visitICmpInstWithInstAndIntCst()
1577 return new ICmpInst(ICI.getPredicate(), LHSI->getOperand(0), in visitICmpInstWithInstAndIntCst()
1583 return new ICmpInst(ICI.getPredicate(), LHSI->getOperand(0), in visitICmpInstWithInstAndIntCst()
1594 return new ICmpInst(ICI.getPredicate(), And, in visitICmpInstWithInstAndIntCst()
1601 ICmpInst::Predicate pred = ICI.getPredicate(); in visitICmpInstWithInstAndIntCst()
1604 return new ICmpInst(pred, in visitICmpInstWithInstAndIntCst()
1618 return new ICmpInst(TrueIfSigned ? ICmpInst::ICMP_NE : ICmpInst::ICMP_EQ, in visitICmpInstWithInstAndIntCst()
1636 return new ICmpInst(ICI.getPredicate(), in visitICmpInstWithInstAndIntCst()
1656 return new ICmpInst(ICI.getPredicate(), BO->getOperand(0), RHS); in visitICmpInstWithInstAndIntCst()
1683 if (ICI.getPredicate() == ICmpInst::ICMP_ULT && LHSI->hasOneUse() && in visitICmpInstWithInstAndIntCst()
1685 return new ICmpInst(ICmpInst::ICMP_EQ, in visitICmpInstWithInstAndIntCst()
1692 if (ICI.getPredicate() == ICmpInst::ICMP_UGT && LHSI->hasOneUse() && in visitICmpInstWithInstAndIntCst()
1694 return new ICmpInst(ICmpInst::ICMP_NE, in visitICmpInstWithInstAndIntCst()
1711 return new ICmpInst(ICmpInst::ICMP_SLT, LHSI->getOperand(0), in visitICmpInstWithInstAndIntCst()
1714 return new ICmpInst(ICmpInst::ICMP_SGE, LHSI->getOperand(0), in visitICmpInstWithInstAndIntCst()
1719 return new ICmpInst(ICmpInst::ICMP_ULT, LHSI->getOperand(0), in visitICmpInstWithInstAndIntCst()
1722 return new ICmpInst(ICmpInst::ICMP_UGE, LHSI->getOperand(0), in visitICmpInstWithInstAndIntCst()
1730 if (ICI.getPredicate() == ICmpInst::ICMP_ULT && LHSI->hasOneUse() && in visitICmpInstWithInstAndIntCst()
1732 return new ICmpInst(ICmpInst::ICMP_EQ, in visitICmpInstWithInstAndIntCst()
1739 if (ICI.getPredicate() == ICmpInst::ICMP_UGT && LHSI->hasOneUse() && in visitICmpInstWithInstAndIntCst()
1741 return new ICmpInst(ICmpInst::ICMP_NE, in visitICmpInstWithInstAndIntCst()
1750 bool isICMP_NE = ICI.getPredicate() == ICmpInst::ICMP_NE; in visitICmpInstWithInstAndIntCst()
1764 return new ICmpInst(ICI.getPredicate(), NewRem, in visitICmpInstWithInstAndIntCst()
1773 return new ICmpInst(ICI.getPredicate(), BO->getOperand(0), in visitICmpInstWithInstAndIntCst()
1781 return new ICmpInst(ICI.getPredicate(), BOp0, NegVal); in visitICmpInstWithInstAndIntCst()
1783 return new ICmpInst(ICI.getPredicate(), NegVal, BOp1); in visitICmpInstWithInstAndIntCst()
1787 return new ICmpInst(ICI.getPredicate(), BOp0, Neg); in visitICmpInstWithInstAndIntCst()
1795 return new ICmpInst(ICI.getPredicate(), BO->getOperand(0), in visitICmpInstWithInstAndIntCst()
1799 return new ICmpInst(ICI.getPredicate(), BO->getOperand(0), in visitICmpInstWithInstAndIntCst()
1807 return new ICmpInst(ICI.getPredicate(), BO->getOperand(1), in visitICmpInstWithInstAndIntCst()
1811 return new ICmpInst(ICI.getPredicate(), BO->getOperand(0), in visitICmpInstWithInstAndIntCst()
1834 return new ICmpInst(isICMP_NE ? ICmpInst::ICMP_EQ : in visitICmpInstWithInstAndIntCst()
1835 ICmpInst::ICMP_NE, LHSI, in visitICmpInstWithInstAndIntCst()
1846 ICmpInst::Predicate pred = isICMP_NE ? in visitICmpInstWithInstAndIntCst()
1847 ICmpInst::ICMP_SLT : ICmpInst::ICMP_SGE; in visitICmpInstWithInstAndIntCst()
1848 return new ICmpInst(pred, X, Zero); in visitICmpInstWithInstAndIntCst()
1855 ICmpInst::Predicate pred = isICMP_NE ? in visitICmpInstWithInstAndIntCst()
1856 ICmpInst::ICMP_UGE : ICmpInst::ICMP_ULT; in visitICmpInstWithInstAndIntCst()
1857 return new ICmpInst(pred, X, NegX); in visitICmpInstWithInstAndIntCst()
1868 return new ICmpInst(ICI.getPredicate(), BO->getOperand(0), in visitICmpInstWithInstAndIntCst()
1913 Instruction *InstCombiner::visitICmpInstWithCastAndCast(ICmpInst &ICI) { in visitICmpInstWithCastAndCast()
1938 return new ICmpInst(ICI.getPredicate(), LHSCIOp, RHSOp); in visitICmpInstWithCastAndCast()
1963 return new ICmpInst(ICI.getPredicate(), LHSCIOp, RHSCIOp); in visitICmpInstWithCastAndCast()
1968 return new ICmpInst(ICI.getPredicate(), LHSCIOp, RHSCIOp); in visitICmpInstWithCastAndCast()
1971 return new ICmpInst(ICI.getUnsignedPredicate(), LHSCIOp, RHSCIOp); in visitICmpInstWithCastAndCast()
1989 return new ICmpInst(ICI.getPredicate(), LHSCIOp, Res1); in visitICmpInstWithCastAndCast()
1994 return new ICmpInst(ICI.getPredicate(), LHSCIOp, Res1); in visitICmpInstWithCastAndCast()
1997 return new ICmpInst(ICI.getUnsignedPredicate(), LHSCIOp, Res1); in visitICmpInstWithCastAndCast()
2017 if (ICI.getPredicate() == ICmpInst::ICMP_ULT) in visitICmpInstWithCastAndCast()
2020 assert(ICI.getPredicate() == ICmpInst::ICMP_UGT && "ICmp should be folded!"); in visitICmpInstWithCastAndCast()
2031 static Instruction *ProcessUGT_ADDCST_ADD(ICmpInst &I, Value *A, Value *B, in ProcessUGT_ADDCST_ADD()
2234 static Instruction *ProcessUMulZExtIdiom(ICmpInst &I, Value *MulVal, in ProcessUMulZExtIdiom()
2295 case ICmpInst::ICMP_EQ: in ProcessUMulZExtIdiom()
2296 case ICmpInst::ICMP_NE: in ProcessUMulZExtIdiom()
2325 case ICmpInst::ICMP_UGT: in ProcessUMulZExtIdiom()
2337 case ICmpInst::ICMP_UGE: in ProcessUMulZExtIdiom()
2348 case ICmpInst::ICMP_ULE: in ProcessUMulZExtIdiom()
2360 case ICmpInst::ICMP_ULT: in ProcessUMulZExtIdiom()
2426 case ICmpInst::ICMP_NE: in ProcessUMulZExtIdiom()
2428 case ICmpInst::ICMP_EQ: in ProcessUMulZExtIdiom()
2431 case ICmpInst::ICMP_UGT: in ProcessUMulZExtIdiom()
2432 case ICmpInst::ICMP_UGE: in ProcessUMulZExtIdiom()
2437 case ICmpInst::ICMP_ULT: in ProcessUMulZExtIdiom()
2438 case ICmpInst::ICMP_ULE: in ProcessUMulZExtIdiom()
2457 static APInt DemandedBitsLHSMask(ICmpInst &I, in DemandedBitsLHSMask()
2471 case ICmpInst::ICMP_UGT: { in DemandedBitsLHSMask()
2479 case ICmpInst::ICMP_ULT: { in DemandedBitsLHSMask()
2576 auto *IC = dyn_cast<ICmpInst>(BI->getCondition()); in isChainSelectCmpBranch()
2625 const ICmpInst *Icmp, in replacedSelectWithOperand()
2628 if (isChainSelectCmpBranch(SI) && Icmp->getPredicate() == ICmpInst::ICMP_EQ) { in replacedSelectWithOperand()
2648 Instruction *InstCombiner::visitICmpInst(ICmpInst &I) { in visitICmpInst()
2670 if (I.getPredicate() == ICmpInst::ICMP_NE && match(Op1, m_Zero())) in visitICmpInst()
2692 case ICmpInst::ICMP_EQ: { // icmp eq i1 A, B -> ~(A^B) in visitICmpInst()
2696 case ICmpInst::ICMP_NE: // icmp eq i1 A, B -> A^B in visitICmpInst()
2699 case ICmpInst::ICMP_UGT: in visitICmpInst()
2702 case ICmpInst::ICMP_ULT:{ // icmp ult i1 A, B -> ~A & B in visitICmpInst()
2706 case ICmpInst::ICMP_SGT: in visitICmpInst()
2709 case ICmpInst::ICMP_SLT: { // icmp slt i1 A, B -> A & ~B in visitICmpInst()
2713 case ICmpInst::ICMP_UGE: in visitICmpInst()
2716 case ICmpInst::ICMP_ULE: { // icmp ule i1 A, B -> ~A | B in visitICmpInst()
2720 case ICmpInst::ICMP_SGE: in visitICmpInst()
2723 case ICmpInst::ICMP_SLE: { // icmp sle i1 A, B -> A | ~B in visitICmpInst()
2756 if (I.getPredicate() == ICmpInst::ICMP_UGT && in visitICmpInst()
2768 return new ICmpInst(I.getPredicate(), A, B); in visitICmpInst()
2771 if (I.getPredicate() == ICmpInst::ICMP_SGT && CI->isAllOnesValue() && in visitICmpInst()
2773 return new ICmpInst(ICmpInst::ICMP_SGE, A, B); in visitICmpInst()
2776 if (I.getPredicate() == ICmpInst::ICMP_SGT && CI->isZero() && in visitICmpInst()
2778 return new ICmpInst(ICmpInst::ICMP_SGT, A, B); in visitICmpInst()
2781 if (I.getPredicate() == ICmpInst::ICMP_SLT && CI->isZero() && in visitICmpInst()
2783 return new ICmpInst(ICmpInst::ICMP_SLT, A, B); in visitICmpInst()
2786 if (I.getPredicate() == ICmpInst::ICMP_SLT && CI->isOne() && in visitICmpInst()
2788 return new ICmpInst(ICmpInst::ICMP_SLE, A, B); in visitICmpInst()
2797 case ICmpInst::ICMP_ULE: in visitICmpInst()
2799 return new ICmpInst(ICmpInst::ICMP_ULT, Op0, in visitICmpInst()
2801 case ICmpInst::ICMP_SLE: in visitICmpInst()
2803 return new ICmpInst(ICmpInst::ICMP_SLT, Op0, in visitICmpInst()
2805 case ICmpInst::ICMP_UGE: in visitICmpInst()
2807 return new ICmpInst(ICmpInst::ICMP_UGT, Op0, in visitICmpInst()
2809 case ICmpInst::ICMP_SGE: in visitICmpInst()
2811 return new ICmpInst(ICmpInst::ICMP_SGT, Op0, in visitICmpInst()
2872 return new ICmpInst(I.getPredicate(), in visitICmpInst()
2875 return new ICmpInst(I.getPredicate(), Op0, in visitICmpInst()
2882 case ICmpInst::ICMP_EQ: { in visitICmpInst()
2906 return new ICmpInst(ICmpInst::ICMP_NE, X, in visitICmpInst()
2910 return new ICmpInst(ICmpInst::ICMP_UGT, X, in visitICmpInst()
2920 return new ICmpInst(ICmpInst::ICMP_NE, X, in visitICmpInst()
2927 case ICmpInst::ICMP_NE: { in visitICmpInst()
2951 return new ICmpInst(ICmpInst::ICMP_EQ, X, in visitICmpInst()
2955 return new ICmpInst(ICmpInst::ICMP_ULT, X, in visitICmpInst()
2965 return new ICmpInst(ICmpInst::ICMP_EQ, X, in visitICmpInst()
2972 case ICmpInst::ICMP_ULT: in visitICmpInst()
2978 return new ICmpInst(ICmpInst::ICMP_NE, Op0, Op1); in visitICmpInst()
2981 return new ICmpInst(ICmpInst::ICMP_EQ, Op0, in visitICmpInst()
2986 return new ICmpInst(ICmpInst::ICMP_SGT, Op0, in visitICmpInst()
2990 case ICmpInst::ICMP_UGT: in visitICmpInst()
2997 return new ICmpInst(ICmpInst::ICMP_NE, Op0, Op1); in visitICmpInst()
3000 return new ICmpInst(ICmpInst::ICMP_EQ, Op0, in visitICmpInst()
3005 return new ICmpInst(ICmpInst::ICMP_SLT, Op0, in visitICmpInst()
3009 case ICmpInst::ICMP_SLT: in visitICmpInst()
3015 return new ICmpInst(ICmpInst::ICMP_NE, Op0, Op1); in visitICmpInst()
3018 return new ICmpInst(ICmpInst::ICMP_EQ, Op0, in visitICmpInst()
3022 case ICmpInst::ICMP_SGT: in visitICmpInst()
3029 return new ICmpInst(ICmpInst::ICMP_NE, Op0, Op1); in visitICmpInst()
3032 return new ICmpInst(ICmpInst::ICMP_EQ, Op0, in visitICmpInst()
3036 case ICmpInst::ICMP_SGE: in visitICmpInst()
3043 case ICmpInst::ICMP_SLE: in visitICmpInst()
3050 case ICmpInst::ICMP_UGE: in visitICmpInst()
3057 case ICmpInst::ICMP_ULE: in visitICmpInst()
3071 return new ICmpInst(I.getUnsignedPredicate(), Op0, Op1); in visitICmpInst()
3106 return new ICmpInst(I.getPredicate(), LHSI->getOperand(0), in visitICmpInst()
3169 return new ICmpInst(I.getPredicate(), LHSI->getOperand(0), in visitICmpInst()
3193 ICmpInst::getSwappedPredicate(I.getPredicate()), I)) in visitICmpInst()
3220 return new ICmpInst(I.getPredicate(), Op0, Op1); in visitICmpInst()
3243 NoOp0WrapProblem = ICmpInst::isEquality(Pred) || in visitICmpInst()
3247 NoOp1WrapProblem = ICmpInst::isEquality(Pred) || in visitICmpInst()
3260 if (NoOp0WrapProblem && ICmpInst::isSigned(Pred) && match(Op1, m_Zero())) in visitICmpInst()
3263 return new ICmpInst(Pred, A, ConstantExpr::getNeg(RHSC)); in visitICmpInst()
3267 return new ICmpInst(Pred, A == Op1 ? B : A, in visitICmpInst()
3272 return new ICmpInst(Pred, Constant::getNullValue(Op0->getType()), in visitICmpInst()
3300 return new ICmpInst(Pred, Y, Z); in visitICmpInst()
3306 return new ICmpInst(CmpInst::ICMP_SLE, A, Op1); in visitICmpInst()
3311 return new ICmpInst(CmpInst::ICMP_SGT, A, Op1); in visitICmpInst()
3316 return new ICmpInst(CmpInst::ICMP_SLT, A, Op1); in visitICmpInst()
3321 return new ICmpInst(CmpInst::ICMP_SGE, A, Op1); in visitICmpInst()
3342 return new ICmpInst(Pred, NewAdd, C); in visitICmpInst()
3346 return new ICmpInst(Pred, A, NewAdd); in visitICmpInst()
3362 return new ICmpInst(Pred, Constant::getNullValue(Op1->getType()), B); in visitICmpInst()
3366 return new ICmpInst(Pred, D, Constant::getNullValue(Op0->getType())); in visitICmpInst()
3372 return new ICmpInst(Pred, A, C); in visitICmpInst()
3378 return new ICmpInst(Pred, D, B); in visitICmpInst()
3381 if (NoOp0WrapProblem && ICmpInst::isSigned(Pred)) { in visitICmpInst()
3386 return new ICmpInst(I.getSwappedPredicate(), X, in visitICmpInst()
3402 switch (SRem == BO0 ? ICmpInst::getSwappedPredicate(Pred) : Pred) { in visitICmpInst()
3404 case ICmpInst::ICMP_EQ: in visitICmpInst()
3406 case ICmpInst::ICMP_NE: in visitICmpInst()
3408 case ICmpInst::ICMP_SGT: in visitICmpInst()
3409 case ICmpInst::ICMP_SGE: in visitICmpInst()
3410 return new ICmpInst(ICmpInst::ICMP_SGT, SRem->getOperand(1), in visitICmpInst()
3412 case ICmpInst::ICMP_SLT: in visitICmpInst()
3413 case ICmpInst::ICMP_SLE: in visitICmpInst()
3414 return new ICmpInst(ICmpInst::ICMP_SLT, SRem->getOperand(1), in visitICmpInst()
3428 return new ICmpInst(I.getPredicate(), BO0->getOperand(0), in visitICmpInst()
3433 ICmpInst::Predicate Pred = I.isSigned() in visitICmpInst()
3436 return new ICmpInst(Pred, BO0->getOperand(0), in visitICmpInst()
3441 ICmpInst::Predicate Pred = I.isSigned() in visitICmpInst()
3445 return new ICmpInst(Pred, BO0->getOperand(0), in visitICmpInst()
3465 return new ICmpInst(I.getPredicate(), And1, And2); in visitICmpInst()
3478 return new ICmpInst(I.getPredicate(), BO0->getOperand(0), in visitICmpInst()
3487 return new ICmpInst(I.getPredicate(), BO0->getOperand(0), in visitICmpInst()
3501 return new ICmpInst(I.getInversePredicate(), in visitICmpInst()
3509 return new ICmpInst(I.getPredicate(), B, A); in visitICmpInst()
3511 return new ICmpInst(I.getPredicate(), ConstantExpr::getNot(RHSC), A); in visitICmpInst()
3544 return new ICmpInst(I.getPredicate(), OtherVal, in visitICmpInst()
3555 return new ICmpInst(I.getPredicate(), A, Xor); in visitICmpInst()
3559 if (A == C) return new ICmpInst(I.getPredicate(), B, D); in visitICmpInst()
3560 if (A == D) return new ICmpInst(I.getPredicate(), B, C); in visitICmpInst()
3561 if (B == C) return new ICmpInst(I.getPredicate(), A, D); in visitICmpInst()
3562 if (B == D) return new ICmpInst(I.getPredicate(), A, C); in visitICmpInst()
3570 return new ICmpInst(I.getPredicate(), OtherVal, in visitICmpInst()
3610 return new ICmpInst(I.getPredicate(), A, in visitICmpInst()
3623 ICmpInst::Predicate Pred = I.getPredicate() == ICmpInst::ICMP_NE in visitICmpInst()
3624 ? ICmpInst::ICMP_UGE in visitICmpInst()
3625 : ICmpInst::ICMP_ULT; in visitICmpInst()
3628 return new ICmpInst(Pred, Xor, Builder->getInt(CmpVal)); in visitICmpInst()
3642 return new ICmpInst(I.getPredicate(), And, in visitICmpInst()
3668 return new ICmpInst(I.getPredicate(), Mask, Builder->getInt(CmpV)); in visitICmpInst()
3682 if (I.getPredicate() == ICmpInst::ICMP_EQ) in visitICmpInst()
3764 ICmpInst::Predicate Pred; in FoldFCmp_IntToFP_Cst()
3769 Pred = ICmpInst::ICMP_EQ; in FoldFCmp_IntToFP_Cst()
3773 Pred = LHSUnsigned ? ICmpInst::ICMP_UGT : ICmpInst::ICMP_SGT; in FoldFCmp_IntToFP_Cst()
3777 Pred = LHSUnsigned ? ICmpInst::ICMP_UGE : ICmpInst::ICMP_SGE; in FoldFCmp_IntToFP_Cst()
3781 Pred = LHSUnsigned ? ICmpInst::ICMP_ULT : ICmpInst::ICMP_SLT; in FoldFCmp_IntToFP_Cst()
3785 Pred = LHSUnsigned ? ICmpInst::ICMP_ULE : ICmpInst::ICMP_SLE; in FoldFCmp_IntToFP_Cst()
3789 Pred = ICmpInst::ICMP_NE; in FoldFCmp_IntToFP_Cst()
3810 if (Pred == ICmpInst::ICMP_NE || Pred == ICmpInst::ICMP_SLT || in FoldFCmp_IntToFP_Cst()
3811 Pred == ICmpInst::ICMP_SLE) in FoldFCmp_IntToFP_Cst()
3822 if (Pred == ICmpInst::ICMP_NE || Pred == ICmpInst::ICMP_ULT || in FoldFCmp_IntToFP_Cst()
3823 Pred == ICmpInst::ICMP_ULE) in FoldFCmp_IntToFP_Cst()
3835 if (Pred == ICmpInst::ICMP_NE || Pred == ICmpInst::ICMP_SGT || in FoldFCmp_IntToFP_Cst()
3836 Pred == ICmpInst::ICMP_SGE) in FoldFCmp_IntToFP_Cst()
3846 if (Pred == ICmpInst::ICMP_NE || Pred == ICmpInst::ICMP_UGT || in FoldFCmp_IntToFP_Cst()
3847 Pred == ICmpInst::ICMP_UGE) in FoldFCmp_IntToFP_Cst()
3870 case ICmpInst::ICMP_NE: // (float)int != 4.4 --> true in FoldFCmp_IntToFP_Cst()
3872 case ICmpInst::ICMP_EQ: // (float)int == 4.4 --> false in FoldFCmp_IntToFP_Cst()
3874 case ICmpInst::ICMP_ULE: in FoldFCmp_IntToFP_Cst()
3880 case ICmpInst::ICMP_SLE: in FoldFCmp_IntToFP_Cst()
3884 Pred = ICmpInst::ICMP_SLT; in FoldFCmp_IntToFP_Cst()
3886 case ICmpInst::ICMP_ULT: in FoldFCmp_IntToFP_Cst()
3891 Pred = ICmpInst::ICMP_ULE; in FoldFCmp_IntToFP_Cst()
3893 case ICmpInst::ICMP_SLT: in FoldFCmp_IntToFP_Cst()
3897 Pred = ICmpInst::ICMP_SLE; in FoldFCmp_IntToFP_Cst()
3899 case ICmpInst::ICMP_UGT: in FoldFCmp_IntToFP_Cst()
3905 case ICmpInst::ICMP_SGT: in FoldFCmp_IntToFP_Cst()
3909 Pred = ICmpInst::ICMP_SGE; in FoldFCmp_IntToFP_Cst()
3911 case ICmpInst::ICMP_UGE: in FoldFCmp_IntToFP_Cst()
3916 Pred = ICmpInst::ICMP_UGT; in FoldFCmp_IntToFP_Cst()
3918 case ICmpInst::ICMP_SGE: in FoldFCmp_IntToFP_Cst()
3922 Pred = ICmpInst::ICMP_SGT; in FoldFCmp_IntToFP_Cst()
3930 return new ICmpInst(Pred, LHSI->getOperand(0), RHSInt); in FoldFCmp_IntToFP_Cst()