[clang] [CIR] Fix cir.cleanup.scope successor regions (PR #221222)

Henrich Lauko via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 14 23:16:47 PDT 2026


xlauko wrote:

@andykaylor it is a bit unfortunate. A throw from a call in the middle of the body isn’t a region terminator, so `RegionBranchOpInterface` has no branch point to hang an edge on. An EH cleanup reached only that way has no predecessor in the region graph. 

At the moment no CIR pass uses these edges to delete regions, so nothing breaks today. But generic passes like `-sccp` or `-remove-dead-values` run on unflattened CIR would treat that cleanup as dead. Modeling it properly needs an interface extension upstream, e.g. letting ops that may unwind act as branch points, which I’d rather discuss separately.

https://github.com/llvm/llvm-project/pull/221222


More information about the cfe-commits mailing list