[PATCH] D44090: [WebAssembly] Support instruction selection for catching exceptions

Heejin Ahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 11 16:11:51 PDT 2018


aheejin marked an inline comment as done.
aheejin added inline comments.


================
Comment at: lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp:1368
   // In MSVC C++ and CoreCLR, catchblocks are funclets and need prologues.
-  if (IsMSVCCXX || IsCoreCLR)
+  if (IsMSVCCXX || IsCoreCLR || IsWasmCXX)
     CatchPadMBB->setIsEHFuncletEntry();
----------------
@majnemer `MachineBasicBlock::isEHFuncletEntry()` is apparently used in a lot of places including prolog/epilog generaton, and because we don't need prolog/epilog on funclet boundaries, I think should not set this flag for wasm, but [[ https://github.com/llvm-mirror/llvm/blob/dcf0b3b7b3e0f1f73a03e346d36a3daca33892d0/lib/CodeGen/Analysis.cpp#L679 | here ]] in `getFuncletMembership` checks `isEHFuncletEntry` and wasm needs this part. So I tried to change this to `isEHPad()` assuming that in WinEH `isEHFuncletEntry` and `isEHPad` are the same thing, but apparently I was wrong because now all the SEH testse are failing, which I don't know much about.

I guess we are facing the same problem as in D45559: we have two different functions for the use cases of 'funclet':
1. the BB structure starting from catchpad/cleanuppad and ending with catchret/cleanupret
2. the real outlined functions
In WinEH those two were the same thing but in wasm we don't need to outline them, which is the problem. Thoughts?


Repository:
  rL LLVM

https://reviews.llvm.org/D44090





More information about the llvm-commits mailing list