[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 06:26:42 PDT 2022


ABataev added inline comments.


================
Comment at: llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:5786-5787
+namespace {
+// Helper to keep track of the extracted elements to compute an accumulated
+// scalarization extraction cost.
+class ScalarizationOverheadBuilder {
----------------
///


================
Comment at: llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:5789
+class ScalarizationOverheadBuilder {
+  // Keep track of demanded elements by source vector or type.
+  typedef DenseMap<Value *, APInt> ExtractByClass;
----------------
///


================
Comment at: llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:5793
+
+  // TODO: Add getExtractWithExtendCost support to getScalarizationOverhead.
+  struct ExtractWithExtendOps {
----------------
///


================
Comment at: llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:5817-5818
+
+  // Add an extraction from a vector type and specific element index.
+  // We assume that all extractions from a given type are from the same source.
+  void addExtract(FixedVectorType *VecTy, unsigned Idx) {
----------------
///


================
Comment at: llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:5828
+
+  // Add an extended extraction from a specific source and element index.
+  void addExtractWithExtend(unsigned Opcode, Type *SclTy,
----------------
///


================
Comment at: llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:5835
+
+  // Determine the accumulated scalarization cost for the specified extractions.
+  InstructionCost getCost(const TargetTransformInfo *TTI) {
----------------
///


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