[X86][SSE] lowerShuffleAsDecomposedShuffleBlend - support decomposed unpacks for...
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Sat, 12 Sep 2020 12:39:33 +0000 (13:39 +0100)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Sat, 12 Sep 2020 12:39:33 +0000 (13:39 +0100)
commit35dc91aee2013ce1a57dfee965fa5fdee1987ee0
treeaf933a5f48ac8536dd35f4fc14be0db294db8710
parent4ede83c06831adf5bf5e4a2abffd752615f643d0
[X86][SSE] lowerShuffleAsDecomposedShuffleBlend - support decomposed unpacks for some vXi8/vXi16 cases

Follow up to D86429 to handle the remaining regressions.

This patch generalizes lowerShuffleAsDecomposedShuffleBlend to lowerShuffleAsDecomposedShuffleMerge, and attempts to use an UNPCKL shuffle mask instead of a blend for the cases where the inputs are coming from alternating vXi8/vXi16 sources. Technically they don't have to be alternating (just as long as they can fit into a lower lane half for the unpack) but I didn't find as many general cases and it needed a lot more of the function to be altered.

For vXi32/vXi64 cases this could still be beneficial but in most cases the existing permute+blend approach was better.

Differential Revision: https://reviews.llvm.org/D87405
llvm/lib/Target/X86/X86ISelLowering.cpp
llvm/test/CodeGen/X86/vector-shuffle-128-v16.ll
llvm/test/CodeGen/X86/vector-shuffle-256-v16.ll
llvm/test/CodeGen/X86/vector-shuffle-256-v32.ll
llvm/test/CodeGen/X86/vector-shuffle-512-v32.ll