[PATCH] D152001: [RISCV][SLP] Inflate insert/extract costs on very small vectors

Philip Reames via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 5 08:45:41 PDT 2023


reames added inline comments.


================
Comment at: llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp:1526
+    BaseCost += 2;
+
   return BaseCost + SlideCost;
----------------
arcbbb wrote:
> arcbbb wrote:
> > Is it needed for CostKind == TTI::TCK_CodeSize ?
> > 
> > I was thinking the total cost was composed of vmv instruction (BaseCost) and vslide instruction (SlideCost).
> > IIUC, BaseCost includes vector-scalar communication cost, and the addend `2` here accounts for this.
> Considering that the addend accounts for the communication cost, it may not be necessary to impose limitations on the VF.
This change is not about modeling the cost of the instruction - that should already be accounted for in the existing code.  It's about artificially biasing the cost so as to influence the primary consumer against unprofitable decisions.  

If you believe BaseCost is too low, please feel free to suggest an alternate patch with the motivation of why you believe this better explained.  


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D152001



More information about the llvm-commits mailing list