This is an archive of the discontinued LLVM Phabricator instance.

[WebAssembly] Nullify unnecessary setjmp invokes
ClosedPublic

Authored by aheejin on Jan 27 2022, 1:35 PM.

Details

Summary

This is similar to D116619, but now it handles invokes. The reason we
didn't handle invokes back then was we didn't support Wasm EH + Wasm
SjLj together, and the only case SjLj transformation will see invokes
is when we are using Wasm EH. (In Emscripten EH, they would have been
transformed to calls to invoke wrappers.)

But after D117610 we support Wasm EH + Wasm SjLj together and we can
nullify invokes to setjmp when there is no other longjmpable calls
within the function. Actually this is very unlikely to happen in
practice, because we treat destructors as longjmpable and also treat
__cxa_end_catch as longjmpable even if it is not.

Diff Detail

Event Timeline

aheejin created this revision.Jan 27 2022, 1:35 PM
aheejin requested review of this revision.Jan 27 2022, 1:35 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 27 2022, 1:35 PM
aheejin edited the summary of this revision. (Show Details)Jan 27 2022, 1:36 PM
dschuff accepted this revision.Jan 27 2022, 1:47 PM
This revision is now accepted and ready to land.Jan 27 2022, 1:47 PM
aheejin updated this revision to Diff 403804.Jan 27 2022, 2:28 PM

catch.longjmp.dispatch -> catch.dispatch.longjmp

This revision was automatically updated to reflect the committed changes.