[PATCH] D158716: [RFC][LV] VPlan-based cost model

Kolya Panchenko via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 11 14:31:48 PDT 2023


nikolaypanchenko added inline comments.


================
Comment at: llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:8707
+      if (CostUsingVPlan) {
+        VPlanCostModel VPCM(*Plan, *TTI, CM);
+        C.first = VPCM.expectedCost(CostVF, C.second);
----------------
arcbbb wrote:
> rengolin wrote:
> > It's costly to create this object in every inner loop.
> > 
> > This should either be hoisted to the outer loop, or outside of the loop altogether if you allow `expectedCost` to have the `Plan` as an argument, since it's the only function in `VPlanCostModel` that uses it.
> Good point!
Cost model may eventually have a state to track context information. Even though it's possible to have a single instance of VPCM, but this is going to add extra boilerplate to manage that state.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D158716



More information about the llvm-commits mailing list