[x86] Teach the new vector shuffle lowering to use AVX2 instructions for
authorChandler Carruth <chandlerc@gmail.com>
Thu, 25 Sep 2014 11:03:55 +0000 (11:03 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Thu, 25 Sep 2014 11:03:55 +0000 (11:03 +0000)
commit4b667ee436404a241562c687b50b68a17147330a
tree8af0b1c37b0e87f7800e02e48ea118bca157b772
parentb10671bb850ffd3ea4fcf79431f37a59f0deed61
[x86] Teach the new vector shuffle lowering to use AVX2 instructions for
v4f64 and v8f32 shuffles when they are lane-crossing. We have fully
general lane-crossing permutation functions in AVX2 that make this easy.

Part of this also changes exactly when and how these vectors are split
up when we don't have AVX2. This isn't always a win but it usually is
a win, so on the balance I think its better. The primary regressions are
all things that just need to be fixed anyways such as modeling when
a blend can be completely accomplished via VINSERTF128, etc.

Also, this highlights one of the few remaining big features: we do
a really poor job of inserting elements into AVX registers efficiently.

This completes almost all of the big tricks I have in mind for AVX2. The
only things left that I plan to add:

1) element insertion smarts
2) palignr and other fairly specialized lowerings when they happen to
   apply

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@218449 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/X86/X86ISelLowering.cpp
test/CodeGen/X86/vector-shuffle-256-v4.ll
test/CodeGen/X86/vector-shuffle-256-v8.ll