[clang] [WebAssembly] Add more features to generic CPU config (PR #80923)

Heejin Ahn via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 23 04:03:00 PDT 2024


aheejin wrote:

This first tried to enable four features (reference-types, multivalue, bulk-memory, and nontrapping-fptoint), but I think now we can enable the two first: reference-types and multivalue. These two were actually the first motivation I started this (these are necessary for the new EH spec adopted in Oct 2023). I believe I ran all emscripten tests with these two enabled and I don't think more tests fail than the current status. (We have some tests failing even now in the modes that are not regularly checked by CI, but enabling these two doesn't change that.)

Usually, when we enable new features, we provide corresponding lowering pass in Binaryen to support legacy users. But I don't think that's necessary or even possible for these two. You can lower neither all multivalue-returning functions away (especially when they are imported or exported), nor reference types away. But I think it's fine, given that these two features are not really generated unless you opt into it, for example, by explicitly using `__funcref` or `__externref`. And after #88492, multivalue code is not gonna be generated unless you explicitly use a multivalue ABI like `-Xclang -target-abi -Xclang experimental-mv` or use the new EH instructions (`try_table` vaiants) in LLVM, which have not been implemented yet. So even if we enable these two features, the legacy users wouldn't be suddenly getting reference types or multivalue in their code.

I'll modify this PR to enable the two features (multivalue and reference-types) first. That way I think we can land this soon. WDYT?

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


More information about the cfe-commits mailing list