[PATCH] D31373: [X86][SSE]] Lower BUILD_VECTOR with repeated ops as BUILD_VECTOR + VECTOR_SHUFFLE

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Mar 26 05:58:05 PDT 2017


RKSimon created this revision.

It can be costly to transfer from the gprs to the xmm registers and can prevent loads merging.

This patch splits vXi16/vXi32/vXi64 BUILD_VECTORS that use the same operand in multiple elements into a BUILD_VECTOR with only a single insertion of each of those elements and then performs an unary shuffle to duplicate the values.

There are a couple of minor regressions this patch unearths due to some missing MOVDDUP/BROADCAST folds that I will address in a future patch.

Note: Now that vector shuffle lowering and combining is pretty good we should be reusing that instead of duplicating so much in LowerBUILD_VECTOR - this is the first of several patches to address this.


Repository:
  rL LLVM

https://reviews.llvm.org/D31373

Files:
  lib/Target/X86/X86ISelLowering.cpp
  test/CodeGen/X86/avx-intrinsics-fast-isel.ll
  test/CodeGen/X86/avx-vbroadcast.ll
  test/CodeGen/X86/avx2-vbroadcast.ll
  test/CodeGen/X86/merge-consecutive-loads-128.ll
  test/CodeGen/X86/sse2-intrinsics-fast-isel.ll
  test/CodeGen/X86/vec_fp_to_int.ll
  test/CodeGen/X86/vec_int_to_fp.ll
  test/CodeGen/X86/vector-sext.ll
  test/CodeGen/X86/vector-shuffle-combining-xop.ll
  test/CodeGen/X86/vshift-1.ll
  test/CodeGen/X86/vshift-2.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D31373.93069.patch
Type: text/x-patch
Size: 18776 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170326/64bad4bf/attachment.bin>


More information about the llvm-commits mailing list