Fix edge case.
llvm-svn: 37532
diff --git a/llvm/lib/Support/ConstantRange.cpp b/llvm/lib/Support/ConstantRange.cpp
index 1e2a637..966de80 100644
--- a/llvm/lib/Support/ConstantRange.cpp
+++ b/llvm/lib/Support/ConstantRange.cpp
@@ -108,7 +108,7 @@
APInt ConstantRange::getSignedMax() const {
APInt SignedMax(APInt::getSignedMaxValue(getBitWidth()));
if (!isWrappedSet()) {
- if (getLower().slt(getUpper() - 1))
+ if (getLower().sle(getUpper() - 1))
return getUpper() - 1;
else
return SignedMax;
@@ -130,7 +130,7 @@
APInt ConstantRange::getSignedMin() const {
APInt SignedMin(APInt::getSignedMinValue(getBitWidth()));
if (!isWrappedSet()) {
- if (getLower().slt(getUpper() - 1))
+ if (getLower().sle(getUpper() - 1))
return getLower();
else
return SignedMin;