[PATCH] D13424: [WinEH] Create a separate MBB for funclet prologues

Joseph Tremoulet via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 5 07:56:00 PDT 2015


JosephTremoulet added inline comments.

================
Comment at: lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp:223
@@ -220,4 +222,3 @@
         MMI.setHasEHFunclets(true);
-      if (isa<CatchPadInst>(I) || isa<CatchEndPadInst>(I) ||
-          isa<CleanupEndPadInst>(I)) {
+      if (isa<CatchEndPadInst>(I) || isa<CleanupEndPadInst>(I)) {
         assert(&*BB->begin() == I &&
----------------
One the one hand, it seems odd to allow PHIs in catchpads; in the IR each catchpad happens before the next, so it would be legal to have a use of this PHI in another PHI in a subsequent catchpad, whereas the MBB you're creating for the next catchpad's prolog won't have the MBB for this catchpad's prolog as a predecessor.

On the other hand, at the IR level, the catchpad is the only place that has invokes as predecessors but doesn't have backedges to the normal dest as predecessors and so is the only place to put the sort of PHI that we need...

This suggests to me that maybe instead of what you're doing here, we simply want EHPrep to split critical catchpad-normal-dest edges (before it mucks with PHIs)?


http://reviews.llvm.org/D13424





More information about the llvm-commits mailing list