[PATCH] D54571: [WebAssembly] Split BBs after throw instructions

Heejin Ahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 15 01:04:07 PST 2018


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

`throw` instruction is a terminator in wasm, but BBs were not splitted
after `throw` instructions, causing machine instruction verifier to
fail.

This patch

- Splits BBs after `throw` instructions in WasmEHPrepare and adding an unreachable instruction after `throw`, which will be deleted in LateEHPrepare pass
- Refactors WasmEHPrepare into two member functions (`prepareEHPads` part was just moved into a function and changed)
- Changes the semantics of `eraseBBsAndChildren` in LateEHPrepare pass to match that of WasmEHPrepare pass, which is newly added. Now `eraseBBsAndChildren` does not delete BBs with remaining predecessors.
- Fixes style nits, making static function names conform to clang-tidy
- Re-enables the test temporarily disabled by https://reviews.llvm.org/rL346840 && https://reviews.llvm.org/rL346845


Repository:
  rL LLVM

https://reviews.llvm.org/D54571

Files:
  lib/CodeGen/WasmEHPrepare.cpp
  lib/Target/WebAssembly/WebAssemblyLateEHPrepare.cpp
  test/CodeGen/WebAssembly/exception.ll
  test/CodeGen/WebAssembly/wasmehprepare.ll
  test/MC/WebAssembly/event-section.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D54571.174166.patch
Type: text/x-patch
Size: 13038 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181115/d970a3f4/attachment.bin>


More information about the llvm-commits mailing list