[PATCH] D141602: [TTI][AArch64] Cost model insertelement and indexed LD1 instructions

Sjoerd Meijer via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 23 03:16:20 PST 2023


SjoerdMeijer added a comment.

In D141602#4072537 <https://reviews.llvm.org/D141602#4072537>, @dmgreen wrote:

> Im happy for the change to go in, I think. It changes the total cost of load+insert from 1+3 to 1+4 which isnt a huge increase. It sounds OK to me, although it was already fairly high before and there is a chance we might want to adjust it in the future if we have good reason.

Ok, cheers, sounds good.
I will follow up today/tomorrow as I think we can lower the cost for a "MOV v1[1], v2[1]" type of element insertion, as they are actually cheap instructions on modern cores. I think that would reflect things a lot better; it would make the indexed LD1 (cost 4) two times more expensive than an MOV/INS (cost 2, which is 3 at the moment). But I will run SPEC for this today to see if I am not missing anything.

> Can you change it to `ST->getVectorInsertExtractBaseCost() + 1`?

Ah, sorry, I thought I did, I must have uploaded a different/wrong diff.


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

https://reviews.llvm.org/D141602



More information about the llvm-commits mailing list