[X86][SSE] Attempt to fold shuffle(binop(),binop()) -> binop(shuffle(),shuffle())
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Fri, 15 Jan 2021 16:25:05 +0000 (16:25 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Fri, 15 Jan 2021 16:25:25 +0000 (16:25 +0000)
commitbe69e66b1cd826f499566e1c3dadbf04e872baa0
tree94623d560d3568d74a9e7c4ef38bd45890f220a8
parent1a497ae9b83653682d6d20f1ec131394e523375d
[X86][SSE] Attempt to fold shuffle(binop(),binop()) -> binop(shuffle(),shuffle())

If this will help us fold shuffles together, then push the shuffle through the merged binops.

Ideally this would be performed in DAGCombiner::visitVECTOR_SHUFFLE but getting an efficient+legal merged shuffle can be tricky - on SSE we can be confident that for 32/64-bit elements vectors shuffles should easily fold.
llvm/lib/Target/X86/X86ISelLowering.cpp
llvm/test/CodeGen/X86/haddsub-shuf.ll