This is an archive of the discontinued LLVM Phabricator instance.

[WebAssembly] Don't inline -emscripten-cxx-exceptions-allowed functions
ClosedPublic

Authored by aheejin on Mar 24 2021, 6:14 AM.

Details

Summary

Functions specified in -emscripten-cxx-exceptions-allowed, which is
set by Emscripten's EXCEPTION_CATCHING_ALLOWED setting, can be inlined
in LLVM middle ends before we reach WebAssemblyLowerEmscriptenEHSjLj
pass in the wasm backend and thus don't get transformed for exception
catching.

This fixes the issue by adding --force-attribute=FUNC_NAME:noinline
for each function name in -emscripten-cxx-exceptions-allowed, which
adds noinline attribute to the specified function and thus excludes
the function from inlining candidates in optimization passes.

Fixes the remaining half of
https://github.com/emscripten-core/emscripten/issues/10721.

Diff Detail

Event Timeline

aheejin created this revision.Mar 24 2021, 6:14 AM
aheejin requested review of this revision.Mar 24 2021, 6:14 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 24 2021, 6:14 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
aheejin updated this revision to Diff 332957.Mar 24 2021, 6:20 AM

Comment fix

sbc100 accepted this revision.Mar 24 2021, 10:32 AM

Nice!

This revision is now accepted and ready to land.Mar 24 2021, 10:32 AM
aheejin updated this revision to Diff 333041.Mar 24 2021, 10:38 AM

Add break

This revision was landed with ongoing or failed builds.Mar 24 2021, 12:28 PM
This revision was automatically updated to reflect the committed changes.