aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Support/ConstantRange.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Support/ConstantRange.cpp')
-rw-r--r--lib/Support/ConstantRange.cpp10
1 files changed, 3 insertions, 7 deletions
diff --git a/lib/Support/ConstantRange.cpp b/lib/Support/ConstantRange.cpp
index ca25491..4cb54bd 100644
--- a/lib/Support/ConstantRange.cpp
+++ b/lib/Support/ConstantRange.cpp
@@ -159,14 +159,10 @@ APInt ConstantRange::getSignedMax() const {
else
return SignedMax;
} else {
- if ((getUpper() - 1).slt(getLower())) {
- if (getLower() != SignedMax)
- return SignedMax;
- else
- return getUpper() - 1;
- } else {
+ if (getLower().isNegative() == getUpper().isNegative())
+ return SignedMax;
+ else
return getUpper() - 1;
- }
}
}