[PATCH] D133007: [RISCV] Add cost model for vector insert/extract element.

Jianjian Guan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 2 01:53:48 PDT 2022


jacquesguan added inline comments.


================
Comment at: llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp:825
+  }
+  return BaseCost + SlideCost;
+}
----------------
reames wrote:
> I think we're missing something here.  Specifically, what is the appropriate cost for an illegally typed vector which has been split?  Don't we need to account for the cost of figuring out which sub-vector to extract from/insert into?  For constants, this should fold away, but for a non-constant index doesn't this require some logic?
I missed considerring the case of splitted vector. In this case, we would use stack store/load to make it. I added it now.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D133007



More information about the llvm-commits mailing list