[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)
commit47abf0e3da3b26a63c1f2e31dfde52afa01ef60a
treef3cb46ef8e30eb25b81984713af30079826288db
parentdc857fefdcde7779602ffc616129efcc77112412
[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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225589 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/X86/X86ISelLowering.cpp
test/CodeGen/X86/combine-or.ll
test/CodeGen/X86/masked_memop.ll
test/CodeGen/X86/vector-shuffle-combining.ll