[clang] [llvm] [clang][CodeGen] Extends lifetime of coroutine promise(CWG2563) (PR #151067)
Chuanqi Xu via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 6 18:51:25 PDT 2025
ChuanqiXu9 wrote:
> > Could elaborate it? Especially why it is safe to not lower coro.end to ret void?
>
> The idea is: if we lower `coro.end` to `ret void`, users of `coro.end` will become unreachable. Thus, I assume that if the frontend uses the return value of `coro.end`, the intention is to determine whether we are in the start or resume part instead of returning.
>
> Personally, I think the problem is that `coro.end` mixes two functionalities: querying where we are and lowering to some code. I think it might be reasonable to introduce a new intrinsic, `llvm.coro.where`, and drop the return value of `coro.end`. However, I’d prefer to hear others’ thoughts before actually doing it.
Since I didn't have time to look into details, the instinct reaction to my mind is, then why do we change the lowering of `coro.end` **conditionally**? I mean, if it is good, it will be better and simpler to do it unconditionally.
https://github.com/llvm/llvm-project/pull/151067
More information about the llvm-commits
mailing list