[X86] Teach LowerBUILD_VECTOR to recognize pair-wise splats of 32-bit elements and...
authorCraig Topper <craig.topper@intel.com>
Wed, 17 Jan 2018 18:58:22 +0000 (18:58 +0000)
committerCraig Topper <craig.topper@intel.com>
Wed, 17 Jan 2018 18:58:22 +0000 (18:58 +0000)
commitb70ca5060fea321748e1b40e9165ad410c4f12ae
treea6b094d1f02583e5578ec5109bb064ef35019c13
parenta14a1f923f45381ba96acd5246506b470ae7b23c
[X86] Teach LowerBUILD_VECTOR to recognize pair-wise splats of 32-bit elements and use a 64-bit broadcast

If we are splatting pairs of 32-bit elements, we can use a 64-bit broadcast to get the job done.

We could probably could probably do this with other sizes too, for example four 16-bit elements. Or we could broadcast pairs of 16-bit elements using a 32-bit element broadcast. But I've left that as a future improvement.

I've also restricted this to AVX2 only because we can only broadcast loads under AVX.

Differential Revision: https://reviews.llvm.org/D42086

llvm-svn: 322730
llvm/lib/Target/X86/X86ISelLowering.cpp
llvm/test/CodeGen/X86/avx2-vbroadcast.ll
llvm/test/CodeGen/X86/avx512-intrinsics-fast-isel.ll
llvm/test/CodeGen/X86/avx512vl-intrinsics-fast-isel.ll
llvm/test/CodeGen/X86/broadcastm-lowering.ll
llvm/test/CodeGen/X86/insertelement-shuffle.ll
llvm/test/CodeGen/X86/vector-shuffle-combining-xop.ll