[PATCH] D63661: [SLPVectorizer] Operand reordering across multiple instructions.

Vasileios Porpodas via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 21 11:50:16 PDT 2019


vporpo created this revision.
vporpo added reviewers: RKSimon, dtemirbulatov, ABataev, hfinkel, spatel, Ayal, dorit.
vporpo added a project: LLVM.
Herald added a subscriber: llvm-commits.

This patch implements operand reordering across trees of Add/Subs, referred to as "SuperNodes".
For example, it helps vectorize code like this:
S[0] = (A[0] - B[0]) - C[0]
S[1] = (B[1] + C[1]) + A[1]
A more detailed description of the technique can be found here: http://www.llvm.org/devmtg/2019-04/slides/Poster-Porpodas-Supernode_SLP.pdf.

The two main changes introduced by this patch are:
i. The SuperNode class that represents the Add/Sub trees and their immediate operands that we are reordering.
ii. A local change in the buildTree_rec() recursion that forms the SuperNode.

Please note that this patch depends on the scheduler changes of D62432 <https://reviews.llvm.org/D62432>.


Repository:
  rL LLVM

https://reviews.llvm.org/D63661

Files:
  lib/Transforms/Vectorize/SLPVectorizer.cpp
  test/Transforms/SLPVectorizer/X86/lookahead.ll
  test/Transforms/SLPVectorizer/X86/supernode.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D63661.206038.patch
Type: text/x-patch
Size: 55124 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190621/3058ad69/attachment-0001.bin>


More information about the llvm-commits mailing list