[PATCH] D154294: [Windows SEH]: Do not fold branches for MSVC TableSEH function

Reid Kleckner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 30 15:55:22 PDT 2023


rnk added a comment.

In D154294#4629535 <https://reviews.llvm.org/D154294#4629535>, @efriedma wrote:

> hasEHPadSuccessor() is actually false for the block that throws the exception.  I think that's a bug... but everybody else who's looked at this code apparently disagrees with me.

Now I see what you mean, sorry it took me a while to work out what you meant about the bad CFG. :) We have no seh.try.end() blocks in this example. They've all been deleted in the mid-level because of the unreachable.

We've arrived once again at my favorite core struggle with LLVM IR: the lack of regions.

I can think of two ways to proceed:

- We can continue with the existing IR by trying to identify try regions and adding extra unwind edges to MBBs in the try state
- We can continue with a fictional, imperfect Machine CFG, and attempt to retain the seh.try.end intrinsics by adding a fictional edge from begin to end, so `unreachable` won't destroy the try scope information.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D154294



More information about the llvm-commits mailing list