aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/IR/ConstantRange.cpp
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2021-02-20 21:42:26 +0100
committerNikita Popov <nikita.ppv@gmail.com>2021-02-20 21:45:59 +0100
commitb6088f7465a9a6691d5d237e9c0eb002734da3bf (patch)
treef86732ac532c14411396ee4f62e63f2dff883d3a /llvm/lib/IR/ConstantRange.cpp
parent1611e5473c5e30e0eea9ec5bd187ed455bdd6109 (diff)
downloadllvm-b6088f7465a9a6691d5d237e9c0eb002734da3bf.zip
llvm-b6088f7465a9a6691d5d237e9c0eb002734da3bf.tar.gz
llvm-b6088f7465a9a6691d5d237e9c0eb002734da3bf.tar.bz2
[ConstantRange] Handle wrapping range in binaryNot()
We don't need any special handling for wrapping ranges (or empty ranges for that matter). The sub() call will already compute a correct and precise range. We only need to adjust the test expectation: We're now computing an optimal result, rather than an unsigned envelope.
Diffstat (limited to 'llvm/lib/IR/ConstantRange.cpp')
-rw-r--r--llvm/lib/IR/ConstantRange.cpp6
1 files changed, 0 insertions, 6 deletions
diff --git a/llvm/lib/IR/ConstantRange.cpp b/llvm/lib/IR/ConstantRange.cpp
index 4b0ad1b..275996d 100644
--- a/llvm/lib/IR/ConstantRange.cpp
+++ b/llvm/lib/IR/ConstantRange.cpp
@@ -1256,12 +1256,6 @@ ConstantRange ConstantRange::srem(const ConstantRange &RHS) const {
}
ConstantRange ConstantRange::binaryNot() const {
- if (isEmptySet())
- return getEmpty();
-
- if (isWrappedSet())
- return getFull();
-
return ConstantRange(APInt::getAllOnesValue(getBitWidth())).sub(*this);
}