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)
commit11f2bf7f15a7d3b3df500f3f3e76355c888c23c7
tree8793680160364bf102d3384dc71a9d67159cc4fd
parent6bbc1421ce21388a3946a1f6db97b91b250c574f
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173569 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/X86/X86ISelLowering.cpp
test/CodeGen/X86/avx-splat.ll
test/CodeGen/X86/vec_splat-3.ll