summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR/ConstantRange.cpp
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2019-03-26 22:37:26 +0000
committerNikita Popov <nikita.ppv@gmail.com>2019-03-26 22:37:26 +0000
commite6eef49f05dadd781a708e68c2fc91ff5aff64a1 (patch)
tree7baa870f2f0585a82db061aae8c917f7fb68bca2 /llvm/lib/IR/ConstantRange.cpp
parentdb8a742206749b2677c78d0125a21968a7df37b3 (diff)
downloadbcm5719-llvm-e6eef49f05dadd781a708e68c2fc91ff5aff64a1.tar.gz
bcm5719-llvm-e6eef49f05dadd781a708e68c2fc91ff5aff64a1.zip
[ConstantRange] Exclude full set from isSignWrappedSet()
Split off from D59749. This uses a simpler and more efficient implementation of isSignWrappedSet(), and considers full sets as non-wrapped, to be consistent with isWrappedSet(). Otherwise the behavior is unchanged. There are currently only two users of this function and both already check for isFullSet() || isSignWrappedSet(), so this is not going to cause a change in overall behavior. Differential Revision: https://reviews.llvm.org/D59848 llvm-svn: 357039
Diffstat (limited to 'llvm/lib/IR/ConstantRange.cpp')
-rw-r--r--llvm/lib/IR/ConstantRange.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/llvm/lib/IR/ConstantRange.cpp b/llvm/lib/IR/ConstantRange.cpp
index 732f5c03d4e..0c2a3a86597 100644
--- a/llvm/lib/IR/ConstantRange.cpp
+++ b/llvm/lib/IR/ConstantRange.cpp
@@ -349,8 +349,7 @@ bool ConstantRange::isWrappedSet() const {
}
bool ConstantRange::isSignWrappedSet() const {
- return contains(APInt::getSignedMaxValue(getBitWidth())) &&
- contains(APInt::getSignedMinValue(getBitWidth()));
+ return Lower.sgt(Upper) && !Upper.isMinSignedValue();
}
APInt ConstantRange::getSetSize() const {
OpenPOWER on IntegriCloud