[PATCH] D58914: [WebAssembly] Place 'try' and 'catch' correctly wrt EH_LABELs

Heejin Ahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 4 10:50:33 PST 2019


aheejin created this revision.
aheejin added a reviewer: dschuff.
Herald added subscribers: llvm-commits, sunfish, jgravelle-google, sbc100.
Herald added a project: LLVM.

After instruction selection phase, possibly-throwing calls, which were
previously invoke, are wrapped in `EH_LABEL` instructions. For example:

  EH_LABEL <mcsymbol .Ltmp0>
  CALL_VOID @foo ...
  EH_LABEL <mcsymbol .Ltmp1>

`EH_LABEL` is placed also in the beginning of EH pads:

  bb.1 (landing-pad):
    EH_LABEL <mcsymbol .Ltmp2>
    ...

And we'd like to maintian this relationship, so when we place a `try`,

  TRY ...
  EH_LABEL <mcsymbol .Ltmp0>
  CALL_VOID @foo ...
  EH_LABEL <mcsymbol .Ltmp1>

When we place a `catch`,

  bb.1 (landing-pad):
    EH_LABEL <mcsymbol .Ltmp2>
    %0:except_ref = CATCH ...
    ...

Previously we didn't treat EH_LABELs specially, so `try` was placed
right before a call, and `catch` was placed in the beginning of an EH
pad.


Repository:
  rL LLVM

https://reviews.llvm.org/D58914

Files:
  lib/Target/WebAssembly/WebAssemblyCFGStackify.cpp
  lib/Target/WebAssembly/WebAssemblyLateEHPrepare.cpp
  test/CodeGen/WebAssembly/eh-labels.mir

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D58914.189168.patch
Type: text/x-patch
Size: 4163 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190304/d8e5798f/attachment.bin>


More information about the llvm-commits mailing list