[all-commits] [llvm/llvm-project] eb675e: [WebAssembly] Support Wasm EH + Wasm SjLj

Heejin Ahn via All-commits all-commits at lists.llvm.org
Wed Jan 19 20:14:47 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: eb675e972d742476496fc5b3ee27e31e7516224d
      https://github.com/llvm/llvm-project/commit/eb675e972d742476496fc5b3ee27e31e7516224d
  Author: Heejin Ahn <aheejin at gmail.com>
  Date:   2022-01-19 (Wed, 19 Jan 2022)

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

  Log Message:
  -----------
  [WebAssembly] Support Wasm EH + Wasm SjLj

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 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.

Reviewed By: dschuff

Differential Revision: https://reviews.llvm.org/D117610




More information about the All-commits mailing list