[PATCH] D57156: [x86] narrow a shuffle that doesn't use or set any high elements

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 24 07:20:09 PST 2019


spatel created this revision.
spatel added reviewers: RKSimon, craig.topper, andreadb.
Herald added a subscriber: mcrosier.

This isn't the final fix for our reduction/horizontal codegen, but it takes care of a lot of the problems. After we narrow the shuffle, existing combines for insert/extract and binops kick in, and we end up with cheaper 128-bit ops.

The avg and mul reduction tests show an existing shuffle lowering hole for AVX2/AVX512. I think in its most minimal form this is:
https://bugs.llvm.org/show_bug.cgi?id=40434
...but we might need multiple fixes to get it right. I could try to patch that first to avoid the regression if that seems like a bigger loss than the wins in the other tests.


https://reviews.llvm.org/D57156

Files:
  lib/Target/X86/X86ISelLowering.cpp
  test/CodeGen/X86/avg.ll
  test/CodeGen/X86/avx512-hadd-hsub.ll
  test/CodeGen/X86/madd.ll
  test/CodeGen/X86/min-legal-vector-width.ll
  test/CodeGen/X86/sad.ll
  test/CodeGen/X86/vector-compare-all_of.ll
  test/CodeGen/X86/vector-compare-any_of.ll
  test/CodeGen/X86/vector-reduce-add-widen.ll
  test/CodeGen/X86/vector-reduce-add.ll
  test/CodeGen/X86/vector-reduce-and-widen.ll
  test/CodeGen/X86/vector-reduce-and.ll
  test/CodeGen/X86/vector-reduce-fadd-fast.ll
  test/CodeGen/X86/vector-reduce-fmul-fast.ll
  test/CodeGen/X86/vector-reduce-mul-widen.ll
  test/CodeGen/X86/vector-reduce-mul.ll
  test/CodeGen/X86/vector-reduce-or-widen.ll
  test/CodeGen/X86/vector-reduce-or.ll
  test/CodeGen/X86/vector-reduce-xor-widen.ll
  test/CodeGen/X86/vector-reduce-xor.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D57156.183309.patch
Type: text/x-patch
Size: 363446 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190124/6511e71e/attachment-0001.bin>


More information about the llvm-commits mailing list