This is an archive of the discontinued LLVM Phabricator instance.

[WebAssembly] Add relaxed-simd feature
ClosedPublic

Authored by ngzhian on Sep 20 2021, 4:12 PM.

Details

Summary

This currently only defines a constant, but it the future will be used
to gate builtins for experimenting and prototyping relaxed-simd proposal
(https://github.com/WebAssembly/relaxed-simd/).

Diff Detail

Event Timeline

ngzhian created this revision.Sep 20 2021, 4:12 PM
ngzhian requested review of this revision.Sep 20 2021, 4:12 PM
Herald added a project: Restricted Project. · View Herald TranscriptSep 20 2021, 4:12 PM
tlively added a comment.EditedSep 21 2021, 5:21 PM

Nice! Thanks for writing this :D Do you know what happens when you actually try to compile some code with -mrelaxed-simd? I'm concerned that it will throw an error because the "relaxed-simd" target feature has not yet been defined in the backend (specifically in WebAssembly.td and in WebAssemblySubtarget.{h,cpp}).

Edit: Here's the corresponding previous patch that added the target feature in the backend: https://reviews.llvm.org/D56501.

clang/lib/Basic/Targets/WebAssembly.cpp
108–110

I believe this should be above the SIMD128 case so that when RelaxedSIMD is enabled it falls through and marks SIMD128 as enabled as well.

ngzhian updated this revision to Diff 374262.Sep 22 2021, 9:27 AM
ngzhian marked an inline comment as done.

Fix fallthrough, add feature to WebAssembly subtarget

Herald added a project: Restricted Project. · View Herald TranscriptSep 22 2021, 9:27 AM

Nice! Thanks for writing this :D Do you know what happens when you actually try to compile some code with -mrelaxed-simd? I'm concerned that it will throw an error because the "relaxed-simd" target feature has not yet been defined in the backend (specifically in WebAssembly.td and in WebAssemblySubtarget.{h,cpp}).

It output "'+relaxed-simd' is not a recognized feature for this target (ignoring feature)" but didn't fail compilation. I fixed it by adding to WebAssembly.td and WebAssemblySubtarget.h, thanks!

Edit: Here's the corresponding previous patch that added the target feature in the backend: https://reviews.llvm.org/D56501.

tlively accepted this revision.Sep 22 2021, 1:38 PM

Great, thanks! I will take care of landing this.

This revision is now accepted and ready to land.Sep 22 2021, 1:38 PM
This revision was landed with ongoing or failed builds.Sep 22 2021, 2:53 PM
This revision was automatically updated to reflect the committed changes.