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

via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 14 04:00:49 PDT 2026


ParkHanbum wrote:

I received a request for a review, but I'm sorry, but I'm not sure about the cost of the WASM32 SIMD instruction
For example, how do you cost instruction like 'i32x4.splat' or 'v128.store'?
https://godbolt.org/z/abj1oE5av
```wasm
splat_i32x4:                            # @splat_i32x4
        local.get       1
        local.get       0
        i32.store       12:p2align=0
        local.get       1
        local.get       0
        i32.store       8:p2align=0
        local.get       1
        local.get       0
        i32.store       4:p2align=0
        local.get       1
        local.get       0
        i32.store       0:p2align=0
        end_function
n_splat_i32x4:                          # @n_splat_i32x4
        local.get       1
        local.get       0
        i32x4.splat
        v128.store      0:p2align=0
        end_function
```

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


More information about the llvm-commits mailing list