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

David Majnemer via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 5 09:35:02 PDT 2015


majnemer 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 &&
----------------
JosephTremoulet wrote:
> 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)?
I think we have problems with PHIs in catchpad predecessors regardless of this change because the catchpad predecessor isn't a CFG predecessor.  Our solution to that problem was to use further preparation to clean-up the PHIs.


http://reviews.llvm.org/D13424





More information about the llvm-commits mailing list