[PATCH] D134605: [SLP] Add ScalarizationOverheadBuilder helper to track vector extractions

Alexey Bataev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 26 05:41:43 PDT 2022


ABataev added a comment.

In D134605#3814520 <https://reviews.llvm.org/D134605#3814520>, @RKSimon wrote:

> Actually, I'm not sure if I should alter it - although the style guide recommends keeping just the declarations inside the namespace ("make anonymous namespaces as small as possible"), SLP appears to always keep the implementations there as well. @ABataev any preference?

It is local and small enough, so I believe we can keep it as is.



================
Comment at: llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:5788
+// scalarization extraction cost.
+struct ScalarizationOverheadBuilder {
+  // Keep track of demanded elements by source vector or type.
----------------
Class?


================
Comment at: llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:5834-5839
+    for (auto &It : ExtractWithExtends)
+      Cost +=
+          TTI->getExtractWithExtendCost(It.Opcode, It.SclTy, It.VecTy, It.Idx);
+    for (auto &It : ExtractByType)
+      Cost += TTI->getScalarizationOverhead(It.first, It.second, false, true);
+    for (auto &It : ExtractByClass)
----------------
Expand auto


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D134605/new/

https://reviews.llvm.org/D134605



More information about the llvm-commits mailing list