Lines Matching refs:ICmpInst
73 ICmpInst::Predicate NewPred; in getNewICmpValue()
303 ICmpInst::ICMP_SLE:ICmpInst::ICMP_ULE), Lo, Hi))->getZExtValue() && in InsertRangeTest()
312 ICmpInst::Predicate pred = (isSigned ? in InsertRangeTest()
313 ICmpInst::ICMP_SLT : ICmpInst::ICMP_ULT); in InsertRangeTest()
330 ICmpInst::Predicate pred = (isSigned ? in InsertRangeTest()
331 ICmpInst::ICMP_SGT : ICmpInst::ICMP_UGT); in InsertRangeTest()
454 ICmpInst::Predicate SCC) in getTypeOfMaskedICmp()
459 bool icmp_eq = (SCC == ICmpInst::ICMP_EQ); in getTypeOfMaskedICmp()
543 static bool decomposeBitTestICmp(const ICmpInst *I, ICmpInst::Predicate &Pred, in decomposeBitTestICmp()
552 case ICmpInst::ICMP_SLT: in decomposeBitTestICmp()
557 Pred = ICmpInst::ICMP_NE; in decomposeBitTestICmp()
559 case ICmpInst::ICMP_SGT: in decomposeBitTestICmp()
564 Pred = ICmpInst::ICMP_EQ; in decomposeBitTestICmp()
566 case ICmpInst::ICMP_ULT: in decomposeBitTestICmp()
571 Pred = ICmpInst::ICMP_EQ; in decomposeBitTestICmp()
573 case ICmpInst::ICMP_UGT: in decomposeBitTestICmp()
578 Pred = ICmpInst::ICMP_NE; in decomposeBitTestICmp()
594 ICmpInst *LHS, ICmpInst *RHS, in foldLogOpOfMaskedICmpsHelper()
595 ICmpInst::Predicate &LHSCC, in foldLogOpOfMaskedICmpsHelper()
596 ICmpInst::Predicate &RHSCC) { in foldLogOpOfMaskedICmpsHelper()
635 if (!ICmpInst::isEquality(LHSCC)) in foldLogOpOfMaskedICmpsHelper()
667 if (!ICmpInst::isEquality(RHSCC)) in foldLogOpOfMaskedICmpsHelper()
705 static Value *foldLogOpOfMaskedICmps(ICmpInst *LHS, ICmpInst *RHS, bool IsAnd, in foldLogOpOfMaskedICmps()
708 ICmpInst::Predicate LHSCC = LHS->getPredicate(), RHSCC = RHS->getPredicate(); in foldLogOpOfMaskedICmps()
712 assert(ICmpInst::isEquality(LHSCC) && ICmpInst::isEquality(RHSCC) && in foldLogOpOfMaskedICmps()
727 ICmpInst::Predicate NEWCC = IsAnd ? ICmpInst::ICMP_EQ : ICmpInst::ICMP_NE; in foldLogOpOfMaskedICmps()
829 Value *InstCombiner::simplifyRangeCheck(ICmpInst *Cmp0, ICmpInst *Cmp1, in simplifyRangeCheck()
837 ICmpInst::Predicate Pred0 = (Inverted ? Cmp0->getInversePredicate() : in simplifyRangeCheck()
841 if (!((Pred0 == ICmpInst::ICMP_SGT && RangeStart->isMinusOne()) || in simplifyRangeCheck()
842 (Pred0 == ICmpInst::ICMP_SGE && RangeStart->isZero()))) in simplifyRangeCheck()
845 ICmpInst::Predicate Pred1 = (Inverted ? Cmp1->getInversePredicate() : in simplifyRangeCheck()
856 Pred1 = ICmpInst::getSwappedPredicate(Pred1); in simplifyRangeCheck()
862 ICmpInst::Predicate NewPred; in simplifyRangeCheck()
864 case ICmpInst::ICMP_SLT: NewPred = ICmpInst::ICMP_ULT; break; in simplifyRangeCheck()
865 case ICmpInst::ICMP_SLE: NewPred = ICmpInst::ICMP_ULE; break; in simplifyRangeCheck()
876 NewPred = ICmpInst::getInversePredicate(NewPred); in simplifyRangeCheck()
882 Value *InstCombiner::FoldAndOfICmps(ICmpInst *LHS, ICmpInst *RHS) { in FoldAndOfICmps()
883 ICmpInst::Predicate LHSCC = LHS->getPredicate(), RHSCC = RHS->getPredicate(); in FoldAndOfICmps()
920 if (LHSCC == ICmpInst::ICMP_ULT && in FoldAndOfICmps()
927 if (LHSCC == ICmpInst::ICMP_EQ && LHSCst->isZero()) { in FoldAndOfICmps()
936 if (LHSCC == ICmpInst::ICMP_EQ && LHSCC == RHSCC && in FoldAndOfICmps()
973 if (LHSCC == ICmpInst::ICMP_UGE || LHSCC == ICmpInst::ICMP_ULE || in FoldAndOfICmps()
974 RHSCC == ICmpInst::ICMP_UGE || RHSCC == ICmpInst::ICMP_ULE || in FoldAndOfICmps()
975 LHSCC == ICmpInst::ICMP_SGE || LHSCC == ICmpInst::ICMP_SLE || in FoldAndOfICmps()
976 RHSCC == ICmpInst::ICMP_SGE || RHSCC == ICmpInst::ICMP_SLE) in FoldAndOfICmps()
996 (ICmpInst::isEquality(LHSCC) && in FoldAndOfICmps()
1018 case ICmpInst::ICMP_EQ: in FoldAndOfICmps()
1021 case ICmpInst::ICMP_NE: // (X == 13 & X != 15) -> X == 13 in FoldAndOfICmps()
1022 case ICmpInst::ICMP_ULT: // (X == 13 & X < 15) -> X == 13 in FoldAndOfICmps()
1023 case ICmpInst::ICMP_SLT: // (X == 13 & X < 15) -> X == 13 in FoldAndOfICmps()
1026 case ICmpInst::ICMP_NE: in FoldAndOfICmps()
1029 case ICmpInst::ICMP_ULT: in FoldAndOfICmps()
1035 case ICmpInst::ICMP_SLT: in FoldAndOfICmps()
1039 case ICmpInst::ICMP_EQ: // (X != 13 & X == 15) -> X == 15 in FoldAndOfICmps()
1040 case ICmpInst::ICMP_UGT: // (X != 13 & X u> 15) -> X u> 15 in FoldAndOfICmps()
1041 case ICmpInst::ICMP_SGT: // (X != 13 & X s> 15) -> X s> 15 in FoldAndOfICmps()
1043 case ICmpInst::ICMP_NE: in FoldAndOfICmps()
1057 case ICmpInst::ICMP_ULT: in FoldAndOfICmps()
1060 case ICmpInst::ICMP_EQ: // (X u< 13 & X == 15) -> false in FoldAndOfICmps()
1061 case ICmpInst::ICMP_UGT: // (X u< 13 & X u> 15) -> false in FoldAndOfICmps()
1063 case ICmpInst::ICMP_SGT: // (X u< 13 & X s> 15) -> no change in FoldAndOfICmps()
1065 case ICmpInst::ICMP_NE: // (X u< 13 & X != 15) -> X u< 13 in FoldAndOfICmps()
1066 case ICmpInst::ICMP_ULT: // (X u< 13 & X u< 15) -> X u< 13 in FoldAndOfICmps()
1068 case ICmpInst::ICMP_SLT: // (X u< 13 & X s< 15) -> no change in FoldAndOfICmps()
1072 case ICmpInst::ICMP_SLT: in FoldAndOfICmps()
1075 case ICmpInst::ICMP_UGT: // (X s< 13 & X u> 15) -> no change in FoldAndOfICmps()
1077 case ICmpInst::ICMP_NE: // (X s< 13 & X != 15) -> X < 13 in FoldAndOfICmps()
1078 case ICmpInst::ICMP_SLT: // (X s< 13 & X s< 15) -> X < 13 in FoldAndOfICmps()
1080 case ICmpInst::ICMP_ULT: // (X s< 13 & X u< 15) -> no change in FoldAndOfICmps()
1084 case ICmpInst::ICMP_UGT: in FoldAndOfICmps()
1087 case ICmpInst::ICMP_EQ: // (X u> 13 & X == 15) -> X == 15 in FoldAndOfICmps()
1088 case ICmpInst::ICMP_UGT: // (X u> 13 & X u> 15) -> X u> 15 in FoldAndOfICmps()
1090 case ICmpInst::ICMP_SGT: // (X u> 13 & X s> 15) -> no change in FoldAndOfICmps()
1092 case ICmpInst::ICMP_NE: in FoldAndOfICmps()
1096 case ICmpInst::ICMP_ULT: // (X u> 13 & X u< 15) -> (X-14) <u 1 in FoldAndOfICmps()
1098 case ICmpInst::ICMP_SLT: // (X u> 13 & X s< 15) -> no change in FoldAndOfICmps()
1102 case ICmpInst::ICMP_SGT: in FoldAndOfICmps()
1105 case ICmpInst::ICMP_EQ: // (X s> 13 & X == 15) -> X == 15 in FoldAndOfICmps()
1106 case ICmpInst::ICMP_SGT: // (X s> 13 & X s> 15) -> X s> 15 in FoldAndOfICmps()
1108 case ICmpInst::ICMP_UGT: // (X s> 13 & X u> 15) -> no change in FoldAndOfICmps()
1110 case ICmpInst::ICMP_NE: in FoldAndOfICmps()
1114 case ICmpInst::ICMP_SLT: // (X s> 13 & X s< 15) -> (X-14) s< 1 in FoldAndOfICmps()
1116 case ICmpInst::ICMP_ULT: // (X s> 13 & X u< 15) -> no change in FoldAndOfICmps()
1414 ICmpInst *LHS = dyn_cast<ICmpInst>(Op0); in visitAnd()
1415 ICmpInst *RHS = dyn_cast<ICmpInst>(Op1); in visitAnd()
1424 if (auto *Cmp = dyn_cast<ICmpInst>(X)) in visitAnd()
1427 if (auto *Cmp = dyn_cast<ICmpInst>(Y)) in visitAnd()
1432 if (auto *Cmp = dyn_cast<ICmpInst>(X)) in visitAnd()
1435 if (auto *Cmp = dyn_cast<ICmpInst>(Y)) in visitAnd()
1466 if (ICmpInst *RHS = dyn_cast<ICmpInst>(Op1COp)) in visitAnd()
1467 if (ICmpInst *LHS = dyn_cast<ICmpInst>(Op0COp)) in visitAnd()
1691 Value *InstCombiner::FoldOrOfICmps(ICmpInst *LHS, ICmpInst *RHS, in FoldOrOfICmps()
1693 ICmpInst::Predicate LHSCC = LHS->getPredicate(), RHSCC = RHS->getPredicate(); in FoldOrOfICmps()
1700 if (LHS->getPredicate() == ICmpInst::ICMP_EQ && LHSCst && LHSCst->isZero() && in FoldOrOfICmps()
1701 RHS->getPredicate() == ICmpInst::ICMP_EQ && RHSCst && RHSCst->isZero()) { in FoldOrOfICmps()
1728 return Builder->CreateICmp(ICmpInst::ICMP_NE, Masked, Mask); in FoldOrOfICmps()
1743 if ((LHSCC == ICmpInst::ICMP_ULT || LHSCC == ICmpInst::ICMP_ULE) && in FoldOrOfICmps()
1811 if (LHSCC == ICmpInst::ICMP_EQ && LHSCst && LHSCst->isZero()) { in FoldOrOfICmps()
1813 if (RHSCC == ICmpInst::ICMP_ULT && Val == RHS->getOperand(1)) in FoldOrOfICmps()
1815 else if (RHSCC == ICmpInst::ICMP_UGT && Val == Val2) in FoldOrOfICmps()
1820 else if (RHSCC == ICmpInst::ICMP_EQ && RHSCst && RHSCst->isZero()) { in FoldOrOfICmps()
1822 if (LHSCC == ICmpInst::ICMP_ULT && Val2 == LHS->getOperand(1)) in FoldOrOfICmps()
1824 else if (LHSCC == ICmpInst::ICMP_UGT && Val2 == Val) in FoldOrOfICmps()
1829 ICmpInst::ICMP_UGE, in FoldOrOfICmps()
1846 if (LHSCC == ICmpInst::ICMP_NE && LHSCst->isZero()) { in FoldOrOfICmps()
1854 if (LHSCC == ICmpInst::ICMP_ULT && RHSCC == ICmpInst::ICMP_EQ) { in FoldOrOfICmps()
1866 if (LHSCC == ICmpInst::ICMP_UGE || LHSCC == ICmpInst::ICMP_ULE || in FoldOrOfICmps()
1867 RHSCC == ICmpInst::ICMP_UGE || RHSCC == ICmpInst::ICMP_ULE || in FoldOrOfICmps()
1868 LHSCC == ICmpInst::ICMP_SGE || LHSCC == ICmpInst::ICMP_SLE || in FoldOrOfICmps()
1869 RHSCC == ICmpInst::ICMP_SGE || RHSCC == ICmpInst::ICMP_SLE) in FoldOrOfICmps()
1879 (ICmpInst::isEquality(LHSCC) && in FoldOrOfICmps()
1901 case ICmpInst::ICMP_EQ: in FoldOrOfICmps()
1904 case ICmpInst::ICMP_EQ: in FoldOrOfICmps()
1914 return Builder->CreateICmp(ICmpInst::ICMP_EQ, And, LHSCst); in FoldOrOfICmps()
1927 case ICmpInst::ICMP_UGT: // (X == 13 | X u> 14) -> no change in FoldOrOfICmps()
1928 case ICmpInst::ICMP_SGT: // (X == 13 | X s> 14) -> no change in FoldOrOfICmps()
1930 case ICmpInst::ICMP_NE: // (X == 13 | X != 15) -> X != 15 in FoldOrOfICmps()
1931 case ICmpInst::ICMP_ULT: // (X == 13 | X u< 15) -> X u< 15 in FoldOrOfICmps()
1932 case ICmpInst::ICMP_SLT: // (X == 13 | X s< 15) -> X s< 15 in FoldOrOfICmps()
1936 case ICmpInst::ICMP_NE: in FoldOrOfICmps()
1939 case ICmpInst::ICMP_EQ: // (X != 13 | X == 15) -> X != 13 in FoldOrOfICmps()
1940 case ICmpInst::ICMP_UGT: // (X != 13 | X u> 15) -> X != 13 in FoldOrOfICmps()
1941 case ICmpInst::ICMP_SGT: // (X != 13 | X s> 15) -> X != 13 in FoldOrOfICmps()
1943 case ICmpInst::ICMP_NE: // (X != 13 | X != 15) -> true in FoldOrOfICmps()
1944 case ICmpInst::ICMP_ULT: // (X != 13 | X u< 15) -> true in FoldOrOfICmps()
1945 case ICmpInst::ICMP_SLT: // (X != 13 | X s< 15) -> true in FoldOrOfICmps()
1948 case ICmpInst::ICMP_ULT: in FoldOrOfICmps()
1951 case ICmpInst::ICMP_EQ: // (X u< 13 | X == 14) -> no change in FoldOrOfICmps()
1953 case ICmpInst::ICMP_UGT: // (X u< 13 | X u> 15) -> (X-13) u> 2 in FoldOrOfICmps()
1959 case ICmpInst::ICMP_SGT: // (X u< 13 | X s> 15) -> no change in FoldOrOfICmps()
1961 case ICmpInst::ICMP_NE: // (X u< 13 | X != 15) -> X != 15 in FoldOrOfICmps()
1962 case ICmpInst::ICMP_ULT: // (X u< 13 | X u< 15) -> X u< 15 in FoldOrOfICmps()
1964 case ICmpInst::ICMP_SLT: // (X u< 13 | X s< 15) -> no change in FoldOrOfICmps()
1968 case ICmpInst::ICMP_SLT: in FoldOrOfICmps()
1971 case ICmpInst::ICMP_EQ: // (X s< 13 | X == 14) -> no change in FoldOrOfICmps()
1973 case ICmpInst::ICMP_SGT: // (X s< 13 | X s> 15) -> (X-13) s> 2 in FoldOrOfICmps()
1979 case ICmpInst::ICMP_UGT: // (X s< 13 | X u> 15) -> no change in FoldOrOfICmps()
1981 case ICmpInst::ICMP_NE: // (X s< 13 | X != 15) -> X != 15 in FoldOrOfICmps()
1982 case ICmpInst::ICMP_SLT: // (X s< 13 | X s< 15) -> X s< 15 in FoldOrOfICmps()
1984 case ICmpInst::ICMP_ULT: // (X s< 13 | X u< 15) -> no change in FoldOrOfICmps()
1988 case ICmpInst::ICMP_UGT: in FoldOrOfICmps()
1991 case ICmpInst::ICMP_EQ: // (X u> 13 | X == 15) -> X u> 13 in FoldOrOfICmps()
1992 case ICmpInst::ICMP_UGT: // (X u> 13 | X u> 15) -> X u> 13 in FoldOrOfICmps()
1994 case ICmpInst::ICMP_SGT: // (X u> 13 | X s> 15) -> no change in FoldOrOfICmps()
1996 case ICmpInst::ICMP_NE: // (X u> 13 | X != 15) -> true in FoldOrOfICmps()
1997 case ICmpInst::ICMP_ULT: // (X u> 13 | X u< 15) -> true in FoldOrOfICmps()
1999 case ICmpInst::ICMP_SLT: // (X u> 13 | X s< 15) -> no change in FoldOrOfICmps()
2003 case ICmpInst::ICMP_SGT: in FoldOrOfICmps()
2006 case ICmpInst::ICMP_EQ: // (X s> 13 | X == 15) -> X > 13 in FoldOrOfICmps()
2007 case ICmpInst::ICMP_SGT: // (X s> 13 | X s> 15) -> X > 13 in FoldOrOfICmps()
2009 case ICmpInst::ICMP_UGT: // (X s> 13 | X u> 15) -> no change in FoldOrOfICmps()
2011 case ICmpInst::ICMP_NE: // (X s> 13 | X != 15) -> true in FoldOrOfICmps()
2012 case ICmpInst::ICMP_SLT: // (X s> 13 | X s< 15) -> true in FoldOrOfICmps()
2014 case ICmpInst::ICMP_ULT: // (X s> 13 | X u< 15) -> no change in FoldOrOfICmps()
2426 ICmpInst *LHS = dyn_cast<ICmpInst>(Op0); in visitOr()
2427 ICmpInst *RHS = dyn_cast<ICmpInst>(Op1); in visitOr()
2436 if (auto *Cmp = dyn_cast<ICmpInst>(X)) in visitOr()
2439 if (auto *Cmp = dyn_cast<ICmpInst>(Y)) in visitOr()
2444 if (auto *Cmp = dyn_cast<ICmpInst>(X)) in visitOr()
2447 if (auto *Cmp = dyn_cast<ICmpInst>(Y)) in visitOr()
2468 if ((!isa<ICmpInst>(Op0COp) || !isa<ICmpInst>(Op1COp)) && in visitOr()
2479 if (ICmpInst *RHS = dyn_cast<ICmpInst>(Op1COp)) in visitOr()
2480 if (ICmpInst *LHS = dyn_cast<ICmpInst>(Op0COp)) in visitOr()
2808 if (ICmpInst *RHS = dyn_cast<ICmpInst>(I.getOperand(1))) in visitXor()
2809 if (ICmpInst *LHS = dyn_cast<ICmpInst>(I.getOperand(0))) in visitXor()