[X86][AVX] lowerShuffleWithSHUFPS - handle missed canonicalization cases.
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Tue, 15 Sep 2020 16:08:45 +0000 (17:08 +0100)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Tue, 15 Sep 2020 16:31:08 +0000 (17:31 +0100)
commita43e68b58b085797e2f1435765255ebd431db297
treeacb44428591f6ef1044d194fd00688bc49ba9196
parent4ddd985ca941e48a016e8d7270921b4aa76afbe1
[X86][AVX] lowerShuffleWithSHUFPS - handle missed canonicalization cases.

PR47534 exposes a case where calling lowerShuffleWithSHUFPS directly from a derived repeated mask (found by is128BitLaneRepeatedShuffleMask) results in us using an non-canonicalized mask.

The missed canonicalization in this case is trivial - just commute the mask so we have more (swapped) LHS than RHS references so lowerShuffleWithSHUFPS can handle it.
llvm/lib/Target/X86/X86ISelLowering.cpp
llvm/test/CodeGen/X86/vector-shuffle-avx512.ll