[llvm] r301696 - [ConstantRange] Use APInt::isNullValue rather than APInt::isMinValue where it would make more sense to thing of 0 as 0 rather than the minimum unsigned value. NFC
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Fri Apr 28 14:48:10 PDT 2017
Author: ctopper
Date: Fri Apr 28 16:48:09 2017
New Revision: 301696
URL: http://llvm.org/viewvc/llvm-project?rev=301696&view=rev
Log:
[ConstantRange] Use APInt::isNullValue rather than APInt::isMinValue where it would make more sense to thing of 0 as 0 rather than the minimum unsigned value. NFC
Modified:
llvm/trunk/lib/IR/ConstantRange.cpp
Modified: llvm/trunk/lib/IR/ConstantRange.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/ConstantRange.cpp?rev=301696&r1=301695&r2=301696&view=diff
==============================================================================
--- llvm/trunk/lib/IR/ConstantRange.cpp (original)
+++ llvm/trunk/lib/IR/ConstantRange.cpp Fri Apr 28 16:48:09 2017
@@ -198,7 +198,7 @@ ConstantRange::makeGuaranteedNoWrapRegio
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 ConstantRa
// 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()));
}
More information about the llvm-commits
mailing list