Lines Matching refs:Other

226                                           const ConstantRange &Other,
237 unsigned BitWidth = Other.getBitWidth();
246 -Other.getUnsignedMax());
249 APInt SMin = Other.getSignedMin(), SMax = Other.getSignedMax();
257 return getNonEmpty(Other.getUnsignedMax(), APInt::getMinValue(BitWidth));
260 APInt SMin = Other.getSignedMin(), SMax = Other.getSignedMax();
268 return makeExactMulNUWRegion(Other.getUnsignedMax());
270 return makeExactMulNSWRegion(Other.getSignedMin())
271 .intersectWith(makeExactMulNSWRegion(Other.getSignedMax()));
276 ConstantRange ShAmt = Other.intersectWith(
297 const APInt &Other,
301 return makeGuaranteedNoWrapRegion(BinOp, ConstantRange(Other), NoWrapKind);
329 ConstantRange::isSizeStrictlySmallerThan(const ConstantRange &Other) const {
330 assert(getBitWidth() == Other.getBitWidth());
333 if (Other.isFullSet())
335 return (Upper - Lower).ult(Other.Upper - Other.Lower);
397 bool ConstantRange::contains(const ConstantRange &Other) const {
398 if (isFullSet() || Other.isEmptySet()) return true;
399 if (isEmptySet() || Other.isFullSet()) return false;
402 if (Other.isUpperWrapped())
405 return Lower.ule(Other.getLower()) && Other.getUpper().ule(Upper);
408 if (!Other.isUpperWrapped())
409 return Other.getUpper().ule(Upper) ||
410 Lower.ule(Other.getLower());
412 return Other.getUpper().ule(Upper) && Lower.ule(Other.getLower());
777 const ConstantRange &Other) const {
782 return add(Other);
784 return sub(Other);
786 return multiply(Other);
788 return udiv(Other);
790 return sdiv(Other);
792 return urem(Other);
794 return srem(Other);
796 return shl(Other);
798 return lshr(Other);
800 return ashr(Other);
802 return binaryAnd(Other);
804 return binaryOr(Other);
808 return add(Other);
810 return sub(Other);
812 return multiply(Other);
820 const ConstantRange &Other,
826 return addWithNoWrap(Other, NoWrapKind);
828 return subWithNoWrap(Other, NoWrapKind);
832 return binaryOp(BinOp, Other);
837 ConstantRange::add(const ConstantRange &Other) const {
838 if (isEmptySet() || Other.isEmptySet())
840 if (isFullSet() || Other.isFullSet())
843 APInt NewLower = getLower() + Other.getLower();
844 APInt NewUpper = getUpper() + Other.getUpper() - 1;
850 X.isSizeStrictlySmallerThan(Other))
856 ConstantRange ConstantRange::addWithNoWrap(const ConstantRange &Other,
860 // (X is from this, and Y is from Other)
861 if (isEmptySet() || Other.isEmptySet())
863 if (isFullSet() && Other.isFullSet())
867 ConstantRange Result = add(Other);
875 Result = Result.intersectWith(sadd_sat(Other), RangeType);
878 Result = Result.intersectWith(uadd_sat(Other), RangeType);
884 ConstantRange::sub(const ConstantRange &Other) const {
885 if (isEmptySet() || Other.isEmptySet())
887 if (isFullSet() || Other.isFullSet())
890 APInt NewLower = getLower() - Other.getUpper() + 1;
891 APInt NewUpper = getUpper() - Other.getLower();
897 X.isSizeStrictlySmallerThan(Other))
903 ConstantRange ConstantRange::subWithNoWrap(const ConstantRange &Other,
907 // (X is from this, and Y is from Other)
908 if (isEmptySet() || Other.isEmptySet())
910 if (isFullSet() && Other.isFullSet())
914 ConstantRange Result = sub(Other);
922 Result = Result.intersectWith(ssub_sat(Other), RangeType);
925 if (getUnsignedMax().ult(Other.getUnsignedMin()))
927 Result = Result.intersectWith(usub_sat(Other), RangeType);
934 ConstantRange::multiply(const ConstantRange &Other) const {
940 if (isEmptySet() || Other.isEmptySet())
952 APInt Other_min = Other.getUnsignedMin().zext(getBitWidth() * 2);
953 APInt Other_max = Other.getUnsignedMax().zext(getBitWidth() * 2);
975 Other_min = Other.getSignedMin().sext(getBitWidth() * 2);
976 Other_max = Other.getSignedMax().sext(getBitWidth() * 2);
988 ConstantRange::smax(const ConstantRange &Other) const {
991 if (isEmptySet() || Other.isEmptySet())
993 APInt NewL = APIntOps::smax(getSignedMin(), Other.getSignedMin());
994 APInt NewU = APIntOps::smax(getSignedMax(), Other.getSignedMax()) + 1;
999 ConstantRange::umax(const ConstantRange &Other) const {
1002 if (isEmptySet() || Other.isEmptySet())
1004 APInt NewL = APIntOps::umax(getUnsignedMin(), Other.getUnsignedMin());
1005 APInt NewU = APIntOps::umax(getUnsignedMax(), Other.getUnsignedMax()) + 1;
1010 ConstantRange::smin(const ConstantRange &Other) const {
1013 if (isEmptySet() || Other.isEmptySet())
1015 APInt NewL = APIntOps::smin(getSignedMin(), Other.getSignedMin());
1016 APInt NewU = APIntOps::smin(getSignedMax(), Other.getSignedMax()) + 1;
1021 ConstantRange::umin(const ConstantRange &Other) const {
1024 if (isEmptySet() || Other.isEmptySet())
1026 APInt NewL = APIntOps::umin(getUnsignedMin(), Other.getUnsignedMin());
1027 APInt NewU = APIntOps::umin(getUnsignedMax(), Other.getUnsignedMax()) + 1;
1193 ConstantRange::binaryAnd(const ConstantRange &Other) const {
1194 if (isEmptySet() || Other.isEmptySet())
1199 APInt umin = APIntOps::umin(Other.getUnsignedMax(), getUnsignedMax());
1204 ConstantRange::binaryOr(const ConstantRange &Other) const {
1205 if (isEmptySet() || Other.isEmptySet())
1210 APInt umax = APIntOps::umax(getUnsignedMin(), Other.getUnsignedMin());
1215 ConstantRange::shl(const ConstantRange &Other) const {
1216 if (isEmptySet() || Other.isEmptySet())
1220 APInt Other_umax = Other.getUnsignedMax();
1233 min <<= Other.getUnsignedMin();
1240 ConstantRange::lshr(const ConstantRange &Other) const {
1241 if (isEmptySet() || Other.isEmptySet())
1244 APInt max = getUnsignedMax().lshr(Other.getUnsignedMin()) + 1;
1245 APInt min = getUnsignedMin().lshr(Other.getUnsignedMax());
1250 ConstantRange::ashr(const ConstantRange &Other) const {
1251 if (isEmptySet() || Other.isEmptySet())
1259 // the minimum value of 'Other' instead of the maximum value.
1260 APInt PosMax = getSignedMax().ashr(Other.getUnsignedMin()) + 1;
1266 // maximum value of 'Other'.
1267 APInt PosMin = getSignedMin().ashr(Other.getUnsignedMax());
1273 // maximum value of 'Other'.
1274 APInt NegMax = getSignedMax().ashr(Other.getUnsignedMax()) + 1;
1280 // minimum value of 'Other'.
1281 APInt NegMin = getSignedMin().ashr(Other.getUnsignedMin());
1300 ConstantRange ConstantRange::uadd_sat(const ConstantRange &Other) const {
1301 if (isEmptySet() || Other.isEmptySet())
1304 APInt NewL = getUnsignedMin().uadd_sat(Other.getUnsignedMin());
1305 APInt NewU = getUnsignedMax().uadd_sat(Other.getUnsignedMax()) + 1;
1309 ConstantRange ConstantRange::sadd_sat(const ConstantRange &Other) const {
1310 if (isEmptySet() || Other.isEmptySet())
1313 APInt NewL = getSignedMin().sadd_sat(Other.getSignedMin());
1314 APInt NewU = getSignedMax().sadd_sat(Other.getSignedMax()) + 1;
1318 ConstantRange ConstantRange::usub_sat(const ConstantRange &Other) const {
1319 if (isEmptySet() || Other.isEmptySet())
1322 APInt NewL = getUnsignedMin().usub_sat(Other.getUnsignedMax());
1323 APInt NewU = getUnsignedMax().usub_sat(Other.getUnsignedMin()) + 1;
1327 ConstantRange ConstantRange::ssub_sat(const ConstantRange &Other) const {
1328 if (isEmptySet() || Other.isEmptySet())
1331 APInt NewL = getSignedMin().ssub_sat(Other.getSignedMax());
1332 APInt NewU = getSignedMax().ssub_sat(Other.getSignedMin()) + 1;
1336 ConstantRange ConstantRange::umul_sat(const ConstantRange &Other) const {
1337 if (isEmptySet() || Other.isEmptySet())
1340 APInt NewL = getUnsignedMin().umul_sat(Other.getUnsignedMin());
1341 APInt NewU = getUnsignedMax().umul_sat(Other.getUnsignedMax()) + 1;
1345 ConstantRange ConstantRange::smul_sat(const ConstantRange &Other) const {
1346 if (isEmptySet() || Other.isEmptySet())
1357 APInt Other_min = Other.getSignedMin().sext(getBitWidth() * 2);
1358 APInt Other_max = Other.getSignedMax().sext(getBitWidth() * 2);
1371 ConstantRange ConstantRange::ushl_sat(const ConstantRange &Other) const {
1372 if (isEmptySet() || Other.isEmptySet())
1375 APInt NewL = getUnsignedMin().ushl_sat(Other.getUnsignedMin());
1376 APInt NewU = getUnsignedMax().ushl_sat(Other.getUnsignedMax()) + 1;
1380 ConstantRange ConstantRange::sshl_sat(const ConstantRange &Other) const {
1381 if (isEmptySet() || Other.isEmptySet())
1385 APInt ShAmtMin = Other.getUnsignedMin(), ShAmtMax = Other.getUnsignedMax();
1431 const ConstantRange &Other) const {
1432 if (isEmptySet() || Other.isEmptySet())
1436 APInt OtherMin = Other.getUnsignedMin(), OtherMax = Other.getUnsignedMax();
1447 const ConstantRange &Other) const {
1448 if (isEmptySet() || Other.isEmptySet())
1452 APInt OtherMin = Other.getSignedMin(), OtherMax = Other.getSignedMax();
1477 const ConstantRange &Other) const {
1478 if (isEmptySet() || Other.isEmptySet())
1482 APInt OtherMin = Other.getUnsignedMin(), OtherMax = Other.getUnsignedMax();
1493 const ConstantRange &Other) const {
1494 if (isEmptySet() || Other.isEmptySet())
1498 APInt OtherMin = Other.getSignedMin(), OtherMax = Other.getSignedMax();
1523 const ConstantRange &Other) const {
1524 if (isEmptySet() || Other.isEmptySet())
1528 APInt OtherMin = Other.getUnsignedMin(), OtherMax = Other.getUnsignedMax();