[llvm] [WebAssembly] Fix the i32x4 case of simd splat shuffle cost (PR #191964)

Derek Schuff via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 9 12:54:37 PDT 2026


dschuff wrote:

> I received a request for a review, but I'm sorry, but I'm not sure about the cost of the WASM SIMD instruction For example, how do you cost instruction like 'i32x4.splat' or 'v128.store'? https://godbolt.org/z/abj1oE5av

The cost model measures IR cost in terms of a generic integer measurement, even on regular architectures (since not all instructions have the same cost) but there's no one particular meaning for it. It's actually even harder in wasm since wasm instructions also can lower to different machine instructions. At some point I think it would be cool to do a bit of a more comprehensive cost model that takes machine instructions into account across X86 and ARM64, but we'd want that to be more systematic and be backed by some good benchmarks, and it would be a fair bit of work since we just haven't done a ton of cost model work on wasm.


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


More information about the llvm-commits mailing list