1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 18:54:02 +01:00

[TableGen] Don't commute isel patterns if it would put an immAllOnesV or immAllZerosV on the left hand side.

This primarily occurs with isel patterns using vnot. This reduces
the number of variants in the isel tables.

We generally canonicalize build_vectors of constants to the RHS. I think
we might fail if there is a bitcast on the build_vector, but that
should be easy to fix if we can find a case. Usually the
bitcast is introduced by type legalization or lowering. It's
likely canonicalization would have already occured.
This commit is contained in:
Craig Topper 2021-01-31 20:31:24 -08:00
parent ef7f39cab9
commit 86592d2f7a

View File

@ -2637,6 +2637,8 @@ static bool OnlyOnRHSOfCommutative(TreePatternNode *N) {
return true;
if (N->isLeaf() && isa<IntInit>(N->getLeafValue()))
return true;
if (isImmAllOnesAllZerosMatch(N))
return true;
return false;
}