[PATCH] D125111: [SLP] Make reordering aware of external vectorizable scalar stores.

Vasileios Porpodas via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 6 11:25:48 PDT 2022


vporpo created this revision.
vporpo added reviewers: ABataev, RKSimon, dmgreen, vdmitrie.
Herald added a subscriber: hiraditya.
Herald added a project: All.
vporpo requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

The current reordering scheme only checks the ordering of in-tree operands.
There are some cases, however, where we need to adjust the ordering based on
the ordering of a future SLP-tree who's instructions are not part of the
current tree, but are external users.

This patch is a simple implementation of this. We keep track of scalar stores
that are users of TreeEntries and if they look profitable to vectorize, then
we keep track of their ordering. During the reordering step we take this new
index order into account. This can remove some shuffles in cases like in the
lit test.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D125111

Files:
  llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
  llvm/test/Transforms/SLPVectorizer/X86/reorder_with_external_users.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D125111.427688.patch
Type: text/x-patch
Size: 11477 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220506/17f1576e/attachment.bin>


More information about the llvm-commits mailing list