X86: Do splat promotion later, so the optimizer can chew on it first.
authorBenjamin Kramer <benny.kra@googlemail.com>
Sat, 26 Jan 2013 11:44:21 +0000 (11:44 +0000)
committerBenjamin Kramer <benny.kra@googlemail.com>
Sat, 26 Jan 2013 11:44:21 +0000 (11:44 +0000)
commit99c68dd964ef7f68970f5f9be81092c29fd1ec64
treece3aa42e2ac189eb7598e3fac3fc425b8c11b8db
parent7268a05178505fc5f0c3a9ab373636e4cc16918c
X86: Do splat promotion later, so the optimizer can chew on it first.

This catches many cases where we can emit a more efficient shuffle for a
specific mask or when the mask contains undefs. Once the splat is lowered to
unpacks we can't do that anymore.

There is a possibility of moving the promotion after pshufb matching, but I'm
not sure if pshufb with a mask loaded from memory is faster than 3 shuffles, so
I avoided that for now.

llvm-svn: 173569
llvm/lib/Target/X86/X86ISelLowering.cpp
llvm/test/CodeGen/X86/avx-splat.ll
llvm/test/CodeGen/X86/vec_splat-3.ll