[llvm] [AArch64,TTI] Remove RealUse check for vector insert/extract costs. (PR #146526)

David Green via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 2 02:11:36 PDT 2025


davemgreen wrote:

See also #138811, which did less than this patch as it left the insert-into-undef in place. That is part of a splat pattern
```
  %insert = insertelement <4 x i32> poison, i32 %scalar, i32 0
  %splat = shufflevector <4 x i32> %insert, <4 x i32> poison, <4 x i32> zeroinitializer
```
That should probably have a total cost ~ the same as a gpr->fpr insert (so ~2 in total). Currently it is a little lower I believe, at 1 for the two instructions. Do we go to a cost of 3 now?

I mostly didn't push it yet because of the multiple_reduction.ll case. It is a clear regression but you can argue that it was only correct by accident in the past.

There is also the question of things that are actually in FPR regs already, but I'm not sure how to address that. I'm not sure what to suggest needs fixing exactly, I think this patch is probably fine and a step towards more correct values. Do you have any opinion on the splat case and whether the SLP issue is possible to address?

https://github.com/llvm/llvm-project/pull/146526


More information about the llvm-commits mailing list