[llvm] [AArch64] - Improve costing for Identity shuffles for SVE targets. (PR #165375)

Pawan Nirpal via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 28 08:49:25 PDT 2025


pawan-nirpal-031 wrote:

> Hi. Can you either move the existing check for identity masks up or move the segmented-sve shuffles down below it?
> 
> Also adding a direct test for the cost in llvm/test/Analysis/CostModel/AArch64/ would be useful, and the test looks like it could be cleaned up a bit.

Hi Dave, thanks for your comment, if I understood you right are you referring to this comment from me? I tried moving the existing check above the SVE checks but I've run into the issues I mentioned in this comment. Basically in that case some existing shuffle patterns become expensive ( cost goes from 0 to 1 ) off the top of my head I recall shuffle-broadcast and there were two others. If I understood it wrong please correct. 

> I did not reuse code at line https://github.com/llvm/llvm-project/pull/165375/files#diff-d33095b8696ca8f1f17156f2d7809bc1efa994bae5fab2d84dae144304652e96R5954 as it caused shuffle costs of some broadcasts to change and lit test failures as a result, I intended to move that piece of code above this block to make it unconditional for both SVE and NEON, but like I said it causes some other shuffle pattern costs to change. Hence not generalizing this change.

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


More information about the llvm-commits mailing list