[PATCH] D102933: [SLP]Fix cost/emission of externally used extractelements.

Alexey Bataev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 21 10:15:26 PDT 2021


ABataev created this revision.
ABataev added reviewers: RKSimon, spatel, vdmitrie, anton-afanasyev, dtemirbulatov.
Herald added a subscriber: hiraditya.
ABataev requested review of this revision.
Herald added a project: LLVM.

If the scalar is marked as externally used, we need to include its cost
in the final cost estimation and generate extract element for it. But
for extractelement scalars we do not need to do this. Originally, we

  subtract the cost of the extractelement instructions iff they are
  removed (if they are used only in the tree) and otherwise we do not
  include them in the cost. It means that we already included these
  extractelements in the cost, no need to add an extra cost for them.
  Just need to regenerate the original extractelement instruction, it
  may improve the final vectorization.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D102933

Files:
  llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
  llvm/test/Transforms/SLPVectorizer/AArch64/PR38339.ll
  llvm/test/Transforms/SLPVectorizer/AArch64/transpose-inseltpoison.ll
  llvm/test/Transforms/SLPVectorizer/AArch64/transpose.ll
  llvm/test/Transforms/SLPVectorizer/AArch64/vectorize-free-extracts-inserts.ll
  llvm/test/Transforms/SLPVectorizer/X86/extractelement.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D102933.347071.patch
Type: text/x-patch
Size: 24618 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210521/866b2287/attachment.bin>


More information about the llvm-commits mailing list