[X86][SSE] Improved (v)insertps shuffle matching
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Sat, 10 Jan 2015 19:45:33 +0000 (19:45 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Sat, 10 Jan 2015 19:45:33 +0000 (19:45 +0000)
commit94a4cc027ab111f6055c81605b3a47caae46cbe6
tree74d042f49c41355e385be63621f7e5df8d2e771a
parent9be98b6bef38904c95c1508aee3e901620681388
[X86][SSE] Improved (v)insertps shuffle matching

In the current code we only attempt to match against insertps if we have exactly one element from the second input vector, irrespective of how much of the shuffle result is zeroable.

This patch checks to see if there is a single non-zeroable element from either input that requires insertion. It also supports matching of cases where only one of the inputs need to be referenced.

We also split insertps shuffle matching off into a new lowerVectorShuffleAsInsertPS function.

Differential Revision: http://reviews.llvm.org/D6879

llvm-svn: 225589
llvm/lib/Target/X86/X86ISelLowering.cpp
llvm/test/CodeGen/X86/combine-or.ll
llvm/test/CodeGen/X86/masked_memop.ll
llvm/test/CodeGen/X86/vector-shuffle-combining.ll