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

ShihPo Hung via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Jun 3 09:58:30 PDT 2023


arcbbb added inline comments.


================
Comment at: llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp:1526
+    BaseCost += 2;
+
   return BaseCost + SlideCost;
----------------
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.


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