[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:35:59 PST 2018


aheejin added inline comments.


================
Comment at: lib/CodeGen/WasmEHPrepare.cpp:236
+
+bool WasmEHPrepare::prepareEHPads(Function &F) {
+  Module &M = *F.getParent();
----------------
This part is just factored out and has not changed.


================
Comment at: lib/Target/WebAssembly/WebAssemblyLateEHPrepare.cpp:90
 template <typename Container>
-static void EraseBBsAndChildren(const Container &MBBs) {
+static void eraseBBsAndChildren(const Container &MBBs) {
   SmallVector<MachineBasicBlock *, 8> WL(MBBs.begin(), MBBs.end());
----------------
This now does not delete children with remaining predecessors because the purpose of this function was delete dead children. Predecessors of blocks in `MBBs` are removed before calling this function.


================
Comment at: lib/Target/WebAssembly/WebAssemblyLateEHPrepare.cpp:280
+        MBB.removeSuccessor(Succ);
+      eraseBBsAndChildren(NonPadSuccessors);
     }
----------------
Now `eraseBBsAndChildren` does not delete children with remaining successors, so we remote the successor relationship here before calling the function


================
Comment at: test/MC/WebAssembly/event-section.ll:3
-; RUN: llc -filetype=obj -exception-model=wasm -mattr=+exception-handling -verify-machineinstrs %s -o - | obj2yaml | FileCheck %s
-; RUN: llc -filetype=obj -exception-model=wasm -mattr=+exception-handling -verify-machineinstrs %s -o - | llvm-readobj -s | FileCheck -check-prefix=SEC %s
 
----------------
`-verify-machineinstrs` is added to test/CodeGen/exception.ll instead.


Repository:
  rL LLVM

https://reviews.llvm.org/D54571





More information about the llvm-commits mailing list