[PATCH] D135282: [SLP]Improve costs of vectorized loads/stores by analyzing GEPs.

Alexey Bataev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 5 09:29:34 PDT 2022


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

When generating masked gathers nodes, SLP vectorizer accounts the cost
of the GEPs for loads as part of the scalar-vector transformation cost
estimation. But it does not do it for vectorized loads/stores, while it
may completely remove some of the GEPs completely. Because of this in
some cases masked gather operation can be much more profitable rather
than regular vectorization (masked-gather cost + vector GEP - scalar
loads + GEPs comparing to vectorized loads - scalar loads).
Added the analysis of the removed scalarGEPs for vectorized load/store nodes for better cost estimation.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D135282

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D135282.465438.patch
Type: text/x-patch
Size: 5657 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221005/1f9d861c/attachment.bin>


More information about the llvm-commits mailing list