[llvm] r303522 - [KnownBits] Use isNegative/isNonNegative to shorten some code. NFC
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Sun May 21 17:49:33 PDT 2017
Author: ctopper
Date: Sun May 21 19:49:33 2017
New Revision: 303522
URL: http://llvm.org/viewvc/llvm-project?rev=303522&view=rev
Log:
[KnownBits] Use isNegative/isNonNegative to shorten some code. NFC
Modified:
llvm/trunk/lib/Transforms/InstCombine/InstCombineAddSub.cpp
Modified: llvm/trunk/lib/Transforms/InstCombine/InstCombineAddSub.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/InstCombine/InstCombineAddSub.cpp?rev=303522&r1=303521&r2=303522&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/InstCombine/InstCombineAddSub.cpp (original)
+++ llvm/trunk/lib/Transforms/InstCombine/InstCombineAddSub.cpp Sun May 21 19:49:33 2017
@@ -869,8 +869,8 @@ bool InstCombiner::WillNotOverflowSigned
// 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
More information about the llvm-commits
mailing list