]> granicus.if.org Git - llvm/commitdiff
[ConstantRange] Use APInt::isNullValue rather than APInt::isMinValue where it would...
authorCraig Topper <craig.topper@gmail.com>
Fri, 28 Apr 2017 21:48:09 +0000 (21:48 +0000)
committerCraig Topper <craig.topper@gmail.com>
Fri, 28 Apr 2017 21:48:09 +0000 (21:48 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301696 91177308-0d34-0410-b5e6-96231b3b80d8

lib/IR/ConstantRange.cpp

index a58a64188c19d901bdb4a69156146763b3ea96bd..072a9a96635ff55d47bbe174d1c2b2f6ab26290c 100644 (file)
@@ -198,7 +198,7 @@ ConstantRange::makeGuaranteedNoWrapRegion(Instruction::BinaryOps BinOp,
     return ConstantRange(BitWidth, false);
 
   if (auto *C = Other.getSingleElement())
-    if (C->isMinValue())
+    if (C->isNullValue())
       // Full set: nothing signed / unsigned wraps when added to 0.
       return ConstantRange(BitWidth);
 
@@ -884,7 +884,7 @@ ConstantRange::binaryOr(const ConstantRange &Other) const {
   // TODO: replace this with something less conservative
 
   APInt umax = APIntOps::umax(getUnsignedMin(), Other.getUnsignedMin());
-  if (umax.isMinValue())
+  if (umax.isNullValue())
     return ConstantRange(getBitWidth(), /*isFullSet=*/true);
   return ConstantRange(umax, APInt::getNullValue(getBitWidth()));
 }