[PATCH] D115757: [SLP]Generalize cost model.

Alexey Bataev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 13 14:17:06 PDT 2022


ABataev added inline comments.


================
Comment at: llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:6331
+  const unsigned Sz = VL.size();
+  auto &&GetCostDiff =
+      [this, E, Sz, CommonCost,
----------------
vdmitrie wrote:
> ABataev wrote:
> > vdmitrie wrote:
> > > Do you have a specific reason to keep this as lambda(lambda(...),lambda(...)) design?
> > > I mean this would look much better if you make one more step and outline this into a separate class  (for example CostDifferentiator) with dedicated methods instead of stuffing code with tons of lambdas.
> > It will still have lambdas for each particular opcode
> Why? It is not prohibited to have dedicated method in the class for each particular opcode. 
> 
> 
It still will be a switch with functions calls, which have the pretty similar loops and other processing. This what exactly I want to avoid - duplicate of the code.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D115757



More information about the llvm-commits mailing list