Lines Matching full:other
14 // ranges (other integral ranges use min/max values for special range values):
243 const ConstantRange &Other) const { in icmp()
244 if (isEmptySet() || Other.isEmptySet()) in icmp()
250 if (const APInt *R = Other.getSingleElement()) in icmp()
254 return inverse().contains(Other); in icmp()
256 return getUnsignedMax().ult(Other.getUnsignedMin()); in icmp()
258 return getUnsignedMax().ule(Other.getUnsignedMin()); in icmp()
260 return getUnsignedMin().ugt(Other.getUnsignedMax()); in icmp()
262 return getUnsignedMin().uge(Other.getUnsignedMax()); in icmp()
264 return getSignedMax().slt(Other.getSignedMin()); in icmp()
266 return getSignedMax().sle(Other.getSignedMin()); in icmp()
268 return getSignedMin().sgt(Other.getSignedMax()); in icmp()
270 return getSignedMin().sge(Other.getSignedMax()); in icmp()
315 const ConstantRange &Other, in makeGuaranteedNoWrapRegion() argument
326 unsigned BitWidth = Other.getBitWidth(); in makeGuaranteedNoWrapRegion()
334 return getNonEmpty(APInt::getZero(BitWidth), -Other.getUnsignedMax()); in makeGuaranteedNoWrapRegion()
337 APInt SMin = Other.getSignedMin(), SMax = Other.getSignedMax(); in makeGuaranteedNoWrapRegion()
345 return getNonEmpty(Other.getUnsignedMax(), APInt::getMinValue(BitWidth)); in makeGuaranteedNoWrapRegion()
348 APInt SMin = Other.getSignedMin(), SMax = Other.getSignedMax(); in makeGuaranteedNoWrapRegion()
356 return makeExactMulNUWRegion(Other.getUnsignedMax()); in makeGuaranteedNoWrapRegion()
359 if (const APInt *C = Other.getSingleElement()) in makeGuaranteedNoWrapRegion()
362 return makeExactMulNSWRegion(Other.getSignedMin()) in makeGuaranteedNoWrapRegion()
363 .intersectWith(makeExactMulNSWRegion(Other.getSignedMax())); in makeGuaranteedNoWrapRegion()
368 ConstantRange ShAmt = Other.intersectWith( in makeGuaranteedNoWrapRegion()
389 const APInt &Other, in makeExactNoWrapRegion() argument
393 return makeGuaranteedNoWrapRegion(BinOp, ConstantRange(Other), NoWrapKind); in makeExactNoWrapRegion()
438 ConstantRange::isSizeStrictlySmallerThan(const ConstantRange &Other) const { in isSizeStrictlySmallerThan()
439 assert(getBitWidth() == Other.getBitWidth()); in isSizeStrictlySmallerThan()
442 if (Other.isFullSet()) in isSizeStrictlySmallerThan()
444 return (Upper - Lower).ult(Other.Upper - Other.Lower); in isSizeStrictlySmallerThan()
515 bool ConstantRange::contains(const ConstantRange &Other) const { in contains()
516 if (isFullSet() || Other.isEmptySet()) return true; in contains()
517 if (isEmptySet() || Other.isFullSet()) return false; in contains()
520 if (Other.isUpperWrapped()) in contains()
523 return Lower.ule(Other.getLower()) && Other.getUpper().ule(Upper); in contains()
526 if (!Other.isUpperWrapped()) in contains()
527 return Other.getUpper().ule(Upper) || in contains()
528 Lower.ule(Other.getLower()); in contains()
530 return Other.getUpper().ule(Upper) && Lower.ule(Other.getLower()); in contains()
935 const ConstantRange &Other) const { in binaryOp()
940 return add(Other); in binaryOp()
942 return sub(Other); in binaryOp()
944 return multiply(Other); in binaryOp()
946 return udiv(Other); in binaryOp()
948 return sdiv(Other); in binaryOp()
950 return urem(Other); in binaryOp()
952 return srem(Other); in binaryOp()
954 return shl(Other); in binaryOp()
956 return lshr(Other); in binaryOp()
958 return ashr(Other); in binaryOp()
960 return binaryAnd(Other); in binaryOp()
962 return binaryOr(Other); in binaryOp()
964 return binaryXor(Other); in binaryOp()
968 return add(Other); in binaryOp()
970 return sub(Other); in binaryOp()
972 return multiply(Other); in binaryOp()
980 const ConstantRange &Other, in overflowingBinaryOp() argument
986 return addWithNoWrap(Other, NoWrapKind); in overflowingBinaryOp()
988 return subWithNoWrap(Other, NoWrapKind); in overflowingBinaryOp()
990 return multiplyWithNoWrap(Other, NoWrapKind); in overflowingBinaryOp()
994 return binaryOp(BinOp, Other); in overflowingBinaryOp()
1064 ConstantRange::add(const ConstantRange &Other) const { in add()
1065 if (isEmptySet() || Other.isEmptySet()) in add()
1067 if (isFullSet() || Other.isFullSet()) in add()
1070 APInt NewLower = getLower() + Other.getLower(); in add()
1071 APInt NewUpper = getUpper() + Other.getUpper() - 1; in add()
1077 X.isSizeStrictlySmallerThan(Other)) in add()
1083 ConstantRange ConstantRange::addWithNoWrap(const ConstantRange &Other, in addWithNoWrap() argument
1087 // (X is from this, and Y is from Other) in addWithNoWrap()
1088 if (isEmptySet() || Other.isEmptySet()) in addWithNoWrap()
1090 if (isFullSet() && Other.isFullSet()) in addWithNoWrap()
1094 ConstantRange Result = add(Other); in addWithNoWrap()
1102 Result = Result.intersectWith(sadd_sat(Other), RangeType); in addWithNoWrap()
1105 Result = Result.intersectWith(uadd_sat(Other), RangeType); in addWithNoWrap()
1111 ConstantRange::sub(const ConstantRange &Other) const { in sub()
1112 if (isEmptySet() || Other.isEmptySet()) in sub()
1114 if (isFullSet() || Other.isFullSet()) in sub()
1117 APInt NewLower = getLower() - Other.getUpper() + 1; in sub()
1118 APInt NewUpper = getUpper() - Other.getLower(); in sub()
1124 X.isSizeStrictlySmallerThan(Other)) in sub()
1130 ConstantRange ConstantRange::subWithNoWrap(const ConstantRange &Other, in subWithNoWrap() argument
1134 // (X is from this, and Y is from Other) in subWithNoWrap()
1135 if (isEmptySet() || Other.isEmptySet()) in subWithNoWrap()
1137 if (isFullSet() && Other.isFullSet()) in subWithNoWrap()
1141 ConstantRange Result = sub(Other); in subWithNoWrap()
1149 Result = Result.intersectWith(ssub_sat(Other), RangeType); in subWithNoWrap()
1152 if (getUnsignedMax().ult(Other.getUnsignedMin())) in subWithNoWrap()
1154 Result = Result.intersectWith(usub_sat(Other), RangeType); in subWithNoWrap()
1161 ConstantRange::multiply(const ConstantRange &Other) const { in multiply()
1167 if (isEmptySet() || Other.isEmptySet()) in multiply()
1172 return Other; in multiply()
1174 return ConstantRange(APInt::getZero(getBitWidth())).sub(Other); in multiply()
1177 if (const APInt *C = Other.getSingleElement()) { in multiply()
1187 // other. We calculate two ranges; one treating the inputs as unsigned in multiply()
1188 // and the other signed, then return the smallest of these ranges. in multiply()
1193 APInt Other_min = Other.getUnsignedMin().zext(getBitWidth() * 2); in multiply()
1194 APInt Other_max = Other.getUnsignedMax().zext(getBitWidth() * 2); in multiply()
1216 Other_min = Other.getSignedMin().sext(getBitWidth() * 2); in multiply()
1217 Other_max = Other.getSignedMax().sext(getBitWidth() * 2); in multiply()
1229 ConstantRange::multiplyWithNoWrap(const ConstantRange &Other, in multiplyWithNoWrap() argument
1232 if (isEmptySet() || Other.isEmptySet()) in multiplyWithNoWrap()
1234 if (isFullSet() && Other.isFullSet()) in multiplyWithNoWrap()
1237 ConstantRange Result = multiply(Other); in multiplyWithNoWrap()
1240 Result = Result.intersectWith(smul_sat(Other), RangeType); in multiplyWithNoWrap()
1243 Result = Result.intersectWith(umul_sat(Other), RangeType); in multiplyWithNoWrap()
1248 ConstantRange ConstantRange::smul_fast(const ConstantRange &Other) const { in smul_fast()
1249 if (isEmptySet() || Other.isEmptySet()) in smul_fast()
1254 APInt OtherMin = Other.getSignedMin(); in smul_fast()
1255 APInt OtherMax = Other.getSignedMax(); in smul_fast()
1268 ConstantRange::smax(const ConstantRange &Other) const { in smax()
1271 if (isEmptySet() || Other.isEmptySet()) in smax()
1273 APInt NewL = APIntOps::smax(getSignedMin(), Other.getSignedMin()); in smax()
1274 APInt NewU = APIntOps::smax(getSignedMax(), Other.getSignedMax()) + 1; in smax()
1276 if (isSignWrappedSet() || Other.isSignWrappedSet()) in smax()
1277 return Res.intersectWith(unionWith(Other, Signed), Signed); in smax()
1282 ConstantRange::umax(const ConstantRange &Other) const { in umax()
1285 if (isEmptySet() || Other.isEmptySet()) in umax()
1287 APInt NewL = APIntOps::umax(getUnsignedMin(), Other.getUnsignedMin()); in umax()
1288 APInt NewU = APIntOps::umax(getUnsignedMax(), Other.getUnsignedMax()) + 1; in umax()
1290 if (isWrappedSet() || Other.isWrappedSet()) in umax()
1291 return Res.intersectWith(unionWith(Other, Unsigned), Unsigned); in umax()
1296 ConstantRange::smin(const ConstantRange &Other) const { in smin()
1299 if (isEmptySet() || Other.isEmptySet()) in smin()
1301 APInt NewL = APIntOps::smin(getSignedMin(), Other.getSignedMin()); in smin()
1302 APInt NewU = APIntOps::smin(getSignedMax(), Other.getSignedMax()) + 1; in smin()
1304 if (isSignWrappedSet() || Other.isSignWrappedSet()) in smin()
1305 return Res.intersectWith(unionWith(Other, Signed), Signed); in smin()
1310 ConstantRange::umin(const ConstantRange &Other) const { in umin()
1313 if (isEmptySet() || Other.isEmptySet()) in umin()
1315 APInt NewL = APIntOps::umin(getUnsignedMin(), Other.getUnsignedMin()); in umin()
1316 APInt NewU = APIntOps::umin(getUnsignedMax(), Other.getUnsignedMax()) + 1; in umin()
1318 if (isWrappedSet() || Other.isWrappedSet()) in umin()
1319 return Res.intersectWith(unionWith(Other, Unsigned), Unsigned); in umin()
1509 ConstantRange ConstantRange::binaryAnd(const ConstantRange &Other) const { in binaryAnd()
1510 if (isEmptySet() || Other.isEmptySet()) in binaryAnd()
1514 fromKnownBits(toKnownBits() & Other.toKnownBits(), false); in binaryAnd()
1517 APIntOps::umin(Other.getUnsignedMax(), getUnsignedMax()) + 1); in binaryAnd()
1521 ConstantRange ConstantRange::binaryOr(const ConstantRange &Other) const { in binaryOr()
1522 if (isEmptySet() || Other.isEmptySet()) in binaryOr()
1526 fromKnownBits(toKnownBits() | Other.toKnownBits(), false); in binaryOr()
1529 getNonEmpty(APIntOps::umax(getUnsignedMin(), Other.getUnsignedMin()), in binaryOr()
1534 ConstantRange ConstantRange::binaryXor(const ConstantRange &Other) const { in binaryXor()
1535 if (isEmptySet() || Other.isEmptySet()) in binaryXor()
1539 if (isSingleElement() && Other.isSingleElement()) in binaryXor()
1540 return {*getSingleElement() ^ *Other.getSingleElement()}; in binaryXor()
1543 if (Other.isSingleElement() && Other.getSingleElement()->isAllOnes()) in binaryXor()
1546 return Other.binaryNot(); in binaryXor()
1549 KnownBits RHSKnown = Other.toKnownBits(); in binaryXor()
1560 CR = CR.intersectWith(Other.sub(*this), PreferredRangeType::Unsigned); in binaryXor()
1562 CR = CR.intersectWith(this->sub(Other), PreferredRangeType::Unsigned); in binaryXor()
1567 ConstantRange::shl(const ConstantRange &Other) const { in shl()
1568 if (isEmptySet() || Other.isEmptySet()) in shl()
1573 if (const APInt *RHS = Other.getSingleElement()) { in shl()
1586 APInt OtherMax = Other.getUnsignedMax(); in shl()
1590 Max <<= Other.getUnsignedMin(); in shl()
1599 // FIXME: implement the other tricky cases in shl()
1601 Min <<= Other.getUnsignedMin(); in shl()
1608 ConstantRange::lshr(const ConstantRange &Other) const { in lshr()
1609 if (isEmptySet() || Other.isEmptySet()) in lshr()
1612 APInt max = getUnsignedMax().lshr(Other.getUnsignedMin()) + 1; in lshr()
1613 APInt min = getUnsignedMin().lshr(Other.getUnsignedMax()); in lshr()
1618 ConstantRange::ashr(const ConstantRange &Other) const { in ashr()
1619 if (isEmptySet() || Other.isEmptySet()) in ashr()
1627 // the minimum value of 'Other' instead of the maximum value. in ashr()
1628 APInt PosMax = getSignedMax().ashr(Other.getUnsignedMin()) + 1; in ashr()
1634 // maximum value of 'Other'. in ashr()
1635 APInt PosMin = getSignedMin().ashr(Other.getUnsignedMax()); in ashr()
1641 // maximum value of 'Other'. in ashr()
1642 APInt NegMax = getSignedMax().ashr(Other.getUnsignedMax()) + 1; in ashr()
1648 // minimum value of 'Other'. in ashr()
1649 APInt NegMin = getSignedMin().ashr(Other.getUnsignedMin()); in ashr()
1668 ConstantRange ConstantRange::uadd_sat(const ConstantRange &Other) const { in uadd_sat()
1669 if (isEmptySet() || Other.isEmptySet()) in uadd_sat()
1672 APInt NewL = getUnsignedMin().uadd_sat(Other.getUnsignedMin()); in uadd_sat()
1673 APInt NewU = getUnsignedMax().uadd_sat(Other.getUnsignedMax()) + 1; in uadd_sat()
1677 ConstantRange ConstantRange::sadd_sat(const ConstantRange &Other) const { in sadd_sat()
1678 if (isEmptySet() || Other.isEmptySet()) in sadd_sat()
1681 APInt NewL = getSignedMin().sadd_sat(Other.getSignedMin()); in sadd_sat()
1682 APInt NewU = getSignedMax().sadd_sat(Other.getSignedMax()) + 1; in sadd_sat()
1686 ConstantRange ConstantRange::usub_sat(const ConstantRange &Other) const { in usub_sat()
1687 if (isEmptySet() || Other.isEmptySet()) in usub_sat()
1690 APInt NewL = getUnsignedMin().usub_sat(Other.getUnsignedMax()); in usub_sat()
1691 APInt NewU = getUnsignedMax().usub_sat(Other.getUnsignedMin()) + 1; in usub_sat()
1695 ConstantRange ConstantRange::ssub_sat(const ConstantRange &Other) const { in ssub_sat()
1696 if (isEmptySet() || Other.isEmptySet()) in ssub_sat()
1699 APInt NewL = getSignedMin().ssub_sat(Other.getSignedMax()); in ssub_sat()
1700 APInt NewU = getSignedMax().ssub_sat(Other.getSignedMin()) + 1; in ssub_sat()
1704 ConstantRange ConstantRange::umul_sat(const ConstantRange &Other) const { in umul_sat()
1705 if (isEmptySet() || Other.isEmptySet()) in umul_sat()
1708 APInt NewL = getUnsignedMin().umul_sat(Other.getUnsignedMin()); in umul_sat()
1709 APInt NewU = getUnsignedMax().umul_sat(Other.getUnsignedMax()) + 1; in umul_sat()
1713 ConstantRange ConstantRange::smul_sat(const ConstantRange &Other) const { in smul_sat()
1714 if (isEmptySet() || Other.isEmptySet()) in smul_sat()
1725 APInt OtherMin = Other.getSignedMin(); in smul_sat()
1726 APInt OtherMax = Other.getSignedMax(); in smul_sat()
1734 ConstantRange ConstantRange::ushl_sat(const ConstantRange &Other) const { in ushl_sat()
1735 if (isEmptySet() || Other.isEmptySet()) in ushl_sat()
1738 APInt NewL = getUnsignedMin().ushl_sat(Other.getUnsignedMin()); in ushl_sat()
1739 APInt NewU = getUnsignedMax().ushl_sat(Other.getUnsignedMax()) + 1; in ushl_sat()
1743 ConstantRange ConstantRange::sshl_sat(const ConstantRange &Other) const { in sshl_sat()
1744 if (isEmptySet() || Other.isEmptySet()) in sshl_sat()
1748 APInt ShAmtMin = Other.getUnsignedMin(), ShAmtMax = Other.getUnsignedMax(); in sshl_sat()
1957 const ConstantRange &Other) const { in unsignedAddMayOverflow()
1958 if (isEmptySet() || Other.isEmptySet()) in unsignedAddMayOverflow()
1962 APInt OtherMin = Other.getUnsignedMin(), OtherMax = Other.getUnsignedMax(); in unsignedAddMayOverflow()
1973 const ConstantRange &Other) const { in signedAddMayOverflow()
1974 if (isEmptySet() || Other.isEmptySet()) in signedAddMayOverflow()
1978 APInt OtherMin = Other.getSignedMin(), OtherMax = Other.getSignedMax(); in signedAddMayOverflow()
2003 const ConstantRange &Other) const { in unsignedSubMayOverflow()
2004 if (isEmptySet() || Other.isEmptySet()) in unsignedSubMayOverflow()
2008 APInt OtherMin = Other.getUnsignedMin(), OtherMax = Other.getUnsignedMax(); in unsignedSubMayOverflow()
2019 const ConstantRange &Other) const { in signedSubMayOverflow()
2020 if (isEmptySet() || Other.isEmptySet()) in signedSubMayOverflow()
2024 APInt OtherMin = Other.getSignedMin(), OtherMax = Other.getSignedMax(); in signedSubMayOverflow()
2049 const ConstantRange &Other) const { in unsignedMulMayOverflow()
2050 if (isEmptySet() || Other.isEmptySet()) in unsignedMulMayOverflow()
2054 APInt OtherMin = Other.getUnsignedMin(), OtherMax = Other.getUnsignedMax(); in unsignedMulMayOverflow()