Lines Matching refs:ICmpInst
99 ICmpInst::Predicate NewPred;
274 ICmpInst::ICMP_SLE:ICmpInst::ICMP_ULE), Lo, Hi))->getZExtValue() &&
283 ICmpInst::Predicate pred = (isSigned ?
284 ICmpInst::ICMP_SLT : ICmpInst::ICMP_ULT);
301 ICmpInst::Predicate pred = (isSigned ?
302 ICmpInst::ICMP_SGT : ICmpInst::ICMP_UGT);
425 ICmpInst::Predicate SCC)
430 bool icmp_eq = (SCC == ICmpInst::ICMP_EQ);
494 static bool decomposeBitTestICmp(const ICmpInst *I, ICmpInst::Predicate &Pred,
497 if (I->getPredicate() == ICmpInst::ICMP_SLT)
503 Pred = ICmpInst::ICMP_NE;
509 if (I->getPredicate() == ICmpInst::ICMP_SGT)
515 Pred = ICmpInst::ICMP_EQ;
530 ICmpInst *LHS, ICmpInst *RHS,
531 ICmpInst::Predicate &LHSCC,
532 ICmpInst::Predicate &RHSCC) {
563 if (!ICmpInst::isEquality(LHSCC))
588 if (!ICmpInst::isEquality(RHSCC))
621 static Value* foldLogOpOfMaskedICmps(ICmpInst *LHS, ICmpInst *RHS,
622 ICmpInst::Predicate NEWCC,
625 ICmpInst::Predicate LHSCC = LHS->getPredicate(), RHSCC = RHS->getPredicate();
629 assert(ICmpInst::isEquality(LHSCC) && ICmpInst::isEquality(RHSCC) &&
632 if (NEWCC == ICmpInst::ICMP_NE)
700 Value *InstCombiner::FoldAndOfICmps(ICmpInst *LHS, ICmpInst *RHS) {
701 ICmpInst::Predicate LHSCC = LHS->getPredicate(), RHSCC = RHS->getPredicate();
718 if (Value *V = foldLogOpOfMaskedICmps(LHS, RHS, ICmpInst::ICMP_EQ, Builder))
730 if (LHSCC == ICmpInst::ICMP_ULT &&
737 if (LHSCC == ICmpInst::ICMP_EQ && LHSCst->isZero()) {
746 if (LHSCC == ICmpInst::ICMP_EQ && LHSCC == RHSCC &&
783 if (LHSCC == ICmpInst::ICMP_UGE || LHSCC == ICmpInst::ICMP_ULE ||
784 RHSCC == ICmpInst::ICMP_UGE || RHSCC == ICmpInst::ICMP_ULE ||
785 LHSCC == ICmpInst::ICMP_SGE || LHSCC == ICmpInst::ICMP_SLE ||
786 RHSCC == ICmpInst::ICMP_SGE || RHSCC == ICmpInst::ICMP_SLE)
806 (ICmpInst::isEquality(LHSCC) &&
828 case ICmpInst::ICMP_EQ:
831 case ICmpInst::ICMP_NE: // (X == 13 & X != 15) -> X == 13
832 case ICmpInst::ICMP_ULT: // (X == 13 & X < 15) -> X == 13
833 case ICmpInst::ICMP_SLT: // (X == 13 & X < 15) -> X == 13
836 case ICmpInst::ICMP_NE:
839 case ICmpInst::ICMP_ULT:
843 case ICmpInst::ICMP_SLT:
847 case ICmpInst::ICMP_EQ: // (X != 13 & X == 15) -> X == 15
848 case ICmpInst::ICMP_UGT: // (X != 13 & X u> 15) -> X u> 15
849 case ICmpInst::ICMP_SGT: // (X != 13 & X s> 15) -> X s> 15
851 case ICmpInst::ICMP_NE:
860 case ICmpInst::ICMP_ULT:
863 case ICmpInst::ICMP_EQ: // (X u< 13 & X == 15) -> false
864 case ICmpInst::ICMP_UGT: // (X u< 13 & X u> 15) -> false
866 case ICmpInst::ICMP_SGT: // (X u< 13 & X s> 15) -> no change
868 case ICmpInst::ICMP_NE: // (X u< 13 & X != 15) -> X u< 13
869 case ICmpInst::ICMP_ULT: // (X u< 13 & X u< 15) -> X u< 13
871 case ICmpInst::ICMP_SLT: // (X u< 13 & X s< 15) -> no change
875 case ICmpInst::ICMP_SLT:
878 case ICmpInst::ICMP_UGT: // (X s< 13 & X u> 15) -> no change
880 case ICmpInst::ICMP_NE: // (X s< 13 & X != 15) -> X < 13
881 case ICmpInst::ICMP_SLT: // (X s< 13 & X s< 15) -> X < 13
883 case ICmpInst::ICMP_ULT: // (X s< 13 & X u< 15) -> no change
887 case ICmpInst::ICMP_UGT:
890 case ICmpInst::ICMP_EQ: // (X u> 13 & X == 15) -> X == 15
891 case ICmpInst::ICMP_UGT: // (X u> 13 & X u> 15) -> X u> 15
893 case ICmpInst::ICMP_SGT: // (X u> 13 & X s> 15) -> no change
895 case ICmpInst::ICMP_NE:
899 case ICmpInst::ICMP_ULT: // (X u> 13 & X u< 15) -> (X-14) <u 1
901 case ICmpInst::ICMP_SLT: // (X u> 13 & X s< 15) -> no change
905 case ICmpInst::ICMP_SGT:
908 case ICmpInst::ICMP_EQ: // (X s> 13 & X == 15) -> X == 15
909 case ICmpInst::ICMP_SGT: // (X s> 13 & X s> 15) -> X s> 15
911 case ICmpInst::ICMP_UGT: // (X s> 13 & X u> 15) -> no change
913 case ICmpInst::ICMP_NE:
917 case ICmpInst::ICMP_SLT: // (X s> 13 & X s< 15) -> (X-14) s< 1
919 case ICmpInst::ICMP_ULT: // (X s> 13 & X u< 15) -> no change
1189 if (ICmpInst *RHS = dyn_cast<ICmpInst>(Op1))
1190 if (ICmpInst *LHS = dyn_cast<ICmpInst>(Op0))
1219 if (ICmpInst *RHS = dyn_cast<ICmpInst>(Op1COp))
1220 if (ICmpInst *LHS = dyn_cast<ICmpInst>(Op0COp))
1458 Value *InstCombiner::FoldOrOfICmps(ICmpInst *LHS, ICmpInst *RHS) {
1459 ICmpInst::Predicate LHSCC = LHS->getPredicate(), RHSCC = RHS->getPredicate();
1477 if (Value *V = foldLogOpOfMaskedICmps(LHS, RHS, ICmpInst::ICMP_NE, Builder))
1488 if (LHSCC == ICmpInst::ICMP_EQ && LHSCst && LHSCst->isZero()) {
1490 if (RHSCC == ICmpInst::ICMP_ULT && Val == RHS->getOperand(1))
1492 else if (RHSCC == ICmpInst::ICMP_UGT && Val == Val2)
1497 else if (RHSCC == ICmpInst::ICMP_EQ && RHSCst && RHSCst->isZero()) {
1499 if (LHSCC == ICmpInst::ICMP_ULT && Val2 == LHS->getOperand(1))
1501 else if (LHSCC == ICmpInst::ICMP_UGT && Val2 == Val)
1506 ICmpInst::ICMP_UGE,
1515 if (LHSCC == ICmpInst::ICMP_NE && LHSCst->isZero()) {
1523 if (LHSCC == ICmpInst::ICMP_ULT && RHSCC == ICmpInst::ICMP_EQ) {
1535 if (LHSCC == ICmpInst::ICMP_UGE || LHSCC == ICmpInst::ICMP_ULE ||
1536 RHSCC == ICmpInst::ICMP_UGE || RHSCC == ICmpInst::ICMP_ULE ||
1537 LHSCC == ICmpInst::ICMP_SGE || LHSCC == ICmpInst::ICMP_SLE ||
1538 RHSCC == ICmpInst::ICMP_SGE || RHSCC == ICmpInst::ICMP_SLE)
1548 (ICmpInst::isEquality(LHSCC) &&
1570 case ICmpInst::ICMP_EQ:
1573 case ICmpInst::ICMP_EQ:
1583 return Builder->CreateICmp(ICmpInst::ICMP_EQ, And, LHSCst);
1596 case ICmpInst::ICMP_UGT: // (X == 13 | X u> 14) -> no change
1597 case ICmpInst
1599 case ICmpInst::ICMP_NE: // (X == 13 | X != 15) -> X != 15
1600 case ICmpInst::ICMP_ULT: // (X == 13 | X u< 15) -> X u< 15
1601 case ICmpInst::ICMP_SLT: // (X == 13 | X s< 15) -> X s< 15
1605 case ICmpInst::ICMP_NE:
1608 case ICmpInst::ICMP_EQ: // (X != 13 | X == 15) -> X != 13
1609 case ICmpInst::ICMP_UGT: // (X != 13 | X u> 15) -> X != 13
1610 case ICmpInst::ICMP_SGT: // (X != 13 | X s> 15) -> X != 13
1612 case ICmpInst::ICMP_NE: // (X != 13 | X != 15) -> true
1613 case ICmpInst::ICMP_ULT: // (X != 13 | X u< 15) -> true
1614 case ICmpInst::ICMP_SLT: // (X != 13 | X s< 15) -> true
1617 case ICmpInst::ICMP_ULT:
1620 case ICmpInst::ICMP_EQ: // (X u< 13 | X == 14) -> no change
1622 case ICmpInst::ICMP_UGT: // (X u< 13 | X u> 15) -> (X-13) u> 2
1628 case ICmpInst::ICMP_SGT: // (X u< 13 | X s> 15) -> no change
1630 case ICmpInst::ICMP_NE: // (X u< 13 | X != 15) -> X != 15
1631 case ICmpInst::ICMP_ULT: // (X u< 13 | X u< 15) -> X u< 15
1633 case ICmpInst::ICMP_SLT: // (X u< 13 | X s< 15) -> no change
1637 case ICmpInst::ICMP_SLT:
1640 case ICmpInst::ICMP_EQ: // (X s< 13 | X == 14) -> no change
1642 case ICmpInst::ICMP_SGT: // (X s< 13 | X s> 15) -> (X-13) s> 2
1648 case ICmpInst::ICMP_UGT: // (X s< 13 | X u> 15) -> no change
1650 case ICmpInst::ICMP_NE: // (X s< 13 | X != 15) -> X != 15
1651 case ICmpInst::ICMP_SLT: // (X s< 13 | X s< 15) -> X s< 15
1653 case ICmpInst::ICMP_ULT: // (X s< 13 | X u< 15) -> no change
1657 case ICmpInst::ICMP_UGT:
1660 case ICmpInst::ICMP_EQ: // (X u> 13 | X == 15) -> X u> 13
1661 case ICmpInst::ICMP_UGT: // (X u> 13 | X u> 15) -> X u> 13
1663 case ICmpInst::ICMP_SGT: // (X u> 13 | X s> 15) -> no change
1665 case ICmpInst::ICMP_NE: // (X u> 13 | X != 15) -> true
1666 case ICmpInst::ICMP_ULT: // (X u> 13 | X u< 15) -> true
1668 case ICmpInst::ICMP_SLT: // (X u> 13 | X s< 15) -> no change
1672 case ICmpInst::ICMP_SGT:
1675 case ICmpInst::ICMP_EQ: // (X s> 13 | X == 15) -> X > 13
1676 case ICmpInst::ICMP_SGT: // (X s> 13 | X s> 15) -> X > 13
1678 case ICmpInst::ICMP_UGT: // (X s> 13 | X u> 15) -> no change
1680 case ICmpInst::ICMP_NE: // (X s> 13 | X != 15) -> true
1681 case ICmpInst::ICMP_SLT: // (X s> 13 | X s< 15) -> true
1683 case ICmpInst::ICMP_ULT: // (X s> 13 | X u< 15) -> no change
2030 if (ICmpInst *RHS = dyn_cast<ICmpInst>(I.getOperand(1)))
2031 if (ICmpInst *LHS = dyn_cast<ICmpInst>(I.getOperand(0)))
2050 if ((!isa<ICmpInst>(Op0COp) || !isa<ICmpInst>(Op1COp)) &&
2061 if (ICmpInst *RHS = dyn_cast<ICmpInst>(Op1COp))
2062 if (ICmpInst *LHS = dyn_cast<ICmpInst>(Op0COp))
2338 if (ICmpInst *RHS = dyn_cast<ICmpInst>(I.getOperand(1)))
2339 if (ICmpInst *LHS = dyn_cast<ICmpInst>(I.getOperand(0)))