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

Renato Golin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 28 05:58:30 PDT 2023


rengolin 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);
----------------
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.


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