[PATCH] D13274: [WinEH] Clone funclets with multiple parents

Andy Kaylor via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 6 17:32:49 PDT 2015


andrew.w.kaylor added a comment.

In http://reviews.llvm.org/D13274#261278, @majnemer wrote:

> Isn't this IR busted because there is no associated cleanupendpad for `%l`?
>  Also, why does the cleanupendpad get more than one color? That sounds very strange because you'd never want to clone it without cloning `%o`... I'd expect that it either have it's own color or have cleanuppad's color (and propagate the colors feeding into cleanuppad).


This goes back to the motivation for this change set.  The IR here is kind of busted, but if some paths are dynamically unreachable then it's potentially OK.  Specifically, if the invoke in left.cont throws is caught by right.catch but the invoke of f() there neither throws nor returns, then it's kind of OK.  The idea here is that some theoretical optimization pass combined blocks with unreachable terminators to create this state.

As for the cleanupendpad having more than one color, that's kind of a transitory issue, I think.   Once the multiple parents issue has been sorted out, one of the colors should go away.  Maybe this doesn't need to be resolved in cloneCommonBlocks() but it kind of alarmed me when I saw what was happening there, and I was hoping that maybe addressing it would simplify what needed to be done later to handle this case.


Repository:
  rL LLVM

http://reviews.llvm.org/D13274





More information about the llvm-commits mailing list