[PATCH] D94048: [WebAssembly] Fix call unwind mismatches

Heejin Ahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 4 15:53:44 PST 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.

This adds `delegate` instruction and use it to fix unwind destination
mismatches created by marker placement in CFGStackify.

There are two kinds of unwind destination mismatches:

- Mismatches caused by throwing instructions (here we call it "call unwind mismatches", even though `throw` and `rethrow` can also cause mismatches)
- Mismatches caused by `catch`es, in case a foreign exception is not caught by the nearest `catch` and the next outer `catch` is not the catch it should unwind to. This kind of mismatches didn't exist in the previous version of the spec, because in the previous spec `catch` was effectively `catch_all`, catching all exceptions.

This implements routines to fix the first kind of unwind mismatches,
which we call "call unwind mismatches". The second mismatch (catch
unwind mismatches) will be fixed in a later CL.

This also reenables all previously disabled tests in cfg-stackify-eh.ll
and updates FileCheck lines to match the new spec. Two tests were
deleted because they specifically tested the way we fixed unwind
mismatches before using `exnref`s and branches, which we don't do
anymore.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D94048

Files:
  llvm/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyInstPrinter.cpp
  llvm/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyInstPrinter.h
  llvm/lib/Target/WebAssembly/WebAssemblyCFGStackify.cpp
  llvm/lib/Target/WebAssembly/WebAssemblyInstrControl.td
  llvm/test/CodeGen/WebAssembly/cfg-stackify-eh.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D94048.314472.patch
Type: text/x-patch
Size: 52798 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210104/abd1520c/attachment.bin>


More information about the llvm-commits mailing list