summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@gmail.com>2017-06-06 07:13:15 +0000
committerCraig Topper <craig.topper@gmail.com>2017-06-06 07:13:15 +0000
commit3002d5b0bf6f2556e74bf6777e951736ff3f9b1e (patch)
treebe05c5172ae0c0d9473a823df7d6e3d9487ded73 /llvm/lib
parent2dfb4804f27a3ce5ba5e96e81a4825c3b1760059 (diff)
downloadbcm5719-llvm-3002d5b0bf6f2556e74bf6777e951736ff3f9b1e.tar.gz
bcm5719-llvm-3002d5b0bf6f2556e74bf6777e951736ff3f9b1e.zip
[ValueTracking] Remove scalar only restriction from isKnownNonEqual. The computeKnownBits and isKnownNonZero calls this code relies on should work fine for vectors.
This will be used by another commit to remove some code from InstSimplify that is redundant for scalars, but was needed for vectors due to this issue. llvm-svn: 304774
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Analysis/ValueTracking.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Analysis/ValueTracking.cpp b/llvm/lib/Analysis/ValueTracking.cpp
index 581e540d0d9..5e26251c6cf 100644
--- a/llvm/lib/Analysis/ValueTracking.cpp
+++ b/llvm/lib/Analysis/ValueTracking.cpp
@@ -1982,7 +1982,7 @@ static bool isAddOfNonZero(const Value *V1, const Value *V2, const Query &Q) {
/// Return true if it is known that V1 != V2.
static bool isKnownNonEqual(const Value *V1, const Value *V2, const Query &Q) {
- if (V1->getType()->isVectorTy() || V1 == V2)
+ if (V1 == V2)
return false;
if (V1->getType() != V2->getType())
// We can't look through casts yet.
@@ -1990,7 +1990,7 @@ static bool isKnownNonEqual(const Value *V1, const Value *V2, const Query &Q) {
if (isAddOfNonZero(V1, V2, Q) || isAddOfNonZero(V2, V1, Q))
return true;
- if (isa<IntegerType>(V1->getType())) {
+ if (V1->getType()->isIntOrIntVectorTy()) {
// 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.
KnownBits Known1 = computeKnownBits(V1, 0, Q);
OpenPOWER on IntegriCloud