[PATCH] D117610: [WebAssembly] Support Wasm EH + Wasm SjLj

Heejin Ahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 18 14:31:51 PST 2022


aheejin created this revision.
aheejin added reviewers: dschuff, tlively.
Herald added subscribers: wingo, ecnelises, sunfish, hiraditya, jgravelle-google, sbc100.
aheejin requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

D108960 <https://reviews.llvm.org/D108960> added support for SjLj using Wasm EH instructions, which we call
Wasm SjLj going forward. (We call the old SjLj Emscripten SjLj) But it
did not support using Wasm EH and Wasm SjLj together. So far users of
Wasm EH had to use Wasm EH with Emscripten SjLj, which had a certain
limitation and it suffered from bigger code size increases as well.

This enables using Wasm EH and Wasm SjLj together.

1. This redirects `catchswitch` and `cleanupret` that unwind to caller to `catch.dispatch.longjmp` BB, which is a `catchswitch` BB that handles longjmps.
2. D108960 <https://reviews.llvm.org/D108960> converted all longjmpable `call`s to `invokes` that unwind to `catch.dispatch.longjmp`. This CL checks if the `call` is embedded within another `catchpad`, and if so, makes it unwind to its nearest parent's unwind destination, rather than `catch.dispatch.longjmp`. This is necessary to preserve the scoping structure.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D117610

Files:
  llvm/include/llvm/Transforms/Utils/Local.h
  llvm/lib/Target/WebAssembly/WebAssemblyLowerEmscriptenEHSjLj.cpp
  llvm/lib/Transforms/Utils/Local.cpp
  llvm/test/CodeGen/WebAssembly/lower-wasm-ehsjlj.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D117610.400990.patch
Type: text/x-patch
Size: 19702 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220118/efb55330/attachment.bin>


More information about the llvm-commits mailing list