[llvm] coro: Do not capture pointer locals that have no provenance (PR #223321)
Chuanqi Xu via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 14 22:09:04 PDT 2026
ChuanqiXu9 wrote:
What's the motivation?
This looks not correct. e.g.,
```
void *saved_address = nullptr;
bool save_and_check_address(void * captures(address) addr) {
if (!saved_address) {
saved_address = addr;
}
return saved_address == addr;
}
```
```
coro_ty coroutine() {
%a = alloca ...
for (...) {
lifetime.start(%a)
save_and_check_address(%a)
lifetime.end
co_await
}
}
```
then %a may not be moved to the frame in this patch. Theh the address of `a` may be different in this patch vs before.
https://github.com/llvm/llvm-project/pull/223321
More information about the llvm-commits
mailing list