-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using wasm_v32x4_load_splat triggers assertion in visitSIMDLoad #9725
Comments
... additionally using a few other intrinsics that are available in "unimplemented" category leads to issues like this:
This is without load_splat being present in the source so I suspect it's generated by the optimizer. cc @tlively in case you want to reproduce this - https://github.com/zeux/meshoptimizer/tree/vertexcodec-simd has this code under -munimplemented-simd ifdef guards, so
triggers the above. |
Thanks, I can reproduce the instruction selection failure (second comment) locally. How can I reproduce the binaryen failure from the opening comment? |
Oh, sorry - forgot about this 😓 this requires disabling the rest of the code that uses -munimplemented-simd128 and changing load to load_splat on the line 1003. I've attached the modified source file so that it's easier to reproduce, the command line is the same. |
https://reviews.llvm.org/D69640 and https://reviews.llvm.org/D69604 fix the LLVM issues. Investigating Binaryen issue now! |
Binaryen fix here: WebAssembly/binaryen#2409. I'll close this issue now, but please do let me know if you find any more bugs! |
Thank you! I will try this again once the LLVM fixes land. Excited to get SIMD results on this somewhat challenging example :) (doesn't map directly to 4-wide SIMD, uses almost all possible SIMD types, uses pshufb etc.) |
It looks like setcc fix was accidentally reverted but not relanded? See llvm/llvm-project@e5cae56#diff-ab02df96323b1f9aa8168e78a46f029c |
Oh wow I didn't notice that they reverted both my changes 🙃 Should be fixed now. |
Thanks! I've confirmed that all of this works and managed to get an implementation together that even works in Chrome Canary: zeux/meshoptimizer#72. It's pretty hard to do right now because as it turns out Chrome Canary doesn't support load_splat (or v128.const or v128.andnot or a few other instructions) so the code I wrote tries to carefully sidestep all of this in codegen. But hey it works and it's pretty fast as a result :D |
When compiling with -munimplemented-simd128, I'm getting:
When using wasm_v32x4_load_splat.
Maybe it shouldn't work in the first place and the
unimplemented
is supposed to suggest this? :) Although https://github.com/WebAssembly/simd/blob/master/proposals/simd/ImplementationStatus.md page lists implementation status for many "unimplemented" intrinsics so I'm not sure. Feel free to close this if this is expected and there's some other issue tracking this.The text was updated successfully, but these errors were encountered: