diff options
Diffstat (limited to 'lib/Support/ConstantRange.cpp')
-rw-r--r-- | lib/Support/ConstantRange.cpp | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/lib/Support/ConstantRange.cpp b/lib/Support/ConstantRange.cpp index ca25491f62..4cb54bde1b 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; - } } } |