[PATCH] D42086: [X86] Teach LowerBUILD_VECTOR to recognize pair-wise splats of 32-bit elements and use a 64-bit broadcast

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 15 13:58:32 PST 2018


craig.topper created this revision.
craig.topper added reviewers: RKSimon, spatel.

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.

Looks like we may still need a DAG combine for VBROADCAST + VZEXT_LOAD to fold the loads in insertelement-shuffle.ll and vector-shuffle-combining-xop.ll


https://reviews.llvm.org/D42086

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D42086.129904.patch
Type: text/x-patch
Size: 13861 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180115/e392d867/attachment.bin>


More information about the llvm-commits mailing list