[x86] Enable the new vector shuffle lowering by default.
authorChandler Carruth <chandlerc@gmail.com>
Sat, 4 Oct 2014 03:52:55 +0000 (03:52 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Sat, 4 Oct 2014 03:52:55 +0000 (03:52 +0000)
commit03a77831cc5019b287e7f5be109f44b302e63ffd
treea3dccefbeffec3538c15b5aee196574070014ef3
parentea1cccd0b688bc7d5b5e63fb2292d09d151bc425
[x86] Enable the new vector shuffle lowering by default.

Update the entire regression test suite for the new shuffles. Remove
most of the old testing which was devoted to the old shuffle lowering
path and is no longer relevant really. Also remove a few other random
tests that only really exercised shuffles and only incidently or without
any interesting aspects to them.

Benchmarking that I have done shows a few small regressions with this on
LNT, zero measurable regressions on real, large applications, and for
several benchmarks where the loop vectorizer fires in the hot path it
shows 5% to 40% improvements for SSE2 and SSE3 code running on Sandy
Bridge machines. Running on AMD machines shows even more dramatic
improvements.

When using newer ISA vector extensions the gains are much more modest,
but the code is still better on the whole. There are a few regressions
being tracked (PR21137, PR21138, PR21139) but by and large this is
expected to be a win for x86 generated code performance.

It is also more correct than the code it replaces. I have fuzz tested
this extensively with ISA extensions up through AVX2 and found no
crashes or miscompiles (yet...). The old lowering had a few miscompiles
and crashers after a somewhat smaller amount of fuzz testing.

There is one significant area where the new code path lags behind and
that is in AVX-512 support. However, there was *extremely little*
support for that already and so this isn't a significant step backwards
and the new framework will probably make it easier to implement lowering
that uses the full power of AVX-512's table-based shuffle+blend (IMO).

Many thanks to Quentin, Andrea, Robert, and others for benchmarking
assistance. Thanks to Adam and others for help with AVX-512. Thanks to
Hal, Eric, and *many* others for answering my incessant questions about
how the backend actually works. =]

I will leave the old code path in the tree until the 3 PRs above are at
least resolved to folks' satisfaction. Then I will rip it (and 1000s of
lines of code) out. =] I don't expect this flag to stay around for very
long. It may not survive next week.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219046 91177308-0d34-0410-b5e6-96231b3b80d8
91 files changed:
lib/Target/X86/X86ISelLowering.cpp
test/CodeGen/X86/2008-06-18-BadShuffle.ll [deleted file]
test/CodeGen/X86/2009-04-21-NoReloadImpDef.ll [deleted file]
test/CodeGen/X86/2012-04-26-sdglue.ll
test/CodeGen/X86/avx-basic.ll
test/CodeGen/X86/avx-intrinsics-x86.ll
test/CodeGen/X86/avx-movdup.ll [deleted file]
test/CodeGen/X86/avx-shuffle.ll [deleted file]
test/CodeGen/X86/avx-splat.ll
test/CodeGen/X86/avx-vmovddup.ll [deleted file]
test/CodeGen/X86/avx-vperm2x128.ll
test/CodeGen/X86/avx-vpermil.ll [deleted file]
test/CodeGen/X86/avx-vshufp.ll [deleted file]
test/CodeGen/X86/avx2-palignr.ll [deleted file]
test/CodeGen/X86/avx2-shuffle.ll [deleted file]
test/CodeGen/X86/avx2-unpack.ll [deleted file]
test/CodeGen/X86/avx2-vbroadcast.ll
test/CodeGen/X86/avx512-arith.ll
test/CodeGen/X86/avx512-build-vector.ll
test/CodeGen/X86/avx512-shuffle.ll [deleted file]
test/CodeGen/X86/avx512-vbroadcast.ll
test/CodeGen/X86/avx512-vec-cmp.ll
test/CodeGen/X86/combine-or.ll
test/CodeGen/X86/exedepsfix-broadcast.ll
test/CodeGen/X86/extractelement-load.ll
test/CodeGen/X86/fp-load-trunc.ll
test/CodeGen/X86/fp-trunc.ll
test/CodeGen/X86/palignr.ll
test/CodeGen/X86/pmul.ll
test/CodeGen/X86/pr11334.ll
test/CodeGen/X86/pr12359.ll [deleted file]
test/CodeGen/X86/sincos-opt.ll
test/CodeGen/X86/splat-scalar-load.ll [deleted file]
test/CodeGen/X86/sse-align-12.ll
test/CodeGen/X86/sse-scalar-fp-arith.ll
test/CodeGen/X86/sse1.ll
test/CodeGen/X86/sse2-mul.ll [deleted file]
test/CodeGen/X86/sse2.ll
test/CodeGen/X86/sse3.ll
test/CodeGen/X86/sse41.ll
test/CodeGen/X86/swizzle-2.ll
test/CodeGen/X86/swizzle.ll [deleted file]
test/CodeGen/X86/trunc-ext-ld-st.ll
test/CodeGen/X86/uint_to_fp-2.ll
test/CodeGen/X86/v2f32.ll
test/CodeGen/X86/vec_cast2.ll
test/CodeGen/X86/vec_extract-sse4.ll
test/CodeGen/X86/vec_extract.ll
test/CodeGen/X86/vec_insert-5.ll
test/CodeGen/X86/vec_set-3.ll
test/CodeGen/X86/vec_set-5.ll [deleted file]
test/CodeGen/X86/vec_set-9.ll [deleted file]
test/CodeGen/X86/vec_set-E.ll [deleted file]
test/CodeGen/X86/vec_set-I.ll [deleted file]
test/CodeGen/X86/vec_set-J.ll [deleted file]
test/CodeGen/X86/vec_shuffle-11.ll [deleted file]
test/CodeGen/X86/vec_shuffle-14.ll [deleted file]
test/CodeGen/X86/vec_shuffle-15.ll [deleted file]
test/CodeGen/X86/vec_shuffle-16.ll [deleted file]
test/CodeGen/X86/vec_shuffle-17.ll [deleted file]
test/CodeGen/X86/vec_shuffle-18.ll [deleted file]
test/CodeGen/X86/vec_shuffle-19.ll [deleted file]
test/CodeGen/X86/vec_shuffle-20.ll [deleted file]
test/CodeGen/X86/vec_shuffle-22.ll [deleted file]
test/CodeGen/X86/vec_shuffle-23.ll [deleted file]
test/CodeGen/X86/vec_shuffle-24.ll [deleted file]
test/CodeGen/X86/vec_shuffle-25.ll [deleted file]
test/CodeGen/X86/vec_shuffle-26.ll [deleted file]
test/CodeGen/X86/vec_shuffle-27.ll [deleted file]
test/CodeGen/X86/vec_shuffle-28.ll [deleted file]
test/CodeGen/X86/vec_shuffle-30.ll [deleted file]
test/CodeGen/X86/vec_shuffle-31.ll [deleted file]
test/CodeGen/X86/vec_shuffle-34.ll [deleted file]
test/CodeGen/X86/vec_shuffle-35.ll [deleted file]
test/CodeGen/X86/vec_shuffle-36.ll [deleted file]
test/CodeGen/X86/vec_shuffle-37.ll [deleted file]
test/CodeGen/X86/vec_shuffle-38.ll [deleted file]
test/CodeGen/X86/vec_shuffle-39.ll [deleted file]
test/CodeGen/X86/vec_shuffle-40.ll [deleted file]
test/CodeGen/X86/vec_shuffle-41.ll [deleted file]
test/CodeGen/X86/vec_shuffle.ll [deleted file]
test/CodeGen/X86/vec_splat-2.ll [deleted file]
test/CodeGen/X86/vec_splat-3.ll [deleted file]
test/CodeGen/X86/vec_splat.ll [deleted file]
test/CodeGen/X86/vector-blend.ll
test/CodeGen/X86/vector-idiv.ll
test/CodeGen/X86/vector-sext.ll
test/CodeGen/X86/vector-shuffle-combining.ll
test/CodeGen/X86/vector-zext.ll
test/CodeGen/X86/vselect.ll
test/CodeGen/X86/widen_shuffle-1.ll