[ConstantRange] Rename make{Guaranteed -> Exact}NoWrapRegion() NFC
authorNikita Popov <nikita.ppv@gmail.com>
Mon, 22 Apr 2019 08:36:05 +0000 (08:36 +0000)
committerNikita Popov <nikita.ppv@gmail.com>
Mon, 22 Apr 2019 08:36:05 +0000 (08:36 +0000)
Following D60632 makeGuaranteedNoWrapRegion() always returns an
exact nowrap region. Rename the function accordingly. This is in
line with the naming of makeExactICmpRegion().

llvm-svn: 358875

llvm/include/llvm/IR/ConstantRange.h
llvm/lib/Analysis/LazyValueInfo.cpp
llvm/lib/Analysis/ScalarEvolution.cpp
llvm/lib/IR/ConstantRange.cpp
llvm/lib/Transforms/Scalar/CorrelatedValuePropagation.cpp
llvm/unittests/IR/ConstantRangeTest.cpp

index f006a93..bcd0366 100644 (file)
@@ -131,16 +131,16 @@ public:
   ///
   /// Examples:
   ///  typedef OverflowingBinaryOperator OBO;
-  ///  #define MGNR makeGuaranteedNoWrapRegion
-  ///  MGNR(Add, [i8 1, 2), OBO::NoSignedWrap) == [-128, 127)
-  ///  MGNR(Add, [i8 1, 2), OBO::NoUnsignedWrap) == [0, -1)
-  ///  MGNR(Add, [i8 0, 1), OBO::NoUnsignedWrap) == Full Set
-  ///  MGNR(Add, [i8 -1, 6), OBO::NoSignedWrap) == [INT_MIN+1, INT_MAX-4)
-  ///  MGNR(Sub, [i8 1, 2), OBO::NoSignedWrap) == [-127, 128)
-  ///  MGNR(Sub, [i8 1, 2), OBO::NoUnsignedWrap) == [1, 0)
-  static ConstantRange makeGuaranteedNoWrapRegion(Instruction::BinaryOps BinOp,
-                                                  const ConstantRange &Other,
-                                                  unsigned NoWrapKind);
+  ///  #define MENR makeExactNoWrapRegion
+  ///  MENR(Add, [i8 1, 2), OBO::NoSignedWrap) == [-128, 127)
+  ///  MENR(Add, [i8 1, 2), OBO::NoUnsignedWrap) == [0, -1)
+  ///  MENR(Add, [i8 0, 1), OBO::NoUnsignedWrap) == Full Set
+  ///  MENR(Add, [i8 -1, 6), OBO::NoSignedWrap) == [INT_MIN+1, INT_MAX-4)
+  ///  MENR(Sub, [i8 1, 2), OBO::NoSignedWrap) == [-127, 128)
+  ///  MENR(Sub, [i8 1, 2), OBO::NoUnsignedWrap) == [1, 0)
+  static ConstantRange makeExactNoWrapRegion(Instruction::BinaryOps BinOp,
+                                             const ConstantRange &Other,
+                                             unsigned NoWrapKind);
 
   /// Set up \p Pred and \p RHS such that
   /// ConstantRange::makeExactICmpRegion(Pred, RHS) == *this.  Return true if
index 02a829f..260a2a6 100644 (file)
@@ -1146,7 +1146,7 @@ static ValueLatticeElement getValueFromOverflowCondition(
     return ValueLatticeElement::getOverdefined();
 
   // Calculate the possible values of %x for which no overflow occurs.
-  ConstantRange NWR = ConstantRange::makeGuaranteedNoWrapRegion(
+  ConstantRange NWR = ConstantRange::makeExactNoWrapRegion(
       WO->getBinaryOp(), ConstantRange(*C), WO->getNoWrapKind());
 
   // If overflow is false, %x is constrained to NWR. If overflow is true, %x is
index 1f69bc8..1a6fc95 100644 (file)
@@ -2363,7 +2363,7 @@ StrengthenNoWrapFlags(ScalarEvolution *SE, SCEVTypes Type,
 
     // (A <opcode> C) --> (A <opcode> C)<nsw> if the op doesn't sign overflow.
     if (!(SignOrUnsignWrap & SCEV::FlagNSW)) {
-      auto NSWRegion = ConstantRange::makeGuaranteedNoWrapRegion(
+      auto NSWRegion = ConstantRange::makeExactNoWrapRegion(
           Opcode, C, OBO::NoSignedWrap);
       if (NSWRegion.contains(SE->getSignedRange(Ops[1])))
         Flags = ScalarEvolution::setFlags(Flags, SCEV::FlagNSW);
@@ -2371,7 +2371,7 @@ StrengthenNoWrapFlags(ScalarEvolution *SE, SCEVTypes Type,
 
     // (A <opcode> C) --> (A <opcode> C)<nuw> if the op doesn't unsign overflow.
     if (!(SignOrUnsignWrap & SCEV::FlagNUW)) {
-      auto NUWRegion = ConstantRange::makeGuaranteedNoWrapRegion(
+      auto NUWRegion = ConstantRange::makeExactNoWrapRegion(
           Opcode, C, OBO::NoUnsignedWrap);
       if (NUWRegion.contains(SE->getUnsignedRange(Ops[1])))
         Flags = ScalarEvolution::setFlags(Flags, SCEV::FlagNUW);
@@ -4471,7 +4471,7 @@ ScalarEvolution::proveNoWrapViaConstantRanges(const SCEVAddRecExpr *AR) {
     ConstantRange AddRecRange = getSignedRange(AR);
     ConstantRange IncRange = getSignedRange(AR->getStepRecurrence(*this));
 
-    auto NSWRegion = ConstantRange::makeGuaranteedNoWrapRegion(
+    auto NSWRegion = ConstantRange::makeExactNoWrapRegion(
         Instruction::Add, IncRange, OBO::NoSignedWrap);
     if (NSWRegion.contains(AddRecRange))
       Result = ScalarEvolution::setFlags(Result, SCEV::FlagNSW);
@@ -4481,7 +4481,7 @@ ScalarEvolution::proveNoWrapViaConstantRanges(const SCEVAddRecExpr *AR) {
     ConstantRange AddRecRange = getUnsignedRange(AR);
     ConstantRange IncRange = getUnsignedRange(AR->getStepRecurrence(*this));
 
-    auto NUWRegion = ConstantRange::makeGuaranteedNoWrapRegion(
+    auto NUWRegion = ConstantRange::makeExactNoWrapRegion(
         Instruction::Add, IncRange, OBO::NoUnsignedWrap);
     if (NUWRegion.contains(AddRecRange))
       Result = ScalarEvolution::setFlags(Result, SCEV::FlagNUW);
index b2bdd0a..3e1d7e4 100644 (file)
@@ -181,9 +181,9 @@ bool ConstantRange::getEquivalentICmp(CmpInst::Predicate &Pred,
 }
 
 ConstantRange
-ConstantRange::makeGuaranteedNoWrapRegion(Instruction::BinaryOps BinOp,
-                                          const ConstantRange &Other,
-                                          unsigned NoWrapKind) {
+ConstantRange::makeExactNoWrapRegion(Instruction::BinaryOps BinOp,
+                                     const ConstantRange &Other,
+                                     unsigned NoWrapKind) {
   using OBO = OverflowingBinaryOperator;
 
   // Computes the intersection of CR0 and CR1.  It is different from
@@ -262,7 +262,7 @@ ConstantRange::makeGuaranteedNoWrapRegion(Instruction::BinaryOps BinOp,
     return Result;
 
   case Instruction::Mul: {
-    // Equivalent to calling makeGuaranteedNoWrapRegion() on [V, V+1).
+    // Equivalent to calling makeExactNoWrapRegion() on [V, V+1).
     const bool Unsigned = NoWrapKind == OBO::NoUnsignedWrap;
     const auto makeSingleValueRegion = [Unsigned,
                                         BitWidth](APInt V) -> ConstantRange {
@@ -841,10 +841,9 @@ ConstantRange::add(const ConstantRange &Other) const {
 ConstantRange ConstantRange::addWithNoSignedWrap(const APInt &Other) const {
   // Calculate the subset of this range such that "X + Other" is
   // guaranteed not to wrap (overflow) for all X in this subset.
-  // makeGuaranteedNoWrapRegion will produce an exact NSW range.
-  auto NSWRange = ConstantRange::makeGuaranteedNoWrapRegion(BinaryOperator::Add,
-                                      ConstantRange(Other),
-                                      OverflowingBinaryOperator::NoSignedWrap);
+  auto NSWRange = ConstantRange::makeExactNoWrapRegion(
+      BinaryOperator::Add, ConstantRange(Other),
+      OverflowingBinaryOperator::NoSignedWrap);
   auto NSWConstrainedRange = intersectWith(NSWRange);
 
   return NSWConstrainedRange.add(ConstantRange(Other));
index 2c31e4a..5242ce0 100644 (file)
@@ -402,7 +402,7 @@ static bool processSwitch(SwitchInst *SI, LazyValueInfo *LVI,
 static bool willNotOverflow(WithOverflowInst *WO, LazyValueInfo *LVI) {
   Value *RHS = WO->getRHS();
   ConstantRange RRange = LVI->getConstantRange(RHS, WO->getParent(), WO);
-  ConstantRange NWRegion = ConstantRange::makeGuaranteedNoWrapRegion(
+  ConstantRange NWRegion = ConstantRange::makeExactNoWrapRegion(
       WO->getBinaryOp(), RRange, WO->getNoWrapKind());
   // As an optimization, do not compute LRange if we do not need it.
   if (NWRegion.isEmptySet())
@@ -640,7 +640,7 @@ static bool processBinOp(BinaryOperator *BinOp, LazyValueInfo *LVI) {
 
   bool Changed = false;
   if (!NUW) {
-    ConstantRange NUWRange = ConstantRange::makeGuaranteedNoWrapRegion(
+    ConstantRange NUWRange = ConstantRange::makeExactNoWrapRegion(
         BinOp->getOpcode(), RRange, OBO::NoUnsignedWrap);
     if (!NUWRange.isEmptySet()) {
       bool NewNUW = NUWRange.contains(LazyLRange());
@@ -649,7 +649,7 @@ static bool processBinOp(BinaryOperator *BinOp, LazyValueInfo *LVI) {
     }
   }
   if (!NSW) {
-    ConstantRange NSWRange = ConstantRange::makeGuaranteedNoWrapRegion(
+    ConstantRange NSWRange = ConstantRange::makeExactNoWrapRegion(
         BinOp->getOpcode(), RRange, OBO::NoSignedWrap);
     if (!NSWRange.isEmptySet()) {
       bool NewNSW = NSWRange.contains(LazyLRange());
index 3306fe3..a6670f8 100644 (file)
@@ -891,7 +891,7 @@ TEST(ConstantRange, MakeSatisfyingICmpRegion) {
       ConstantRange(APInt(8, 4), APInt(8, -128)));
 }
 
-TEST(ConstantRange, MakeGuaranteedNoWrapRegion) {
+TEST(ConstantRange, MakeExactNoWrapRegion) {
   const int IntMin4Bits = 8;
   const int IntMax4Bits = 7;
   typedef OverflowingBinaryOperator OBO;
@@ -899,12 +899,12 @@ TEST(ConstantRange, MakeGuaranteedNoWrapRegion) {
   for (int Const : {0, -1, -2, 1, 2, IntMin4Bits, IntMax4Bits}) {
     APInt C(4, Const, true /* = isSigned */);
 
-    auto NUWRegion = ConstantRange::makeGuaranteedNoWrapRegion(
+    auto NUWRegion = ConstantRange::makeExactNoWrapRegion(
         Instruction::Add, C, OBO::NoUnsignedWrap);
 
     EXPECT_FALSE(NUWRegion.isEmptySet());
 
-    auto NSWRegion = ConstantRange::makeGuaranteedNoWrapRegion(
+    auto NSWRegion = ConstantRange::makeExactNoWrapRegion(
         Instruction::Add, C, OBO::NoSignedWrap);
 
     EXPECT_FALSE(NSWRegion.isEmptySet());
@@ -927,12 +927,12 @@ TEST(ConstantRange, MakeGuaranteedNoWrapRegion) {
   for (int Const : {0, -1, -2, 1, 2, IntMin4Bits, IntMax4Bits}) {
     APInt C(4, Const, true /* = isSigned */);
 
-    auto NUWRegion = ConstantRange::makeGuaranteedNoWrapRegion(
+    auto NUWRegion = ConstantRange::makeExactNoWrapRegion(
         Instruction::Sub, C, OBO::NoUnsignedWrap);
 
     EXPECT_FALSE(NUWRegion.isEmptySet());
 
-    auto NSWRegion = ConstantRange::makeGuaranteedNoWrapRegion(
+    auto NSWRegion = ConstantRange::makeExactNoWrapRegion(
         Instruction::Sub, C, OBO::NoSignedWrap);
 
     EXPECT_FALSE(NSWRegion.isEmptySet());
@@ -952,102 +952,102 @@ TEST(ConstantRange, MakeGuaranteedNoWrapRegion) {
     }
   }
 
-  auto NSWForAllValues = ConstantRange::makeGuaranteedNoWrapRegion(
+  auto NSWForAllValues = ConstantRange::makeExactNoWrapRegion(
       Instruction::Add, ConstantRange(32, /* isFullSet = */ true),
       OBO::NoSignedWrap);
   EXPECT_TRUE(NSWForAllValues.isSingleElement() &&
               NSWForAllValues.getSingleElement()->isMinValue());
 
-  NSWForAllValues = ConstantRange::makeGuaranteedNoWrapRegion(
+  NSWForAllValues = ConstantRange::makeExactNoWrapRegion(
       Instruction::Sub, ConstantRange(32, /* isFullSet = */ true),
       OBO::NoSignedWrap);
   EXPECT_TRUE(NSWForAllValues.isSingleElement() &&
               NSWForAllValues.getSingleElement()->isMaxValue());
 
-  auto NUWForAllValues = ConstantRange::makeGuaranteedNoWrapRegion(
+  auto NUWForAllValues = ConstantRange::makeExactNoWrapRegion(
       Instruction::Add, ConstantRange(32, /* isFullSet = */ true),
       OBO::NoUnsignedWrap);
   EXPECT_TRUE(NUWForAllValues.isSingleElement() &&
               NUWForAllValues.getSingleElement()->isMinValue());
 
-  NUWForAllValues = ConstantRange::makeGuaranteedNoWrapRegion(
+  NUWForAllValues = ConstantRange::makeExactNoWrapRegion(
       Instruction::Sub, ConstantRange(32, /* isFullSet = */ true),
       OBO::NoUnsignedWrap);
   EXPECT_TRUE(NUWForAllValues.isSingleElement() &&
               NUWForAllValues.getSingleElement()->isMaxValue());
 
-  EXPECT_TRUE(ConstantRange::makeGuaranteedNoWrapRegion(
+  EXPECT_TRUE(ConstantRange::makeExactNoWrapRegion(
       Instruction::Add, APInt(32, 0), OBO::NoUnsignedWrap).isFullSet());
-  EXPECT_TRUE(ConstantRange::makeGuaranteedNoWrapRegion(
+  EXPECT_TRUE(ConstantRange::makeExactNoWrapRegion(
       Instruction::Add, APInt(32, 0), OBO::NoSignedWrap).isFullSet());
-  EXPECT_TRUE(ConstantRange::makeGuaranteedNoWrapRegion(
+  EXPECT_TRUE(ConstantRange::makeExactNoWrapRegion(
       Instruction::Sub, APInt(32, 0), OBO::NoUnsignedWrap).isFullSet());
-  EXPECT_TRUE(ConstantRange::makeGuaranteedNoWrapRegion(
+  EXPECT_TRUE(ConstantRange::makeExactNoWrapRegion(
       Instruction::Sub, APInt(32, 0), OBO::NoSignedWrap).isFullSet());
 
   ConstantRange OneToFive(APInt(32, 1), APInt(32, 6));
-  EXPECT_EQ(ConstantRange::makeGuaranteedNoWrapRegion(
+  EXPECT_EQ(ConstantRange::makeExactNoWrapRegion(
                 Instruction::Add, OneToFive, OBO::NoSignedWrap),
             ConstantRange(APInt::getSignedMinValue(32),
                           APInt::getSignedMaxValue(32) - 4));
-  EXPECT_EQ(ConstantRange::makeGuaranteedNoWrapRegion(
+  EXPECT_EQ(ConstantRange::makeExactNoWrapRegion(
                 Instruction::Add, OneToFive, OBO::NoUnsignedWrap),
             ConstantRange(APInt::getMinValue(32), APInt::getMinValue(32) - 5));
-  EXPECT_EQ(ConstantRange::makeGuaranteedNoWrapRegion(
+  EXPECT_EQ(ConstantRange::makeExactNoWrapRegion(
                 Instruction::Sub, OneToFive, OBO::NoSignedWrap),
             ConstantRange(APInt::getSignedMinValue(32) + 5,
                           APInt::getSignedMinValue(32)));
-  EXPECT_EQ(ConstantRange::makeGuaranteedNoWrapRegion(
+  EXPECT_EQ(ConstantRange::makeExactNoWrapRegion(
                 Instruction::Sub, OneToFive, OBO::NoUnsignedWrap),
             ConstantRange(APInt::getMinValue(32) + 5, APInt::getMinValue(32)));
 
   ConstantRange MinusFiveToMinusTwo(APInt(32, -5), APInt(32, -1));
-  EXPECT_EQ(ConstantRange::makeGuaranteedNoWrapRegion(
+  EXPECT_EQ(ConstantRange::makeExactNoWrapRegion(
                 Instruction::Add, MinusFiveToMinusTwo, OBO::NoSignedWrap),
             ConstantRange(APInt::getSignedMinValue(32) + 5,
                           APInt::getSignedMinValue(32)));
-  EXPECT_EQ(ConstantRange::makeGuaranteedNoWrapRegion(
+  EXPECT_EQ(ConstantRange::makeExactNoWrapRegion(
                 Instruction::Add, MinusFiveToMinusTwo, OBO::NoUnsignedWrap),
             ConstantRange(APInt(32, 0), APInt(32, 2)));
-  EXPECT_EQ(ConstantRange::makeGuaranteedNoWrapRegion(
+  EXPECT_EQ(ConstantRange::makeExactNoWrapRegion(
                 Instruction::Sub, MinusFiveToMinusTwo, OBO::NoSignedWrap),
             ConstantRange(APInt::getSignedMinValue(32),
                           APInt::getSignedMaxValue(32) - 4));
-  EXPECT_EQ(ConstantRange::makeGuaranteedNoWrapRegion(
+  EXPECT_EQ(ConstantRange::makeExactNoWrapRegion(
                 Instruction::Sub, MinusFiveToMinusTwo, OBO::NoUnsignedWrap),
             ConstantRange(APInt::getMaxValue(32) - 1,
                           APInt::getMinValue(32)));
 
   ConstantRange MinusOneToOne(APInt(32, -1), APInt(32, 2));
-  EXPECT_EQ(ConstantRange::makeGuaranteedNoWrapRegion(
+  EXPECT_EQ(ConstantRange::makeExactNoWrapRegion(
                 Instruction::Add, MinusOneToOne, OBO::NoSignedWrap),
             ConstantRange(APInt::getSignedMinValue(32) + 1,
                           APInt::getSignedMinValue(32) - 1));
-  EXPECT_EQ(ConstantRange::makeGuaranteedNoWrapRegion(
+  EXPECT_EQ(ConstantRange::makeExactNoWrapRegion(
                 Instruction::Add, MinusOneToOne, OBO::NoUnsignedWrap),
             ConstantRange(APInt(32, 0), APInt(32, 1)));
-  EXPECT_EQ(ConstantRange::makeGuaranteedNoWrapRegion(
+  EXPECT_EQ(ConstantRange::makeExactNoWrapRegion(
                 Instruction::Sub, MinusOneToOne, OBO::NoSignedWrap),
             ConstantRange(APInt::getSignedMinValue(32) + 1,
                           APInt::getSignedMinValue(32) - 1));
-  EXPECT_EQ(ConstantRange::makeGuaranteedNoWrapRegion(
+  EXPECT_EQ(ConstantRange::makeExactNoWrapRegion(
                 Instruction::Sub, MinusOneToOne, OBO::NoUnsignedWrap),
             ConstantRange(APInt::getMaxValue(32),
                           APInt::getMinValue(32)));
 
   ConstantRange One(APInt(32, 1), APInt(32, 2));
-  EXPECT_EQ(ConstantRange::makeGuaranteedNoWrapRegion(
+  EXPECT_EQ(ConstantRange::makeExactNoWrapRegion(
                 Instruction::Add, One, OBO::NoSignedWrap),
             ConstantRange(APInt::getSignedMinValue(32),
                           APInt::getSignedMaxValue(32)));
-  EXPECT_EQ(ConstantRange::makeGuaranteedNoWrapRegion(
+  EXPECT_EQ(ConstantRange::makeExactNoWrapRegion(
                 Instruction::Add, One, OBO::NoUnsignedWrap),
             ConstantRange(APInt::getMinValue(32), APInt::getMaxValue(32)));
-  EXPECT_EQ(ConstantRange::makeGuaranteedNoWrapRegion(
+  EXPECT_EQ(ConstantRange::makeExactNoWrapRegion(
                 Instruction::Sub, One, OBO::NoSignedWrap),
             ConstantRange(APInt::getSignedMinValue(32) + 1,
                           APInt::getSignedMinValue(32)));
-  EXPECT_EQ(ConstantRange::makeGuaranteedNoWrapRegion(
+  EXPECT_EQ(ConstantRange::makeExactNoWrapRegion(
                 Instruction::Sub, One, OBO::NoUnsignedWrap),
             ConstantRange(APInt::getMinValue(32) + 1, APInt::getMinValue(32)));
 }
@@ -1063,7 +1063,7 @@ void TestNoWrapRegionExhaustive(Instruction::BinaryOps BinOp,
           return;
 
         ConstantRange NoWrap =
-            ConstantRange::makeGuaranteedNoWrapRegion(BinOp, CR2, NoWrapKind);
+            ConstantRange::makeExactNoWrapRegion(BinOp, CR2, NoWrapKind);
         ForeachNumInConstantRange(CR1, [&](const APInt &N1) {
           bool NoOverflow = true;
           ForeachNumInConstantRange(CR2, [&](const APInt &N2) {
@@ -1075,7 +1075,7 @@ void TestNoWrapRegionExhaustive(Instruction::BinaryOps BinOp,
       });
 }
 
-// Show that makeGuaranteedNoWrapRegion is precise if only one of
+// Show that makeExactNoWrapRegion is precise if only one of
 // NoUnsignedWrap or NoSignedWrap is used.
 TEST(ConstantRange, NoWrapRegionExhaustive) {
   TestNoWrapRegionExhaustive(
@@ -1204,12 +1204,12 @@ TEST(ConstantRange, GetEquivalentICmp) {
   EXPECT_EQ(RHS, APInt(32, -1));
 }
 
-TEST(ConstantRange, MakeGuaranteedNoWrapRegionMulUnsignedSingleValue) {
+TEST(ConstantRange, MakeExactNoWrapRegionMulUnsignedSingleValue) {
   typedef OverflowingBinaryOperator OBO;
 
   for (uint64_t I = std::numeric_limits<uint8_t>::min();
        I <= std::numeric_limits<uint8_t>::max(); I++) {
-    auto Range = ConstantRange::makeGuaranteedNoWrapRegion(
+    auto Range = ConstantRange::makeExactNoWrapRegion(
         Instruction::Mul, ConstantRange(APInt(8, I), APInt(8, I + 1)),
         OBO::NoUnsignedWrap);
 
@@ -1222,12 +1222,12 @@ TEST(ConstantRange, MakeGuaranteedNoWrapRegionMulUnsignedSingleValue) {
   }
 }
 
-TEST(ConstantRange, MakeGuaranteedNoWrapRegionMulSignedSingleValue) {
+TEST(ConstantRange, MakeExactNoWrapRegionMulSignedSingleValue) {
   typedef OverflowingBinaryOperator OBO;
 
   for (int64_t I = std::numeric_limits<int8_t>::min();
        I <= std::numeric_limits<int8_t>::max(); I++) {
-    auto Range = ConstantRange::makeGuaranteedNoWrapRegion(
+    auto Range = ConstantRange::makeExactNoWrapRegion(
         Instruction::Mul,
         ConstantRange(APInt(8, I, /*isSigned=*/true),
                       APInt(8, I + 1, /*isSigned=*/true)),
@@ -1243,28 +1243,28 @@ TEST(ConstantRange, MakeGuaranteedNoWrapRegionMulSignedSingleValue) {
   }
 }
 
-TEST(ConstantRange, MakeGuaranteedNoWrapRegionMulUnsignedRange) {
+TEST(ConstantRange, MakeExactNoWrapRegionMulUnsignedRange) {
   typedef OverflowingBinaryOperator OBO;
 
   for (uint64_t Lo = std::numeric_limits<uint8_t>::min();
        Lo <= std::numeric_limits<uint8_t>::max(); Lo++) {
     for (uint64_t Hi = Lo; Hi <= std::numeric_limits<uint8_t>::max(); Hi++) {
       EXPECT_EQ(
-          ConstantRange::makeGuaranteedNoWrapRegion(
+          ConstantRange::makeExactNoWrapRegion(
               Instruction::Mul, ConstantRange(APInt(8, Lo), APInt(8, Hi + 1)),
               OBO::NoUnsignedWrap),
-          ConstantRange::makeGuaranteedNoWrapRegion(
+          ConstantRange::makeExactNoWrapRegion(
               Instruction::Mul, ConstantRange(APInt(8, Hi), APInt(8, Hi + 1)),
               OBO::NoUnsignedWrap));
     }
   }
 }
 
-TEST(ConstantRange, MakeGuaranteedNoWrapRegionMulSignedRange) {
+TEST(ConstantRange, MakeExactNoWrapRegionMulSignedRange) {
   typedef OverflowingBinaryOperator OBO;
 
   int Lo = -12, Hi = 16;
-  auto Range = ConstantRange::makeGuaranteedNoWrapRegion(
+  auto Range = ConstantRange::makeExactNoWrapRegion(
       Instruction::Mul,
       ConstantRange(APInt(8, Lo, /*isSigned=*/true),
                     APInt(8, Hi + 1, /*isSigned=*/true)),