[PATCH] D124680: [WinEHPrepare] Fix accidental truncation of EH funclets with GNUstep ObjC runtime

Stefan Gränitz via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 2 05:14:36 PDT 2022


sgraenitz abandoned this revision.
sgraenitz marked 3 inline comments as done.
sgraenitz added a comment.

Thanks for your comments Reid, this was really helpful!

In D124680#3483821 <https://reviews.llvm.org/D124680#3483821>, @rnk wrote:

> Which pass inserts the calls to these intrinsics? Can that pass be responsible for calculating funclet colors and adding the operand bundles to the intrinsics?

Yes, my second attempt was a basic sketch for that, but I wasn't sure it's going in the right direction. With your explanation it makes a lot more sense now.

So, I did some polishing and set up a new review here: D124762 <https://reviews.llvm.org/D124762>



================
Comment at: llvm/lib/CodeGen/WinEHPrepare.cpp:969
 
-        // Skip call sites which are nounwind intrinsics or inline asm.
-        auto *CalledFn =
----------------
rnk wrote:
> I'd rather keep this restricted to intrinsics if possible. The funclet bundle operands exist to make sure that we don't have to clone common blocks with any interesting EH state. They prevent mid level passes from doing things like tail merging, or merging identical regions of IR.
> 
> The design is somewhat complicated because it tries to defend against all possible legal IR transforms, not just the ones in tree. Unfortunately, the design makes it really hard for any pass after the frontend IR generation to correctly insert call instructions, and that probably includes ARC.
Ok, my patch in the new review avoids it and uses bundle operands instead.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D124680/new/

https://reviews.llvm.org/D124680



More information about the llvm-commits mailing list