diff options
author | Craig Topper <craig.topper@gmail.com> | 2017-05-15 06:39:41 +0000 |
---|---|---|
committer | Craig Topper <craig.topper@gmail.com> | 2017-05-15 06:39:41 +0000 |
commit | 1a36b7d836b203ecaa5d91f051e6a6d3aacc6741 (patch) | |
tree | 09d3bd57f500e1bf0b06067b633695fd62d141cb /llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp | |
parent | 61fa0dcac30a8d8f8a61fa46361fe30ce3cad97f (diff) | |
download | llvm-1a36b7d836b203ecaa5d91f051e6a6d3aacc6741.zip llvm-1a36b7d836b203ecaa5d91f051e6a6d3aacc6741.tar.gz llvm-1a36b7d836b203ecaa5d91f051e6a6d3aacc6741.tar.bz2 |
[ValueTracking] Replace all uses of ComputeSignBit with computeKnownBits.
This patch finishes off the conversion of ComputeSignBit to computeKnownBits.
Differential Revision: https://reviews.llvm.org/D33166
llvm-svn: 303035
Diffstat (limited to 'llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp')
-rw-r--r-- | llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp b/llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp index 74e3dbb4..0ca62b7a 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp +++ b/llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp @@ -882,13 +882,9 @@ bool InstCombiner::WillNotOverflowSignedSub(Value *LHS, Value *RHS, bool InstCombiner::WillNotOverflowUnsignedSub(Value *LHS, Value *RHS, Instruction &CxtI) { // If the LHS is negative and the RHS is non-negative, no unsigned wrap. - bool LHSKnownNonNegative, LHSKnownNegative; - bool RHSKnownNonNegative, RHSKnownNegative; - ComputeSignBit(LHS, LHSKnownNonNegative, LHSKnownNegative, /*Depth=*/0, - &CxtI); - ComputeSignBit(RHS, RHSKnownNonNegative, RHSKnownNegative, /*Depth=*/0, - &CxtI); - if (LHSKnownNegative && RHSKnownNonNegative) + KnownBits LHSKnown = computeKnownBits(LHS, /*Depth=*/0, &CxtI); + KnownBits RHSKnown = computeKnownBits(RHS, /*Depth=*/0, &CxtI); + if (LHSKnown.isNegative() && RHSKnown.isNonNegative()) return true; return false; |