[PATCH] D76956: [TTI][SLP] Add TTI interface to estimate cost of chain of vector inserts/extracts.
Valeriy Dmitriev via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Mar 31 09:22:30 PDT 2020
vdmitrie marked 2 inline comments as done.
vdmitrie added inline comments.
================
Comment at: llvm/include/llvm/Analysis/TargetTransformInfoImpl.h:475
+ ArrayRef<unsigned> Indices) {
+ return Indices.size();
+ }
----------------
lebedev.ri wrote:
> I wonder if this should be
> ```
> return std::accumulate(Indices.begin(), Indices.end(), unsigned(0),
> [&](unsigned CostSoFar, unsigned Index) {
> return CostSoFar + getVectorInstrCost(Opcode, Val, Index);
> }
> );
> ```
> or this is too advanced for this particular impl
I see your point. There is an assumption here that cost is one per index. I agree that it is better to avoid any assumptions but I'd use just for loop here if you have no objections. Will fix it.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D76956/new/
https://reviews.llvm.org/D76956
More information about the llvm-commits
mailing list