Skip to content

Commit 5aacc7a

Browse files
committed
Revert "[ConstantRange] Rename make{Guaranteed -> Exact}NoWrapRegion() NFC"
This reverts commit 7bf4d7c07f2fac862ef34c82ad0fef6513452445. After thinking about this more, this isn't right, the range is not exact in the same sense as makeExactICmpRegion(). This needs a separate function. llvm-svn: 358876
1 parent 5299e25 commit 5aacc7a

File tree

6 files changed

+66
-65
lines changed

6 files changed

+66
-65
lines changed

llvm/include/llvm/IR/ConstantRange.h

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -131,16 +131,16 @@ class LLVM_NODISCARD ConstantRange {
131131
///
132132
/// Examples:
133133
/// typedef OverflowingBinaryOperator OBO;
134-
/// #define MENR makeExactNoWrapRegion
135-
/// MENR(Add, [i8 1, 2), OBO::NoSignedWrap) == [-128, 127)
136-
/// MENR(Add, [i8 1, 2), OBO::NoUnsignedWrap) == [0, -1)
137-
/// MENR(Add, [i8 0, 1), OBO::NoUnsignedWrap) == Full Set
138-
/// MENR(Add, [i8 -1, 6), OBO::NoSignedWrap) == [INT_MIN+1, INT_MAX-4)
139-
/// MENR(Sub, [i8 1, 2), OBO::NoSignedWrap) == [-127, 128)
140-
/// MENR(Sub, [i8 1, 2), OBO::NoUnsignedWrap) == [1, 0)
141-
static ConstantRange makeExactNoWrapRegion(Instruction::BinaryOps BinOp,
142-
const ConstantRange &Other,
143-
unsigned NoWrapKind);
134+
/// #define MGNR makeGuaranteedNoWrapRegion
135+
/// MGNR(Add, [i8 1, 2), OBO::NoSignedWrap) == [-128, 127)
136+
/// MGNR(Add, [i8 1, 2), OBO::NoUnsignedWrap) == [0, -1)
137+
/// MGNR(Add, [i8 0, 1), OBO::NoUnsignedWrap) == Full Set
138+
/// MGNR(Add, [i8 -1, 6), OBO::NoSignedWrap) == [INT_MIN+1, INT_MAX-4)
139+
/// MGNR(Sub, [i8 1, 2), OBO::NoSignedWrap) == [-127, 128)
140+
/// MGNR(Sub, [i8 1, 2), OBO::NoUnsignedWrap) == [1, 0)
141+
static ConstantRange makeGuaranteedNoWrapRegion(Instruction::BinaryOps BinOp,
142+
const ConstantRange &Other,
143+
unsigned NoWrapKind);
144144

145145
/// Set up \p Pred and \p RHS such that
146146
/// ConstantRange::makeExactICmpRegion(Pred, RHS) == *this. Return true if

llvm/lib/Analysis/LazyValueInfo.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1146,7 +1146,7 @@ static ValueLatticeElement getValueFromOverflowCondition(
11461146
return ValueLatticeElement::getOverdefined();
11471147

11481148
// Calculate the possible values of %x for which no overflow occurs.
1149-
ConstantRange NWR = ConstantRange::makeExactNoWrapRegion(
1149+
ConstantRange NWR = ConstantRange::makeGuaranteedNoWrapRegion(
11501150
WO->getBinaryOp(), ConstantRange(*C), WO->getNoWrapKind());
11511151

11521152
// If overflow is false, %x is constrained to NWR. If overflow is true, %x is

llvm/lib/Analysis/ScalarEvolution.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2363,15 +2363,15 @@ StrengthenNoWrapFlags(ScalarEvolution *SE, SCEVTypes Type,
23632363

23642364
// (A <opcode> C) --> (A <opcode> C)<nsw> if the op doesn't sign overflow.
23652365
if (!(SignOrUnsignWrap & SCEV::FlagNSW)) {
2366-
auto NSWRegion = ConstantRange::makeExactNoWrapRegion(
2366+
auto NSWRegion = ConstantRange::makeGuaranteedNoWrapRegion(
23672367
Opcode, C, OBO::NoSignedWrap);
23682368
if (NSWRegion.contains(SE->getSignedRange(Ops[1])))
23692369
Flags = ScalarEvolution::setFlags(Flags, SCEV::FlagNSW);
23702370
}
23712371

23722372
// (A <opcode> C) --> (A <opcode> C)<nuw> if the op doesn't unsign overflow.
23732373
if (!(SignOrUnsignWrap & SCEV::FlagNUW)) {
2374-
auto NUWRegion = ConstantRange::makeExactNoWrapRegion(
2374+
auto NUWRegion = ConstantRange::makeGuaranteedNoWrapRegion(
23752375
Opcode, C, OBO::NoUnsignedWrap);
23762376
if (NUWRegion.contains(SE->getUnsignedRange(Ops[1])))
23772377
Flags = ScalarEvolution::setFlags(Flags, SCEV::FlagNUW);
@@ -4471,7 +4471,7 @@ ScalarEvolution::proveNoWrapViaConstantRanges(const SCEVAddRecExpr *AR) {
44714471
ConstantRange AddRecRange = getSignedRange(AR);
44724472
ConstantRange IncRange = getSignedRange(AR->getStepRecurrence(*this));
44734473

4474-
auto NSWRegion = ConstantRange::makeExactNoWrapRegion(
4474+
auto NSWRegion = ConstantRange::makeGuaranteedNoWrapRegion(
44754475
Instruction::Add, IncRange, OBO::NoSignedWrap);
44764476
if (NSWRegion.contains(AddRecRange))
44774477
Result = ScalarEvolution::setFlags(Result, SCEV::FlagNSW);
@@ -4481,7 +4481,7 @@ ScalarEvolution::proveNoWrapViaConstantRanges(const SCEVAddRecExpr *AR) {
44814481
ConstantRange AddRecRange = getUnsignedRange(AR);
44824482
ConstantRange IncRange = getUnsignedRange(AR->getStepRecurrence(*this));
44834483

4484-
auto NUWRegion = ConstantRange::makeExactNoWrapRegion(
4484+
auto NUWRegion = ConstantRange::makeGuaranteedNoWrapRegion(
44854485
Instruction::Add, IncRange, OBO::NoUnsignedWrap);
44864486
if (NUWRegion.contains(AddRecRange))
44874487
Result = ScalarEvolution::setFlags(Result, SCEV::FlagNUW);

llvm/lib/IR/ConstantRange.cpp

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -181,9 +181,9 @@ bool ConstantRange::getEquivalentICmp(CmpInst::Predicate &Pred,
181181
}
182182

183183
ConstantRange
184-
ConstantRange::makeExactNoWrapRegion(Instruction::BinaryOps BinOp,
185-
const ConstantRange &Other,
186-
unsigned NoWrapKind) {
184+
ConstantRange::makeGuaranteedNoWrapRegion(Instruction::BinaryOps BinOp,
185+
const ConstantRange &Other,
186+
unsigned NoWrapKind) {
187187
using OBO = OverflowingBinaryOperator;
188188

189189
// Computes the intersection of CR0 and CR1. It is different from
@@ -262,7 +262,7 @@ ConstantRange::makeExactNoWrapRegion(Instruction::BinaryOps BinOp,
262262
return Result;
263263

264264
case Instruction::Mul: {
265-
// Equivalent to calling makeExactNoWrapRegion() on [V, V+1).
265+
// Equivalent to calling makeGuaranteedNoWrapRegion() on [V, V+1).
266266
const bool Unsigned = NoWrapKind == OBO::NoUnsignedWrap;
267267
const auto makeSingleValueRegion = [Unsigned,
268268
BitWidth](APInt V) -> ConstantRange {
@@ -841,9 +841,10 @@ ConstantRange::add(const ConstantRange &Other) const {
841841
ConstantRange ConstantRange::addWithNoSignedWrap(const APInt &Other) const {
842842
// Calculate the subset of this range such that "X + Other" is
843843
// guaranteed not to wrap (overflow) for all X in this subset.
844-
auto NSWRange = ConstantRange::makeExactNoWrapRegion(
845-
BinaryOperator::Add, ConstantRange(Other),
846-
OverflowingBinaryOperator::NoSignedWrap);
844+
// makeGuaranteedNoWrapRegion will produce an exact NSW range.
845+
auto NSWRange = ConstantRange::makeGuaranteedNoWrapRegion(BinaryOperator::Add,
846+
ConstantRange(Other),
847+
OverflowingBinaryOperator::NoSignedWrap);
847848
auto NSWConstrainedRange = intersectWith(NSWRange);
848849

849850
return NSWConstrainedRange.add(ConstantRange(Other));

llvm/lib/Transforms/Scalar/CorrelatedValuePropagation.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@ static bool processSwitch(SwitchInst *SI, LazyValueInfo *LVI,
402402
static bool willNotOverflow(WithOverflowInst *WO, LazyValueInfo *LVI) {
403403
Value *RHS = WO->getRHS();
404404
ConstantRange RRange = LVI->getConstantRange(RHS, WO->getParent(), WO);
405-
ConstantRange NWRegion = ConstantRange::makeExactNoWrapRegion(
405+
ConstantRange NWRegion = ConstantRange::makeGuaranteedNoWrapRegion(
406406
WO->getBinaryOp(), RRange, WO->getNoWrapKind());
407407
// As an optimization, do not compute LRange if we do not need it.
408408
if (NWRegion.isEmptySet())
@@ -640,7 +640,7 @@ static bool processBinOp(BinaryOperator *BinOp, LazyValueInfo *LVI) {
640640

641641
bool Changed = false;
642642
if (!NUW) {
643-
ConstantRange NUWRange = ConstantRange::makeExactNoWrapRegion(
643+
ConstantRange NUWRange = ConstantRange::makeGuaranteedNoWrapRegion(
644644
BinOp->getOpcode(), RRange, OBO::NoUnsignedWrap);
645645
if (!NUWRange.isEmptySet()) {
646646
bool NewNUW = NUWRange.contains(LazyLRange());
@@ -649,7 +649,7 @@ static bool processBinOp(BinaryOperator *BinOp, LazyValueInfo *LVI) {
649649
}
650650
}
651651
if (!NSW) {
652-
ConstantRange NSWRange = ConstantRange::makeExactNoWrapRegion(
652+
ConstantRange NSWRange = ConstantRange::makeGuaranteedNoWrapRegion(
653653
BinOp->getOpcode(), RRange, OBO::NoSignedWrap);
654654
if (!NSWRange.isEmptySet()) {
655655
bool NewNSW = NSWRange.contains(LazyLRange());

llvm/unittests/IR/ConstantRangeTest.cpp

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -891,20 +891,20 @@ TEST(ConstantRange, MakeSatisfyingICmpRegion) {
891891
ConstantRange(APInt(8, 4), APInt(8, -128)));
892892
}
893893

894-
TEST(ConstantRange, MakeExactNoWrapRegion) {
894+
TEST(ConstantRange, MakeGuaranteedNoWrapRegion) {
895895
const int IntMin4Bits = 8;
896896
const int IntMax4Bits = 7;
897897
typedef OverflowingBinaryOperator OBO;
898898

899899
for (int Const : {0, -1, -2, 1, 2, IntMin4Bits, IntMax4Bits}) {
900900
APInt C(4, Const, true /* = isSigned */);
901901

902-
auto NUWRegion = ConstantRange::makeExactNoWrapRegion(
902+
auto NUWRegion = ConstantRange::makeGuaranteedNoWrapRegion(
903903
Instruction::Add, C, OBO::NoUnsignedWrap);
904904

905905
EXPECT_FALSE(NUWRegion.isEmptySet());
906906

907-
auto NSWRegion = ConstantRange::makeExactNoWrapRegion(
907+
auto NSWRegion = ConstantRange::makeGuaranteedNoWrapRegion(
908908
Instruction::Add, C, OBO::NoSignedWrap);
909909

910910
EXPECT_FALSE(NSWRegion.isEmptySet());
@@ -927,12 +927,12 @@ TEST(ConstantRange, MakeExactNoWrapRegion) {
927927
for (int Const : {0, -1, -2, 1, 2, IntMin4Bits, IntMax4Bits}) {
928928
APInt C(4, Const, true /* = isSigned */);
929929

930-
auto NUWRegion = ConstantRange::makeExactNoWrapRegion(
930+
auto NUWRegion = ConstantRange::makeGuaranteedNoWrapRegion(
931931
Instruction::Sub, C, OBO::NoUnsignedWrap);
932932

933933
EXPECT_FALSE(NUWRegion.isEmptySet());
934934

935-
auto NSWRegion = ConstantRange::makeExactNoWrapRegion(
935+
auto NSWRegion = ConstantRange::makeGuaranteedNoWrapRegion(
936936
Instruction::Sub, C, OBO::NoSignedWrap);
937937

938938
EXPECT_FALSE(NSWRegion.isEmptySet());
@@ -952,102 +952,102 @@ TEST(ConstantRange, MakeExactNoWrapRegion) {
952952
}
953953
}
954954

955-
auto NSWForAllValues = ConstantRange::makeExactNoWrapRegion(
955+
auto NSWForAllValues = ConstantRange::makeGuaranteedNoWrapRegion(
956956
Instruction::Add, ConstantRange(32, /* isFullSet = */ true),
957957
OBO::NoSignedWrap);
958958
EXPECT_TRUE(NSWForAllValues.isSingleElement() &&
959959
NSWForAllValues.getSingleElement()->isMinValue());
960960

961-
NSWForAllValues = ConstantRange::makeExactNoWrapRegion(
961+
NSWForAllValues = ConstantRange::makeGuaranteedNoWrapRegion(
962962
Instruction::Sub, ConstantRange(32, /* isFullSet = */ true),
963963
OBO::NoSignedWrap);
964964
EXPECT_TRUE(NSWForAllValues.isSingleElement() &&
965965
NSWForAllValues.getSingleElement()->isMaxValue());
966966

967-
auto NUWForAllValues = ConstantRange::makeExactNoWrapRegion(
967+
auto NUWForAllValues = ConstantRange::makeGuaranteedNoWrapRegion(
968968
Instruction::Add, ConstantRange(32, /* isFullSet = */ true),
969969
OBO::NoUnsignedWrap);
970970
EXPECT_TRUE(NUWForAllValues.isSingleElement() &&
971971
NUWForAllValues.getSingleElement()->isMinValue());
972972

973-
NUWForAllValues = ConstantRange::makeExactNoWrapRegion(
973+
NUWForAllValues = ConstantRange::makeGuaranteedNoWrapRegion(
974974
Instruction::Sub, ConstantRange(32, /* isFullSet = */ true),
975975
OBO::NoUnsignedWrap);
976976
EXPECT_TRUE(NUWForAllValues.isSingleElement() &&
977977
NUWForAllValues.getSingleElement()->isMaxValue());
978978

979-
EXPECT_TRUE(ConstantRange::makeExactNoWrapRegion(
979+
EXPECT_TRUE(ConstantRange::makeGuaranteedNoWrapRegion(
980980
Instruction::Add, APInt(32, 0), OBO::NoUnsignedWrap).isFullSet());
981-
EXPECT_TRUE(ConstantRange::makeExactNoWrapRegion(
981+
EXPECT_TRUE(ConstantRange::makeGuaranteedNoWrapRegion(
982982
Instruction::Add, APInt(32, 0), OBO::NoSignedWrap).isFullSet());
983-
EXPECT_TRUE(ConstantRange::makeExactNoWrapRegion(
983+
EXPECT_TRUE(ConstantRange::makeGuaranteedNoWrapRegion(
984984
Instruction::Sub, APInt(32, 0), OBO::NoUnsignedWrap).isFullSet());
985-
EXPECT_TRUE(ConstantRange::makeExactNoWrapRegion(
985+
EXPECT_TRUE(ConstantRange::makeGuaranteedNoWrapRegion(
986986
Instruction::Sub, APInt(32, 0), OBO::NoSignedWrap).isFullSet());
987987

988988
ConstantRange OneToFive(APInt(32, 1), APInt(32, 6));
989-
EXPECT_EQ(ConstantRange::makeExactNoWrapRegion(
989+
EXPECT_EQ(ConstantRange::makeGuaranteedNoWrapRegion(
990990
Instruction::Add, OneToFive, OBO::NoSignedWrap),
991991
ConstantRange(APInt::getSignedMinValue(32),
992992
APInt::getSignedMaxValue(32) - 4));
993-
EXPECT_EQ(ConstantRange::makeExactNoWrapRegion(
993+
EXPECT_EQ(ConstantRange::makeGuaranteedNoWrapRegion(
994994
Instruction::Add, OneToFive, OBO::NoUnsignedWrap),
995995
ConstantRange(APInt::getMinValue(32), APInt::getMinValue(32) - 5));
996-
EXPECT_EQ(ConstantRange::makeExactNoWrapRegion(
996+
EXPECT_EQ(ConstantRange::makeGuaranteedNoWrapRegion(
997997
Instruction::Sub, OneToFive, OBO::NoSignedWrap),
998998
ConstantRange(APInt::getSignedMinValue(32) + 5,
999999
APInt::getSignedMinValue(32)));
1000-
EXPECT_EQ(ConstantRange::makeExactNoWrapRegion(
1000+
EXPECT_EQ(ConstantRange::makeGuaranteedNoWrapRegion(
10011001
Instruction::Sub, OneToFive, OBO::NoUnsignedWrap),
10021002
ConstantRange(APInt::getMinValue(32) + 5, APInt::getMinValue(32)));
10031003

10041004
ConstantRange MinusFiveToMinusTwo(APInt(32, -5), APInt(32, -1));
1005-
EXPECT_EQ(ConstantRange::makeExactNoWrapRegion(
1005+
EXPECT_EQ(ConstantRange::makeGuaranteedNoWrapRegion(
10061006
Instruction::Add, MinusFiveToMinusTwo, OBO::NoSignedWrap),
10071007
ConstantRange(APInt::getSignedMinValue(32) + 5,
10081008
APInt::getSignedMinValue(32)));
1009-
EXPECT_EQ(ConstantRange::makeExactNoWrapRegion(
1009+
EXPECT_EQ(ConstantRange::makeGuaranteedNoWrapRegion(
10101010
Instruction::Add, MinusFiveToMinusTwo, OBO::NoUnsignedWrap),
10111011
ConstantRange(APInt(32, 0), APInt(32, 2)));
1012-
EXPECT_EQ(ConstantRange::makeExactNoWrapRegion(
1012+
EXPECT_EQ(ConstantRange::makeGuaranteedNoWrapRegion(
10131013
Instruction::Sub, MinusFiveToMinusTwo, OBO::NoSignedWrap),
10141014
ConstantRange(APInt::getSignedMinValue(32),
10151015
APInt::getSignedMaxValue(32) - 4));
1016-
EXPECT_EQ(ConstantRange::makeExactNoWrapRegion(
1016+
EXPECT_EQ(ConstantRange::makeGuaranteedNoWrapRegion(
10171017
Instruction::Sub, MinusFiveToMinusTwo, OBO::NoUnsignedWrap),
10181018
ConstantRange(APInt::getMaxValue(32) - 1,
10191019
APInt::getMinValue(32)));
10201020

10211021
ConstantRange MinusOneToOne(APInt(32, -1), APInt(32, 2));
1022-
EXPECT_EQ(ConstantRange::makeExactNoWrapRegion(
1022+
EXPECT_EQ(ConstantRange::makeGuaranteedNoWrapRegion(
10231023
Instruction::Add, MinusOneToOne, OBO::NoSignedWrap),
10241024
ConstantRange(APInt::getSignedMinValue(32) + 1,
10251025
APInt::getSignedMinValue(32) - 1));
1026-
EXPECT_EQ(ConstantRange::makeExactNoWrapRegion(
1026+
EXPECT_EQ(ConstantRange::makeGuaranteedNoWrapRegion(
10271027
Instruction::Add, MinusOneToOne, OBO::NoUnsignedWrap),
10281028
ConstantRange(APInt(32, 0), APInt(32, 1)));
1029-
EXPECT_EQ(ConstantRange::makeExactNoWrapRegion(
1029+
EXPECT_EQ(ConstantRange::makeGuaranteedNoWrapRegion(
10301030
Instruction::Sub, MinusOneToOne, OBO::NoSignedWrap),
10311031
ConstantRange(APInt::getSignedMinValue(32) + 1,
10321032
APInt::getSignedMinValue(32) - 1));
1033-
EXPECT_EQ(ConstantRange::makeExactNoWrapRegion(
1033+
EXPECT_EQ(ConstantRange::makeGuaranteedNoWrapRegion(
10341034
Instruction::Sub, MinusOneToOne, OBO::NoUnsignedWrap),
10351035
ConstantRange(APInt::getMaxValue(32),
10361036
APInt::getMinValue(32)));
10371037

10381038
ConstantRange One(APInt(32, 1), APInt(32, 2));
1039-
EXPECT_EQ(ConstantRange::makeExactNoWrapRegion(
1039+
EXPECT_EQ(ConstantRange::makeGuaranteedNoWrapRegion(
10401040
Instruction::Add, One, OBO::NoSignedWrap),
10411041
ConstantRange(APInt::getSignedMinValue(32),
10421042
APInt::getSignedMaxValue(32)));
1043-
EXPECT_EQ(ConstantRange::makeExactNoWrapRegion(
1043+
EXPECT_EQ(ConstantRange::makeGuaranteedNoWrapRegion(
10441044
Instruction::Add, One, OBO::NoUnsignedWrap),
10451045
ConstantRange(APInt::getMinValue(32), APInt::getMaxValue(32)));
1046-
EXPECT_EQ(ConstantRange::makeExactNoWrapRegion(
1046+
EXPECT_EQ(ConstantRange::makeGuaranteedNoWrapRegion(
10471047
Instruction::Sub, One, OBO::NoSignedWrap),
10481048
ConstantRange(APInt::getSignedMinValue(32) + 1,
10491049
APInt::getSignedMinValue(32)));
1050-
EXPECT_EQ(ConstantRange::makeExactNoWrapRegion(
1050+
EXPECT_EQ(ConstantRange::makeGuaranteedNoWrapRegion(
10511051
Instruction::Sub, One, OBO::NoUnsignedWrap),
10521052
ConstantRange(APInt::getMinValue(32) + 1, APInt::getMinValue(32)));
10531053
}
@@ -1063,7 +1063,7 @@ void TestNoWrapRegionExhaustive(Instruction::BinaryOps BinOp,
10631063
return;
10641064

10651065
ConstantRange NoWrap =
1066-
ConstantRange::makeExactNoWrapRegion(BinOp, CR2, NoWrapKind);
1066+
ConstantRange::makeGuaranteedNoWrapRegion(BinOp, CR2, NoWrapKind);
10671067
ForeachNumInConstantRange(CR1, [&](const APInt &N1) {
10681068
bool NoOverflow = true;
10691069
ForeachNumInConstantRange(CR2, [&](const APInt &N2) {
@@ -1075,7 +1075,7 @@ void TestNoWrapRegionExhaustive(Instruction::BinaryOps BinOp,
10751075
});
10761076
}
10771077

1078-
// Show that makeExactNoWrapRegion is precise if only one of
1078+
// Show that makeGuaranteedNoWrapRegion is precise if only one of
10791079
// NoUnsignedWrap or NoSignedWrap is used.
10801080
TEST(ConstantRange, NoWrapRegionExhaustive) {
10811081
TestNoWrapRegionExhaustive(
@@ -1204,12 +1204,12 @@ TEST(ConstantRange, GetEquivalentICmp) {
12041204
EXPECT_EQ(RHS, APInt(32, -1));
12051205
}
12061206

1207-
TEST(ConstantRange, MakeExactNoWrapRegionMulUnsignedSingleValue) {
1207+
TEST(ConstantRange, MakeGuaranteedNoWrapRegionMulUnsignedSingleValue) {
12081208
typedef OverflowingBinaryOperator OBO;
12091209

12101210
for (uint64_t I = std::numeric_limits<uint8_t>::min();
12111211
I <= std::numeric_limits<uint8_t>::max(); I++) {
1212-
auto Range = ConstantRange::makeExactNoWrapRegion(
1212+
auto Range = ConstantRange::makeGuaranteedNoWrapRegion(
12131213
Instruction::Mul, ConstantRange(APInt(8, I), APInt(8, I + 1)),
12141214
OBO::NoUnsignedWrap);
12151215

@@ -1222,12 +1222,12 @@ TEST(ConstantRange, MakeExactNoWrapRegionMulUnsignedSingleValue) {
12221222
}
12231223
}
12241224

1225-
TEST(ConstantRange, MakeExactNoWrapRegionMulSignedSingleValue) {
1225+
TEST(ConstantRange, MakeGuaranteedNoWrapRegionMulSignedSingleValue) {
12261226
typedef OverflowingBinaryOperator OBO;
12271227

12281228
for (int64_t I = std::numeric_limits<int8_t>::min();
12291229
I <= std::numeric_limits<int8_t>::max(); I++) {
1230-
auto Range = ConstantRange::makeExactNoWrapRegion(
1230+
auto Range = ConstantRange::makeGuaranteedNoWrapRegion(
12311231
Instruction::Mul,
12321232
ConstantRange(APInt(8, I, /*isSigned=*/true),
12331233
APInt(8, I + 1, /*isSigned=*/true)),
@@ -1243,28 +1243,28 @@ TEST(ConstantRange, MakeExactNoWrapRegionMulSignedSingleValue) {
12431243
}
12441244
}
12451245

1246-
TEST(ConstantRange, MakeExactNoWrapRegionMulUnsignedRange) {
1246+
TEST(ConstantRange, MakeGuaranteedNoWrapRegionMulUnsignedRange) {
12471247
typedef OverflowingBinaryOperator OBO;
12481248

12491249
for (uint64_t Lo = std::numeric_limits<uint8_t>::min();
12501250
Lo <= std::numeric_limits<uint8_t>::max(); Lo++) {
12511251
for (uint64_t Hi = Lo; Hi <= std::numeric_limits<uint8_t>::max(); Hi++) {
12521252
EXPECT_EQ(
1253-
ConstantRange::makeExactNoWrapRegion(
1253+
ConstantRange::makeGuaranteedNoWrapRegion(
12541254
Instruction::Mul, ConstantRange(APInt(8, Lo), APInt(8, Hi + 1)),
12551255
OBO::NoUnsignedWrap),
1256-
ConstantRange::makeExactNoWrapRegion(
1256+
ConstantRange::makeGuaranteedNoWrapRegion(
12571257
Instruction::Mul, ConstantRange(APInt(8, Hi), APInt(8, Hi + 1)),
12581258
OBO::NoUnsignedWrap));
12591259
}
12601260
}
12611261
}
12621262

1263-
TEST(ConstantRange, MakeExactNoWrapRegionMulSignedRange) {
1263+
TEST(ConstantRange, MakeGuaranteedNoWrapRegionMulSignedRange) {
12641264
typedef OverflowingBinaryOperator OBO;
12651265

12661266
int Lo = -12, Hi = 16;
1267-
auto Range = ConstantRange::makeExactNoWrapRegion(
1267+
auto Range = ConstantRange::makeGuaranteedNoWrapRegion(
12681268
Instruction::Mul,
12691269
ConstantRange(APInt(8, Lo, /*isSigned=*/true),
12701270
APInt(8, Hi + 1, /*isSigned=*/true)),

0 commit comments

Comments
 (0)