[all-commits] [llvm/llvm-project] 3bba91: [WebAssembly] Rename Emscripten EH functions

Heejin Ahn via All-commits all-commits at lists.llvm.org
Wed Oct 7 09:43:30 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 3bba91f64eef15956f589fa446c265a714cc7893
      https://github.com/llvm/llvm-project/commit/3bba91f64eef15956f589fa446c265a714cc7893
  Author: Heejin Ahn <aheejin at gmail.com>
  Date:   2020-10-07 (Wed, 07 Oct 2020)

  Changed paths:
    M llvm/lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp
    M llvm/lib/Target/WebAssembly/WebAssemblyAsmPrinter.h
    M llvm/lib/Target/WebAssembly/WebAssemblyLowerEmscriptenEHSjLj.cpp
    M llvm/lib/Target/WebAssembly/WebAssemblyMCInstLower.cpp
    M llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp
    M llvm/test/CodeGen/WebAssembly/function-bitcasts.ll
    A llvm/test/CodeGen/WebAssembly/lower-em-ehsjlj-multi-return.ll
    M llvm/test/CodeGen/WebAssembly/lower-em-ehsjlj-options.ll
    M llvm/test/CodeGen/WebAssembly/lower-em-sjlj-sret.ll
    M llvm/test/CodeGen/WebAssembly/lower-em-sjlj.ll

  Log Message:
  -----------
  [WebAssembly] Rename Emscripten EH functions

Renaming for some Emscripten EH functions has so far been done in
wasm-emscripten-finalize tool in Binaryen. But recently we decided to
make a compilation/linking path that does not rely on
wasm-emscripten-finalize for modifications, so here we move that
functionality to LLVM.

Invoke wrappers are generated in LowerEmscriptenEHSjLj pass, but final
wasm types are not available in the IR pass, we need to rename them at
the end of the pipeline.

This patch also removes uses of `emscripten_longjmp_jmpbuf` in
LowerEmscriptenEHSjLj pass, replacing that with `emscripten_longjmp`.
`emscripten_longjmp_jmpbuf` is lowered to `emscripten_longjmp`, but
previously we generated calls to `emscripten_longjmp_jmpbuf` in
LowerEmscriptenEHSjLj pass because it takes `jmp_buf*` instead of `i32`.
But we were able use `ptrtoint` to make it use `emscripten_longjmp`
directly here.

Addresses:
https://github.com/WebAssembly/binaryen/issues/3043
https://github.com/WebAssembly/binaryen/issues/3081

Companions:
https://github.com/WebAssembly/binaryen/pull/3191
https://github.com/emscripten-core/emscripten/pull/12399

Reviewed By: dschuff, tlively, sbc100

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




More information about the All-commits mailing list