[PATCH] D134866: [WinEH] Fix PreISel intrinsics in funclet catchret.dest blocks

Stefan Gränitz via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 16 05:44:34 PST 2022


sgraenitz abandoned this revision.
sgraenitz added a comment.

I still think the silent code removal here in WinEHPrepare is very dangerous for all clients of funclet-based EH in LLVM. Thanks @rnk for initiating a discussion here.

Sporadic runtime crashes on exception paths are hard to diagnose and tracing the problem back here was a lot of effort. Understanding and mitigating the issue took long, especially because the documentation doesn't say anything at all about implausible calls or the role of bundle operands:
https://releases.llvm.org/15.0.0/docs/ExceptionHandling.html#exception-handling-using-the-windows-runtime

While the current approach should really be revisited in the long term, I understand that designing and implementing a new one is not an option in the short term. So in the meantime, I'm proposing to adopt the following patches instead (plus a few more preparations linked from there):

- D137939 <https://reviews.llvm.org/D137939> teaches the GNUstep-specific CodeGen to emit correct IR for the situation in this review
- D138123 <https://reviews.llvm.org/D138123> allows the IR Verifier to check funclet tokens for all intrinsic calls that may lower to function calls in IR transforms (thanks @efriedma for bringing it up!)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D134866



More information about the llvm-commits mailing list