[llvm] [Coroutines] Model retcon returns explicitly and upgrade legacy IR (PR #227232)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Sat Oct 3 00:19:45 PDT 2026
https://github.com/nikic commented:
Can you please unslop your PR description? Make sure it is maximally concise and does not contain any unnecessary information (including the entire testing section). For the future, please write your PR description yourself, even if the code is AI generated.
-----
I'm really not familiar with the coroutine representation. It would be good if someone who does looks at this. I guess my first question would be why this is represented as an alloca parameter, plus a load from that alloca? Esp. taking into account that this requires an aggregate load, this is kind of unfortunate.
Might it make more sense to have something like
```llvm
call void @llvm.coro.end(ptr %hdl, i1 0, token none)
%coro.ret = call { ptr, i32 } @llvm.coro.ret(ptr %hdl)
ret { ptr, i32 } %coro.ret
```
instead?
Or seeing how the new alloca load + return seems to always directly follow coro.end in tests, maybe coro.end should be returning the return value?
https://github.com/llvm/llvm-project/pull/227232
More information about the llvm-commits
mailing list