[PATCH] D140231: CoroFrame: Put escaped variables with multiple lifetimes on coroutine frame

Matthias Braun via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 16 10:44:14 PST 2022


MatzeB created this revision.
MatzeB added reviewers: GorNishanov, ChuanqiXu, wlei, aschwaighofer.
Herald added subscribers: modimo, wenlei, hiraditya, mcrosier.
Herald added a project: All.
MatzeB requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

The llvm.lifetime.start intrinsic guarantees that the address for a
given alloca is always the same. So variables with escaped addresses
reaching reaching a lifetime start/end block before and after a suspend
must be placed onto the coroutine frame even if the variable itself
is not alive across the suspend point.

This computes a new `LoopKill` flag in the suspend crossing data flow
anaysis to catch the case where a lifetime marker can reach itself
via suspend-crossing path.

This fixes https://llvm.org/PR52501


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D140231

Files:
  llvm/lib/Transforms/Coroutines/CoroFrame.cpp
  llvm/test/Transforms/Coroutines/coro-alloca-loop-carried-address.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D140231.483591.patch
Type: text/x-patch
Size: 8302 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221216/92ad2863/attachment.bin>


More information about the llvm-commits mailing list