[PATCH] D150288: [SLP] Simplify `tryToVectorizeSequence()`

Vasileios Porpodas via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 10 11:41:24 PDT 2023


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

The original code attempted to vectorize the seed vector without first
separating the entries by `Type`, which complicated the code.
It would also try to slice the seed vector, but this seems to be redundant as
both `vectorizeStores()` and `tryToVectorizeList()` already do that internally.

With this patch the logic is quite simple:

1. First separate the seeds based on their `Type`, then
2. Sort the seeds of each `Type` using the `Comparator`
3. And finally go over each Type and try to vectorize it.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D150288

Files:
  llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
  llvm/test/Transforms/SLPVectorizer/AArch64/extractelements-to-shuffle.ll
  llvm/test/Transforms/SLPVectorizer/X86/insert-element-build-vector-inseltpoison.ll
  llvm/test/Transforms/SLPVectorizer/X86/insert-element-build-vector.ll
  llvm/test/Transforms/SLPVectorizer/X86/landing_pad.ll
  llvm/test/Transforms/SLPVectorizer/X86/multi-nodes-to-shuffle.ll
  llvm/test/Transforms/SLPVectorizer/X86/reduction-logical.ll
  llvm/test/Transforms/SLPVectorizer/X86/rgb_phi.ll
  llvm/test/Transforms/SLPVectorizer/slp-max-phi-size.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D150288.521059.patch
Type: text/x-patch
Size: 39566 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230510/8b6322e1/attachment.bin>


More information about the llvm-commits mailing list