================ @@ -3046,7 +3046,8 @@ void coro::buildCoroutineFrame( // Collect the spills for arguments and other not-materializable values. for (Argument &A : F.args()) for (User *U : A.users()) - if (Checker.isDefinitionAcrossSuspend(A, U)) + if (Checker.isDefinitionAcrossSuspend(A, U) || + isa<CoroEndInst>(U)) ---------------- ChuanqiXu9 wrote:
Got it. Then it smells slightly bad. We have a lot `isDefinitionAcrossSuspend` uses and it looks easy to forget similar cases. I feel better to solve the issue fundamentally by introducing new intrinsics. e.g., we can introduce `token llvm.coro.end.retcont.return_values(...)` and refactor `llvm.coro.end()` to `declare i1 @llvm.coro.end(ptr <handle>, i1 <unwind>, token <return>)`. And for non-retcon-once ABI, we can fill the third argument as `none` simply. For retcon-once ABI, it should be easy to generate the actual ret too. Then we can avoid the `isDefinitionAcrossSuspend` problem automatically since the BB will be split around `coro.end`. https://github.com/llvm/llvm-project/pull/66333 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits