[PATCH] D61308: [X86][SSE] Fold add(shuffle(),shuffle()) on 'slow' targets (PR39920)

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 30 06:43:35 PDT 2019


RKSimon created this revision.
RKSimon added reviewers: andreadb, craig.topper, spatel.
Herald added a project: LLVM.

As reported on PR39920, "slow horizontal ops" targets tend to internally expand to 2*shuffle+add/sub - so if we can reduce 2*shuffle+add/sub to a hadd/sub then we should do it - similar port usage but reduced instruction count.

This works out in most cases, although the "PR22377" regression in vector-shuffle-combining.ll is annoying - going from 2*shuffle+add+shuffle to hadd+2*shuffle - I'm open to suggestions - I've been trying to think of ways to get foldShuffleOfHorizOp to work with general shuffles but haven't found anything yet.


Repository:
  rL LLVM

https://reviews.llvm.org/D61308

Files:
  lib/Target/X86/X86ISelLowering.cpp
  test/CodeGen/X86/avx2-phaddsub.ll
  test/CodeGen/X86/haddsub-shuf.ll
  test/CodeGen/X86/haddsub-undef.ll
  test/CodeGen/X86/haddsub.ll
  test/CodeGen/X86/phaddsub.ll
  test/CodeGen/X86/vector-shuffle-combining.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D61308.197313.patch
Type: text/x-patch
Size: 84602 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190430/f435a5ce/attachment.bin>


More information about the llvm-commits mailing list