[PATCH] D96566: [Coroutine] Properly use lifetime intrinsics to analyze allocas

Xun Li via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 11 17:37:42 PST 2021


lxfind created this revision.
Herald added subscribers: hoy, modimo, wenlei, hiraditya.
lxfind requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

In this patch, we traverse from each lifetime.start intrinsics, follow the control flow. If we never reach a coro.suspend before reaching a lifetime.end intrinsic for the same alloca, we can safely assume that the alloca
will not live across suspension points. This should still achieve similar effect as before but is precise and correct.
Added a test case.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D96566

Files:
  llvm/lib/Transforms/Coroutines/CoroFrame.cpp
  llvm/test/Transforms/Coroutines/coro-alloca-08.ll
  llvm/test/Transforms/Coroutines/coro-split-sink-lifetime-03.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D96566.323192.patch
Type: text/x-patch
Size: 8313 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210212/49cd320a/attachment.bin>


More information about the llvm-commits mailing list