This is an archive of the discontinued LLVM Phabricator instance.

[WebAssembly] Update supported features in -mcpu=generic
ClosedPublic

Authored by sunfish on May 16 2022, 2:49 PM.

Details

Summary

Enable nontrapping-fptoint, sign-ext, bulk-memory, and mutable-globals in -mcpu=generic. This makes these features enabled by default.

These features are all [finished proposals], and all major wasm engines support them.

[finished proposals]: https://github.com/WebAssembly/proposals/blob/main/finished-proposals.md

Diff Detail

Event Timeline

sunfish created this revision.May 16 2022, 2:49 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 16 2022, 2:49 PM
sunfish requested review of this revision.May 16 2022, 2:49 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 16 2022, 2:49 PM
Herald added a subscriber: aheejin. · View Herald Transcript
asb added a comment.May 17 2022, 8:28 AM

Based on the discussion we had, I think this makes sense. It's a bit repetitive, but could you please add a test to clang/test/Driver that checks the list of enabled features for generic (and for completeness, probably bleeding-edge as well). Thanks.

asb added a comment.May 17 2022, 8:30 AM

Oh, and per recent updates to the LLVM Developer policy I think it would be worth updating the Clang ReleaseNotes.rst to mention this change.

sunfish updated this revision to Diff 431064.May 20 2022, 2:46 PM

Add a driver test, and add release notes.

sunfish updated this revision to Diff 431067.May 20 2022, 2:52 PM

Add tests for -mcpu=mvp and -mcpu=bleeding-edge.

asb added a comment.Jun 20 2022, 6:44 AM

One thing that's not ideal about this test case is that it still passes if you delete the changes to WebAssembly.cpp. At least for RISC-V, selecting the -mcpu also emits the relevant -target-feature +foo for features supported by that CPU, which doesn't seem to happen here. Haven't been able to trace through to see if that's due to us doing something obviously different in the RISC-V case.

sbc100 accepted this revision.Jul 27 2022, 10:10 AM

Do you think we should backport this to llvm 15, since it missed the branch point?

This revision is now accepted and ready to land.Jul 27 2022, 10:10 AM

Emscripten-side change in preparation for this to land: https://github.com/emscripten-core/emscripten/pull/17689

This revision was landed with ongoing or failed builds.Oct 25 2022, 11:45 AM
This revision was automatically updated to reflect the committed changes.