Lines Matching refs:ICmpInst
1395 static ICmpInst::Predicate areGlobalsPotentiallyEqual(const GlobalValue *GV1, in areGlobalsPotentiallyEqual()
1415 return ICmpInst::ICMP_NE; in areGlobalsPotentiallyEqual()
1416 return ICmpInst::BAD_ICMP_PREDICATE; in areGlobalsPotentiallyEqual()
1431 static ICmpInst::Predicate evaluateICmpRelation(Constant *V1, Constant *V2, in evaluateICmpRelation()
1435 if (V1 == V2) return ICmpInst::ICMP_EQ; in evaluateICmpRelation()
1444 ICmpInst::Predicate pred = ICmpInst::ICMP_EQ; in evaluateICmpRelation()
1448 pred = isSigned ? ICmpInst::ICMP_SLT : ICmpInst::ICMP_ULT; in evaluateICmpRelation()
1452 pred = isSigned ? ICmpInst::ICMP_SGT : ICmpInst::ICMP_UGT; in evaluateICmpRelation()
1458 return ICmpInst::BAD_ICMP_PREDICATE; in evaluateICmpRelation()
1462 ICmpInst::Predicate SwappedRelation = in evaluateICmpRelation()
1464 if (SwappedRelation != ICmpInst::BAD_ICMP_PREDICATE) in evaluateICmpRelation()
1465 return ICmpInst::getSwappedPredicate(SwappedRelation); in evaluateICmpRelation()
1469 ICmpInst::Predicate SwappedRelation = in evaluateICmpRelation()
1471 if (SwappedRelation != ICmpInst::BAD_ICMP_PREDICATE) in evaluateICmpRelation()
1472 return ICmpInst::getSwappedPredicate(SwappedRelation); in evaluateICmpRelation()
1473 return ICmpInst::BAD_ICMP_PREDICATE; in evaluateICmpRelation()
1482 return ICmpInst::ICMP_NE; // Globals never equal labels. in evaluateICmpRelation()
1488 return ICmpInst::ICMP_NE; in evaluateICmpRelation()
1492 ICmpInst::Predicate SwappedRelation = in evaluateICmpRelation()
1494 if (SwappedRelation != ICmpInst::BAD_ICMP_PREDICATE) in evaluateICmpRelation()
1495 return ICmpInst::getSwappedPredicate(SwappedRelation); in evaluateICmpRelation()
1496 return ICmpInst::BAD_ICMP_PREDICATE; in evaluateICmpRelation()
1507 return ICmpInst::ICMP_NE; in evaluateICmpRelation()
1512 return ICmpInst::ICMP_NE; in evaluateICmpRelation()
1560 return isSigned ? ICmpInst::ICMP_SGE : ICmpInst::ICMP_UGE; in evaluateICmpRelation()
1564 return isSigned ? ICmpInst::ICMP_SGT : ICmpInst::ICMP_UGT; in evaluateICmpRelation()
1571 return isSigned ? ICmpInst::ICMP_SGT : ICmpInst::ICMP_UGT; in evaluateICmpRelation()
1573 return ICmpInst::ICMP_EQ; in evaluateICmpRelation()
1581 return isSigned ? ICmpInst::ICMP_SLE : ICmpInst::ICMP_ULE; in evaluateICmpRelation()
1585 return isSigned ? ICmpInst::ICMP_SLT : ICmpInst::ICMP_ULT; in evaluateICmpRelation()
1595 return isSigned ? ICmpInst::ICMP_SGT : ICmpInst::ICMP_UGT; in evaluateICmpRelation()
1599 return ICmpInst::BAD_ICMP_PREDICATE; in evaluateICmpRelation()
1620 return ICmpInst::BAD_ICMP_PREDICATE; in evaluateICmpRelation()
1633 return ICmpInst::BAD_ICMP_PREDICATE; // Might be equal. in evaluateICmpRelation()
1641 case -1: return isSigned ? ICmpInst::ICMP_SLT:ICmpInst::ICMP_ULT; in evaluateICmpRelation()
1642 case 1: return isSigned ? ICmpInst::ICMP_SGT:ICmpInst::ICMP_UGT; in evaluateICmpRelation()
1643 case -2: return ICmpInst::BAD_ICMP_PREDICATE; in evaluateICmpRelation()
1651 return isSigned ? ICmpInst::ICMP_SGT : ICmpInst::ICMP_UGT; in evaluateICmpRelation()
1653 return ICmpInst::BAD_ICMP_PREDICATE; // Might be equal. in evaluateICmpRelation()
1659 return isSigned ? ICmpInst::ICMP_SLT : ICmpInst::ICMP_ULT; in evaluateICmpRelation()
1661 return ICmpInst::BAD_ICMP_PREDICATE; // Might be equal. in evaluateICmpRelation()
1663 return ICmpInst::ICMP_EQ; in evaluateICmpRelation()
1673 return ICmpInst::BAD_ICMP_PREDICATE; in evaluateICmpRelation()
1695 bool isIntegerPredicate = ICmpInst::isIntPredicate(Predicate); in ConstantFoldCompareInstruction()
1699 if (ICmpInst::isEquality(Predicate) || (isIntegerPredicate && C1 == C2)) in ConstantFoldCompareInstruction()
1717 if (pred == ICmpInst::ICMP_EQ) in ConstantFoldCompareInstruction()
1719 else if (pred == ICmpInst::ICMP_NE) in ConstantFoldCompareInstruction()
1727 if (pred == ICmpInst::ICMP_EQ) in ConstantFoldCompareInstruction()
1729 else if (pred == ICmpInst::ICMP_NE) in ConstantFoldCompareInstruction()
1737 case ICmpInst::ICMP_EQ: in ConstantFoldCompareInstruction()
1741 case ICmpInst::ICMP_NE: in ConstantFoldCompareInstruction()
1753 case ICmpInst::ICMP_EQ: return ConstantInt::get(ResultTy, V1 == V2); in ConstantFoldCompareInstruction()
1754 case ICmpInst::ICMP_NE: return ConstantInt::get(ResultTy, V1 != V2); in ConstantFoldCompareInstruction()
1755 case ICmpInst::ICMP_SLT: return ConstantInt::get(ResultTy, V1.slt(V2)); in ConstantFoldCompareInstruction()
1756 case ICmpInst::ICMP_SGT: return ConstantInt::get(ResultTy, V1.sgt(V2)); in ConstantFoldCompareInstruction()
1757 case ICmpInst::ICMP_SLE: return ConstantInt::get(ResultTy, V1.sle(V2)); in ConstantFoldCompareInstruction()
1758 case ICmpInst::ICMP_SGE: return ConstantInt::get(ResultTy, V1.sge(V2)); in ConstantFoldCompareInstruction()
1759 case ICmpInst::ICMP_ULT: return ConstantInt::get(ResultTy, V1.ult(V2)); in ConstantFoldCompareInstruction()
1760 case ICmpInst::ICMP_UGT: return ConstantInt::get(ResultTy, V1.ugt(V2)); in ConstantFoldCompareInstruction()
1761 case ICmpInst::ICMP_ULE: return ConstantInt::get(ResultTy, V1.ule(V2)); in ConstantFoldCompareInstruction()
1762 case ICmpInst::ICMP_UGE: return ConstantInt::get(ResultTy, V1.uge(V2)); in ConstantFoldCompareInstruction()
1892 case ICmpInst::BAD_ICMP_PREDICATE: in ConstantFoldCompareInstruction()
1894 case ICmpInst::ICMP_EQ: // We know the constants are equal! in ConstantFoldCompareInstruction()
1897 Result = ICmpInst::isTrueWhenEqual((ICmpInst::Predicate)pred); in ConstantFoldCompareInstruction()
1899 case ICmpInst::ICMP_ULT: in ConstantFoldCompareInstruction()
1901 case ICmpInst::ICMP_ULT: case ICmpInst::ICMP_NE: case ICmpInst::ICMP_ULE: in ConstantFoldCompareInstruction()
1903 case ICmpInst::ICMP_UGT: case ICmpInst::ICMP_EQ: case ICmpInst::ICMP_UGE: in ConstantFoldCompareInstruction()
1907 case ICmpInst::ICMP_SLT: in ConstantFoldCompareInstruction()
1909 case ICmpInst::ICMP_SLT: case ICmpInst::ICMP_NE: case ICmpInst::ICMP_SLE: in ConstantFoldCompareInstruction()
1911 case ICmpInst::ICMP_SGT: case ICmpInst::ICMP_EQ: case ICmpInst::ICMP_SGE: in ConstantFoldCompareInstruction()
1915 case ICmpInst::ICMP_UGT: in ConstantFoldCompareInstruction()
1917 case ICmpInst::ICMP_UGT: case ICmpInst::ICMP_NE: case ICmpInst::ICMP_UGE: in ConstantFoldCompareInstruction()
1919 case ICmpInst::ICMP_ULT: case ICmpInst::ICMP_EQ: case ICmpInst::ICMP_ULE: in ConstantFoldCompareInstruction()
1923 case ICmpInst::ICMP_SGT: in ConstantFoldCompareInstruction()
1925 case ICmpInst::ICMP_SGT: case ICmpInst::ICMP_NE: case ICmpInst::ICMP_SGE: in ConstantFoldCompareInstruction()
1927 case ICmpInst::ICMP_SLT: case ICmpInst::ICMP_EQ: case ICmpInst::ICMP_SLE: in ConstantFoldCompareInstruction()
1931 case ICmpInst::ICMP_ULE: in ConstantFoldCompareInstruction()
1932 if (pred == ICmpInst::ICMP_UGT) Result = 0; in ConstantFoldCompareInstruction()
1933 if (pred == ICmpInst::ICMP_ULT || pred == ICmpInst::ICMP_ULE) Result = 1; in ConstantFoldCompareInstruction()
1935 case ICmpInst::ICMP_SLE: in ConstantFoldCompareInstruction()
1936 if (pred == ICmpInst::ICMP_SGT) Result = 0; in ConstantFoldCompareInstruction()
1937 if (pred == ICmpInst::ICMP_SLT || pred == ICmpInst::ICMP_SLE) Result = 1; in ConstantFoldCompareInstruction()
1939 case ICmpInst::ICMP_UGE: in ConstantFoldCompareInstruction()
1940 if (pred == ICmpInst::ICMP_ULT) Result = 0; in ConstantFoldCompareInstruction()
1941 if (pred == ICmpInst::ICMP_UGT || pred == ICmpInst::ICMP_UGE) Result = 1; in ConstantFoldCompareInstruction()
1943 case ICmpInst::ICMP_SGE: in ConstantFoldCompareInstruction()
1944 if (pred == ICmpInst::ICMP_SLT) Result = 0; in ConstantFoldCompareInstruction()
1945 if (pred == ICmpInst::ICMP_SGT || pred == ICmpInst::ICMP_SGE) Result = 1; in ConstantFoldCompareInstruction()
1947 case ICmpInst::ICMP_NE: in ConstantFoldCompareInstruction()
1948 if (pred == ICmpInst::ICMP_EQ) Result = 0; in ConstantFoldCompareInstruction()
1949 if (pred == ICmpInst::ICMP_NE) Result = 1; in ConstantFoldCompareInstruction()
1972 ICmpInst::isSigned((ICmpInst::Predicate)pred)) || in ConstantFoldCompareInstruction()
1974 !ICmpInst::isSigned((ICmpInst::Predicate)pred))){ in ConstantFoldCompareInstruction()
1992 pred = ICmpInst::getSwappedPredicate((ICmpInst::Predicate)pred); in ConstantFoldCompareInstruction()