aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Support
diff options
context:
space:
mode:
authorNick Lewycky <nicholas@mxc.ca>2009-07-11 19:22:21 +0000
committerNick Lewycky <nicholas@mxc.ca>2009-07-11 19:22:21 +0000
commitcdb44fa9e33ff76ddac24811629ff6aee6d191ec (patch)
tree3916e2641e249f3c45f832f68c021557f8a67c6a /lib/Support
parent5f98ca246c5e3fda7ac6f61ea61923acd493c70d (diff)
downloadexternal_llvm-cdb44fa9e33ff76ddac24811629ff6aee6d191ec.zip
external_llvm-cdb44fa9e33ff76ddac24811629ff6aee6d191ec.tar.gz
external_llvm-cdb44fa9e33ff76ddac24811629ff6aee6d191ec.tar.bz2
Fix handling of max and full set.
A full set is a constant range that represents any number. If you take the umax of that and [5, 10) you end up with [5, INT_MAX] because the values less than 5 would be umax's against a value which is at least 5. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75372 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Support')
-rw-r--r--lib/Support/ConstantRange.cpp4
1 files changed, 0 insertions, 4 deletions
diff --git a/lib/Support/ConstantRange.cpp b/lib/Support/ConstantRange.cpp
index f5b408f..ad301c3 100644
--- a/lib/Support/ConstantRange.cpp
+++ b/lib/Support/ConstantRange.cpp
@@ -561,8 +561,6 @@ ConstantRange::smax(const ConstantRange &Other) const {
// smax(X_smax, Y_smax))
if (isEmptySet() || Other.isEmptySet())
return ConstantRange(getBitWidth(), /*isFullSet=*/false);
- if (isFullSet() || Other.isFullSet())
- return ConstantRange(getBitWidth(), /*isFullSet=*/true);
APInt NewL = APIntOps::smax(getSignedMin(), Other.getSignedMin());
APInt NewU = APIntOps::smax(getSignedMax(), Other.getSignedMax()) + 1;
if (NewU == NewL)
@@ -576,8 +574,6 @@ ConstantRange::umax(const ConstantRange &Other) const {
// umax(X_umax, Y_umax))
if (isEmptySet() || Other.isEmptySet())
return ConstantRange(getBitWidth(), /*isFullSet=*/false);
- if (isFullSet() || Other.isFullSet())
- return ConstantRange(getBitWidth(), /*isFullSet=*/true);
APInt NewL = APIntOps::umax(getUnsignedMin(), Other.getUnsignedMin());
APInt NewU = APIntOps::umax(getUnsignedMax(), Other.getUnsignedMax()) + 1;
if (NewU == NewL)