<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/62443>62443</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [WebAssembly] llvm seem to generate invalid simd code in wasm64
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            backend:WebAssembly
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
            tlively
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          sbc100
      </td>
    </tr>
</table>

<pre>
    Most likely this is related to https://github.com/llvm/llvm-project/issues/57577.

The 3 remaining SIMD tests in emscripten test_core.py that are disabled with the marking `https://github.com/llvm/llvm-project/issues/57577` now fail in a different way (at validation time rather than build time).  For example:

```
$ ./test/runner wasm64.test_sse4_1
Test suites:
['test_core']
Running test_core: (1 tests)
(checking sanity from test runner)
shared:INFO: (Emscripten: Running sanity checks)
test_sse4_1 (test_core.wasm64) ... Clearing existing test directory
-- begin program output --
failed to asynchronously prepare wasm: CompileError: WebAssembly.instantiate(): Compiling function #40:"__original_main" failed: v128.store64_lane[0] expected type i32, found local.get of type i64 @+309812
Aborted(CompileError: WebAssembly.instantiate(): Compiling function #40:"__original_main" failed: v128.store64_lane[0] expected type i32, found local.get of type i64 @+309812)
/usr/local/google/home/sbc/dev/wasm/emscripten/out/test/test_sse4_1.js:130
 throw ex;
      ^

RuntimeError: Aborted(CompileError: WebAssembly.instantiate(): Compiling function #40:"__original_main" failed: v128.store64_lane[0] expected type i32, found local.get of type i64 @+309812)
    at abort (/usr/local/google/home/sbc/dev/wasm/emscripten/out/test/test_sse4_1.js:688:11)
 at /usr/local/google/home/sbc/dev/wasm/emscripten/out/test/test_sse4_1.js:815:5
Thrown at:
    at abort (/usr/local/google/home/sbc/dev/wasm/emscripten/out/test/test_sse4_1.js:688:11)
 at /usr/local/google/home/sbc/dev/wasm/emscripten/out/test/test_sse4_1.js:815:5

Node.js v20.0.0-v8-canary202302081604228b65
-- end program output --
FAIL

======================================================================
FAIL: test_sse4_1 (test_core.wasm64)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/google/home/sbc/dev/wasm/emscripten/test/test_core.py", line 53, in decorated
    f(self, *args, **kwargs)
  File "/usr/local/google/home/sbc/dev/wasm/emscripten/test/common.py", line 178, in decorated
    return func(self, *args, **kwargs)
  File "/usr/local/google/home/sbc/dev/wasm/emscripten/test/common.py", line 140, in decorated
    return func(self, *args, **kwargs)
  File "/usr/local/google/home/sbc/dev/wasm/emscripten/test/test_core.py", line 6810, in test_sse4_1
    self.do_runf(src, native_result)
  File "/usr/local/google/home/sbc/dev/wasm/emscripten/test/common.py", line 1337, in do_runf
    return self._build_and_run(filename, expected_output, **kwargs)
  File "/usr/local/google/home/sbc/dev/wasm/emscripten/test/common.py", line 1398, in _build_and_run
    js_output = self.run_js(js_file, engine, args,
 File "/usr/local/google/home/sbc/dev/wasm/emscripten/test/common.py", line 982, in run_js
    self.fail('JS subprocess failed (%s): %s. Output:\n%s' % (error.cmd, error.returncode, ret))
AssertionError: JS subprocess failed (/usr/local/google/home/sbc/bin/node-v20.0.0-v8-canary202302081604228b65-linux-x64/bin/node --stack-trace-limit=50 --trace-uncaught --experimental-wasm-memory64 /usr/local/google/home/sbc/dev/wasm/emscripten/out/test/test_sse4_1.js): 7. Output:
failed to asynchronously prepare wasm: CompileError: WebAssembly.instantiate(): Compiling function #40:"__original_main" failed: v128.store64_lane[0] expected type i32, found local.get of type i64 @+309812
Aborted(CompileError: WebAssembly.instantiate(): Compiling function #40:"__original_main" failed: v128.store64_lane[0] expected type i32, found local.get of type i64 @+309812)
/usr/local/google/home/sbc/dev/wasm/emscripten/out/test/test_sse4_1.js:130
 throw ex;
      ^

RuntimeError: Aborted(CompileError: WebAssembly.instantiate(): Compiling function #40:"__original_main" failed: v128.store64_lane[0] expected type i32, found local.get of type i64 @+309812)
    at abort (/usr/local/google/home/sbc/dev/wasm/emscripten/out/test/test_sse4_1.js:688:11)
 at /usr/local/google/home/sbc/dev/wasm/emscripten/out/test/test_sse4_1.js:815:5
Thrown at:
    at abort (/usr/local/google/home/sbc/dev/wasm/emscripten/out/test/test_sse4_1.js:688:11)
 at /usr/local/google/home/sbc/dev/wasm/emscripten/out/test/test_sse4_1.js:815:5

Node.js v20.0.0-v8-canary202302081604228b65
```

</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzsWEuP27AR_jX0ZSBBoixbPvjgXUdAiiYBkgI9GpQ0srhLkQZJedf_vhhKfmSLRYOmm6bpGoYt8TH8vnlwhhTOyb1GXLP8jnHulTyiOjHOWb6dicF3xq5dVadJMqtMc1p_Ms6Dko-oTuA76UA6sKiExwa8gc77g2PZhvGS8XIvfTdUcW16xkuljue_6GDNA9ae8VI6N6BjvMyX-XIZs2TLks34-7cOIQOLvZBa6j18-_hpCx6ddyA1YO9qKw8edWjb1cZifCBQwoOwCI10olLYwJP0HfgOoRf2kQSxRfKTONkiAW2eoBVSERgBjWxbtKg9PIkTMF4ID0ehZCO8NBq87BGs8B1aQqihGqRqQjPjqxigNBbwWfQHhQTrRg1skUzf8ZXPIWa8JNKMl3bQGi08Cdcv5nHQhHM436WTDtF5cIP06K5iydLLi9IYX7J8O3Z9HXRQ9bUz2xCZdNQ746sziKLusA7adEJLf4LWmj6MghHSZazrhMWGZZuPn8svk7wPF-NRw3nVSVKQfF3rhhNNvRp75Mz4CuI4hnuFwpIUfJbOn0lAIy3W3tjTKCyKoMK91HCwZm9FD2bwh8FDFI39ZNDRk4U76bqzRpvBqRMcLB7Iq2hRwnxv-oNU-MFaY-n971htnMO-UqdYaueF9lJ4ZLwgIpcJhKsddB2cgvFsngQn5LudsXIvtVA7cnfGOYxQaOox5UXsvLG4mO-U0Mjyu4TlW8DnA9Yh8k4HBJlxxu-hNYNuQJlaqHiPHkw7dS_mwOYJ43dZsipSPhLeVMZ6bBgv_gBGV_csB2cpiGkOBbgxe4WMl52hgCtdVTNeNnhkvAwW5eV1P2G8NIO_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