aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Analysis/ValueTracking.cpp
diff options
context:
space:
mode:
authorSimon Pilgrim <llvm-dev@redking.me.uk>2020-11-06 17:26:56 +0000
committerSimon Pilgrim <llvm-dev@redking.me.uk>2020-11-06 17:27:13 +0000
commit20f87d82ed31fff7f11b893d0fef5111295a6cce (patch)
treeddc30f26b4bf66f6d94e77d0784b00094e8c3d69 /llvm/lib/Analysis/ValueTracking.cpp
parentb215adf4edca766c1f06727f1c782a9e8d4a3c2e (diff)
downloadllvm-20f87d82ed31fff7f11b893d0fef5111295a6cce.zip
llvm-20f87d82ed31fff7f11b893d0fef5111295a6cce.tar.gz
llvm-20f87d82ed31fff7f11b893d0fef5111295a6cce.tar.bz2
[InstCombine] computeKnownBitsMul - use KnownBits::isNonZero() helper.
Avoid an expensive isKnownNonZero() call - this is a small cleanup before moving the extra NSW functionality from computeKnownBitsMul into KnownBits::computeForMul.
Diffstat (limited to 'llvm/lib/Analysis/ValueTracking.cpp')
-rw-r--r--llvm/lib/Analysis/ValueTracking.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/Analysis/ValueTracking.cpp b/llvm/lib/Analysis/ValueTracking.cpp
index 44cf4f8..db591ce 100644
--- a/llvm/lib/Analysis/ValueTracking.cpp
+++ b/llvm/lib/Analysis/ValueTracking.cpp
@@ -436,10 +436,10 @@ static void computeKnownBitsMul(const Value *Op0, const Value *Op1, bool NSW,
// The product of a negative number and a non-negative number is either
// negative or zero.
if (!isKnownNonNegative)
- isKnownNegative = (isKnownNegativeOp1 && isKnownNonNegativeOp0 &&
- isKnownNonZero(Op0, Depth, Q)) ||
- (isKnownNegativeOp0 && isKnownNonNegativeOp1 &&
- isKnownNonZero(Op1, Depth, Q));
+ isKnownNegative =
+ (isKnownNegativeOp1 && isKnownNonNegativeOp0 &&
+ Known2.isNonZero()) ||
+ (isKnownNegativeOp0 && isKnownNonNegativeOp1 && Known.isNonZero());
}
}