[llvm] [CoroSplit] Never collect allocas used by catchpad into frame (PR #186728)

Weibo He via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 18 19:33:14 PDT 2026


================

----------------
NewSigma wrote:

I think the lifetime of the catch scope is not essential. The problem here is the lack of a way to identify the exception objects. Could coroutines enforce that these allocas are directly used by catchpad? That is, the following pattern would be undefined:

``` LLVM
  %a = alloca ptr, align 8
  %b = alloca ptr, align 8
  %exception.obj = call ptr @random(ptr %a, ptr %b)
  ...

catch:
  %pad = catchpad within %switch [ptr null, i32 8, ptr %exception.obj]
```

Otherwise, it is impossible for CoroSplit to tell whether an alloca is an exception object, and we will still run into something like #127653.

I have revised the PR description accordingly. Please have a look.

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


More information about the llvm-commits mailing list