[X86][SSE] combineX86ShuffleChain - combine INSERT_VECTOR_ELT patterns to INSERTPS
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Fri, 12 Jun 2020 10:30:00 +0000 (11:30 +0100)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Fri, 12 Jun 2020 10:59:01 +0000 (11:59 +0100)
commit8d30945ab96ab0d2a1e28b7668855b20ff258ccd
tree09984a0839c105bbabdc09de9353e2670b03204d
parent6196c379695ed8a6d0a2214d9107517ab55d4db7
[X86][SSE] combineX86ShuffleChain - combine INSERT_VECTOR_ELT patterns to INSERTPS

Noticed while trying to cleanup D66004 - if a shuffle operand came from a scalar, we're better off using INSERTPS vs UNPCKLPS as this is more likely to load fold later on. It also matches our existing BUILD_VECTOR lowering.

We can extend this to other PINSRB/D/Q/W cases in the future as the need arises.
llvm/lib/Target/X86/X86ISelLowering.cpp
llvm/test/CodeGen/X86/build-vector-128.ll
llvm/test/CodeGen/X86/vector-shuffle-combining-xop.ll