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

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 30 20:54:33 PDT 2023

efriedma added a comment.

In D154294#4629965 <https://reviews.llvm.org/D154294#4629965>, @pengfei wrote:

>> We can continue with the existing IR by trying to identify try regions and adding extra unwind edges to MBBs in the try state
> In the previous analysis <https://reviews.llvm.org/D154294#4501026>, I thought the edges are preserved until we are merging them (e.g., bb.1 has two successors although it has absolute jump). And I thought the way to solve it is to inherit these successors when merging BBs. However, it may not solve all the problems, since BBs may have different EH states. The point is, I think such edges don't solve the problem here. Or we may have different understanding about adding edges.

My understanding of "adding edges" is that in the example https://reviews.llvm.org/D154294#4501026, we would add an edge from 'bb.5.invoke.cont4' to the landing pad in the initial MIR CFG.  (Not adding the edge when we merge blocks in BranchFolding, but adding the edge when SelectionDAG constructs the MIR.)  The edge doesn't explicitly exist in the LLVM IR, but we can infer it from the preceding llvm.seh.try.begin() call.

  rG LLVM Github Monorepo



More information about the llvm-commits mailing list