[llvm] [CoroSplit] AllocaUseVisitor visits insertvalue/insertelement (PR #156788)

Chuanqi Xu via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 12 02:06:19 PDT 2025


ChuanqiXu9 wrote:

> I'm not familiar with `AllocaUseVisitor` and `handleAlias()`, but how do we know that we're not missing other `visit` functions?

I think we don't know. The idea is to avoid putting things on the coroutine frame as much as possible. This was originally for optimization. But later we find it is needed since we won't have the alloca before coro.begin.

> 
> It's not clear to me what criteria is used to decide which instructions need a `visit` function and call to `handleAlias()`, and which do not.

It is basically an escape analysis.

> 
> For example, I noticed that `visitPtrToIntInst()` isn't implemented. Couldn't an alloca escape through that too?

If it is allowed to create a pointer from an int (I believe so), yes, it may be a problem.



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


More information about the llvm-commits mailing list