[X86, SSE] instcombine common cases of insertps intrinsics into shuffles
authorSanjay Patel <spatel@rotateright.com>
Thu, 16 Apr 2015 17:52:13 +0000 (17:52 +0000)
committerSanjay Patel <spatel@rotateright.com>
Thu, 16 Apr 2015 17:52:13 +0000 (17:52 +0000)
commit81b61c0e50df451052b55b0c6dc4c2f866fe946f
treee5018e6fe2b72ca2389f0fdb83ffaae710856b4c
parent3cdbd163d054ac2821cdddeed96a77bf86a62a73
[X86, SSE] instcombine common cases of insertps intrinsics into shuffles

This is very similar to D8486 / r232852 (vperm2). If we treat insertps intrinsics
as shufflevectors, we can optimize them better.

I've left all but the full zero case of the zero mask variants out of this patch.
I don't think those can be converted into a single shuffle in all cases, but I'd
be happy to be proven wrong as I was for vperm2f128.

Either way, we'd need to support whatever sequence we come up with for those cases
in the backend before converting them here.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235124 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/InstCombine/InstCombineCalls.cpp
test/Transforms/InstCombine/x86-insertps.ll [new file with mode: 0644]