[x86] Remove the insanely over-aggressive unpack lowering strategy for
authorChandler Carruth <chandlerc@gmail.com>
Thu, 19 Feb 2015 12:10:37 +0000 (12:10 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Thu, 19 Feb 2015 12:10:37 +0000 (12:10 +0000)
commit3d4542ce3da1cb0782c65d38130556a00ed2586d
tree1b305b442c3daa861db6856aad1bee76d45a771b
parentbb539d3b4c7f5e933d0f585f9e766f21965c5881
[x86] Remove the insanely over-aggressive unpack lowering strategy for
v16i8 shuffles, and replace it with new facilities.

This uses precise patterns to match exact unpacks, and the new
generalized unpack lowering only when we detect a case where we will
have to shuffle both inputs anyways and they terminate in exactly
a blend.

This fixes all of the blend horrors that I uncovered by always lowering
blends through the vector shuffle lowering. It also removes *sooooo*
much of the crazy instruction sequences required for v16i8 lowering
previously. Much cleaner now.

The only "meh" aspect is that we sometimes use pshufb+pshufb+unpck when
it would be marginally nicer to use pshufb+pshufb+por. However, the
difference there is *tiny*. In many cases its a win because we re-use
the pshufb mask. In others, we get to avoid the pshufb entirely. I've
left a FIXME, but I'm dubious we can really do better than this. I'm
actually pretty happy with this lowering now.

For SSE2 this exposes some horrors that were really already there. Those
will have to fixed by changing a different path through the v16i8
lowering.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229846 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/X86/X86ISelLowering.cpp
test/CodeGen/X86/avx2-conversions.ll
test/CodeGen/X86/vec_cast2.ll
test/CodeGen/X86/vector-blend.ll
test/CodeGen/X86/vector-shuffle-128-v16.ll
test/CodeGen/X86/vector-shuffle-256-v32.ll
test/CodeGen/X86/vector-trunc.ll