[PATCH] D107530: [WebAssembly] Don't do SjLj transformation when there's only setjmp

Heejin Ahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 4 21:17:40 PDT 2021


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.

When there is a `setjmp` call in a function, we transform every callsite
of `setjmp` to record its information by calling `saveSetjmp` function,
and we also transform every callsite of a function that can longjmp to
to check if a longjmp occurred and if so jump to the corresponding
post-setjmp BB. Currently we are doing this for every function that
contains a call to `setjmp`, but if there is no other function call
within that function that can longjmp, this transformation of `setjmp`
callsite and all the preparation of `setjmpTable`s in the entry of the
function is not necessary.

This checks if a setjmp-calling function has any other calls that can
longjmp, and if not, skips the function for the SjLj transformation.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D107530

Files:
  llvm/lib/Target/WebAssembly/WebAssemblyLowerEmscriptenEHSjLj.cpp
  llvm/test/CodeGen/WebAssembly/lower-em-sjlj-alias.ll
  llvm/test/CodeGen/WebAssembly/lower-em-sjlj.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D107530.364339.patch
Type: text/x-patch
Size: 5221 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210805/67dbaeca/attachment.bin>


More information about the llvm-commits mailing list