[PATCH] D15477: [X86][AVX] Only shuffle the lower half of vectors if the upper half is undefined

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Sat Dec 12 06:17:22 PST 2015


RKSimon created this revision.
RKSimon added reviewers: andreadb, spatel, congh, delena.
RKSimon added a subscriber: llvm-commits.
RKSimon set the repository for this revision to rL LLVM.

First step towards making better use of AVX's implicit zeroing of the upper half of a 256-bit vector by instructions that only act on the lower 128-bit vector - discussed on D14151. 

As well as the fact that 128-bit shuffle instructions are generally more capable, this can be performant for older CPUs with 128-bit ALUs (e.g. Jaguar, Sandy Bridge) that must treat 256-bit vectors as multiple micro-ops.

Note: I've avoided combining shuffles that reference elements from the upper halves of the input vectors - this may be reviewed in future work as well (AVX1 would probably always gain, but AVX2 does have some cross-lane shuffle instructions).

Repository:
  rL LLVM

http://reviews.llvm.org/D15477

Files:
  lib/Target/X86/X86ISelLowering.cpp
  test/CodeGen/X86/vector-shuffle-256-v16.ll
  test/CodeGen/X86/vector-shuffle-256-v32.ll
  test/CodeGen/X86/vector-shuffle-256-v4.ll
  test/CodeGen/X86/vector-shuffle-256-v8.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D15477.42638.patch
Type: text/x-patch
Size: 9090 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20151212/9b4ba3aa/attachment.bin>


More information about the llvm-commits mailing list