summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--llvm/lib/Analysis/ValueTracking.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/llvm/lib/Analysis/ValueTracking.cpp b/llvm/lib/Analysis/ValueTracking.cpp
index 4f1a6c5138f..581e540d0d9 100644
--- a/llvm/lib/Analysis/ValueTracking.cpp
+++ b/llvm/lib/Analysis/ValueTracking.cpp
@@ -1990,14 +1990,11 @@ static bool isKnownNonEqual(const Value *V1, const Value *V2, const Query &Q) {
if (isAddOfNonZero(V1, V2, Q) || isAddOfNonZero(V2, V1, Q))
return true;
- if (IntegerType *Ty = dyn_cast<IntegerType>(V1->getType())) {
+ if (isa<IntegerType>(V1->getType())) {
// Are any known bits in V1 contradictory to known bits in V2? If V1
// has a known zero where V2 has a known one, they must not be equal.
- auto BitWidth = Ty->getBitWidth();
- KnownBits Known1(BitWidth);
- computeKnownBits(V1, Known1, 0, Q);
- KnownBits Known2(BitWidth);
- computeKnownBits(V2, Known2, 0, Q);
+ KnownBits Known1 = computeKnownBits(V1, 0, Q);
+ KnownBits Known2 = computeKnownBits(V2, 0, Q);
if (Known1.Zero.intersects(Known2.One) ||
Known2.Zero.intersects(Known1.One))
OpenPOWER on IntegriCloud