[PATCH] D97569: [WebAssembly] Fix remapping branch dests in fixCatchUnwindMismatches

Heejin Ahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 26 12:05:27 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 is a case D97178 <https://reviews.llvm.org/D97178> tried to solve but missed. D97178 <https://reviews.llvm.org/D97178> could not handle
the case when
multiple consecutive delegates are generated:

- Before:

  block
    br (a)
    try
    catch
    end_try
  end_block
            <- (a)



- After

  block
    br (a)
    try
      ...
      try
        try
        catch
        end_try
              <- (a)
      delegate
    delegate
  end_block
            <- (b)

(The `br` should point to (b) now)

D97178 <https://reviews.llvm.org/D97178> assumed `end_block` exists two BBs later than `end_try`, because
it assumed the order as `end_try` BB -> `delegate` BB -> `end_block` BB.
But it turned out there can be multiple `delegate`s in between. This
patch changes the logic so we just search from `end_try` BB until we
find `end_block`.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D97569

Files:
  llvm/lib/Target/WebAssembly/WebAssemblyCFGStackify.cpp
  llvm/test/CodeGen/WebAssembly/cfg-stackify-eh.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D97569.326763.patch
Type: text/x-patch
Size: 7241 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210226/a4dd16c6/attachment.bin>


More information about the llvm-commits mailing list