[llvm] [AArch64] Change cost of (s|z)ext <4 x i8> -> <4 x i32> to 2. (PR #141029)

David Green via llvm-commits llvm-commits at lists.llvm.org
Thu May 22 10:12:43 PDT 2025


davemgreen wrote:

Do you have any details about what this improves for you? I am not against it, it sounds sensible, but if you look at the cost of the load it is already 2, as it includes the cost of `v4i8 load + zext to v4i16`. A v4i8 is legalized to a v4i16 and the cost model somewhat attempts to account for that. In some cases the cost of will certainly be 2 though.

> One thing to note separately is that the costs from the custom tables are only used for RThru costs, the others default to 1, which is not really accurate either, but that's the same for all entries in the lookup tables

I think it might have ran into problems with unrolling, when I tried it. I may give it another go, I had a big stack of patches for them that I didn't do much with.

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


More information about the llvm-commits mailing list