summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@gmail.com>2017-05-22 00:49:33 +0000
committerCraig Topper <craig.topper@gmail.com>2017-05-22 00:49:33 +0000
commitaaef41f71be7a17dc15887eac918fa54021c68da (patch)
tree9fa70ecd91565e373b52af669aaf5e58a4943ba6 /llvm/lib/Transforms
parentd130b6c27d167fe9ba5fc270daf295125359d6d8 (diff)
downloadbcm5719-llvm-aaef41f71be7a17dc15887eac918fa54021c68da.tar.gz
bcm5719-llvm-aaef41f71be7a17dc15887eac918fa54021c68da.zip
[KnownBits] Use isNegative/isNonNegative to shorten some code. NFC
llvm-svn: 303522
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp b/llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp
index 0ca62b7ae40..f32ee965397 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp
@@ -869,8 +869,8 @@ bool InstCombiner::WillNotOverflowSignedSub(Value *LHS, Value *RHS,
// Subtraction of two 2's complement numbers having identical signs will
// never overflow.
- if ((LHSKnown.One[BitWidth - 1] && RHSKnown.One[BitWidth - 1]) ||
- (LHSKnown.Zero[BitWidth - 1] && RHSKnown.Zero[BitWidth - 1]))
+ if ((LHSKnown.isNegative() && RHSKnown.isNegative()) ||
+ (LHSKnown.isNonNegative() && RHSKnown.isNonNegative()))
return true;
// TODO: implement logic similar to checkRippleForAdd
OpenPOWER on IntegriCloud