Skip to content

Commit 8e64ec8

Browse files
committed
Moved isNonEqualSelect to the end of isKnownNonEqual.
This is necessary so that we can analyze things like `isKnownNonEqual(X, Y)` where `X = select ... ` and `Y = shl X, 2` for example. In other words, we first should try to do the analysis without "decomposing" `select` first.
1 parent bc4566e commit 8e64ec8

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

llvm/lib/Analysis/ValueTracking.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3171,9 +3171,6 @@ static bool isKnownNonEqual(const Value *V1, const Value *V2, unsigned Depth,
31713171
};
31723172
}
31733173

3174-
if (isNonEqualSelect(V1, V2, Depth, Q) || isNonEqualSelect(V2, V1, Depth, Q))
3175-
return true;
3176-
31773174
if (isAddOfNonZero(V1, V2, Depth, Q) || isAddOfNonZero(V2, V1, Depth, Q))
31783175
return true;
31793176

@@ -3193,6 +3190,10 @@ static bool isKnownNonEqual(const Value *V1, const Value *V2, unsigned Depth,
31933190
Known2.Zero.intersects(Known1.One))
31943191
return true;
31953192
}
3193+
3194+
if (isNonEqualSelect(V1, V2, Depth, Q) || isNonEqualSelect(V2, V1, Depth, Q))
3195+
return true;
3196+
31963197
return false;
31973198
}
31983199

0 commit comments

Comments
 (0)