[PATCH] D103593: [Coroutine] Sink lifetime markers after switch of suspend blocks to avoid disturbing must tail calls

Xun Li via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 22 10:56:38 PDT 2021


lxfind added a comment.

To be honest, none of the solutions seems satisfying but I couldn't propose a better one.

At a high level, what we are trying to achieve with `sinkLifetimeStartMarkers` is to make the lifetime of each alloca more accurate, so that we could avoid putting unnecessary data on the frame. The problem itself is valid: how to make lifetime analysis more accurate. But maybe the solution is hacky to begin with (I know, I added this function). Maybe we want to rely on some more formal/universal lifetime analysis to determine the true alive range of each alloca, instead of relying on moving around lifetime intrinsics. That said, it's possible that we don't want to sink lifetime markers at all, but want to use a more robust solution to determine the lifetimes.

On the other hand, I don't know what kind of lifetime analysis is out there that could be used by CoroSplit and is good enough.
I wonder how bad it would be if we just disable/remove the `sinkLifetimeStartMarkers` step for now, and focus on finding a better lifetime analysis framework that would give us what we want?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D103593/new/

https://reviews.llvm.org/D103593



More information about the llvm-commits mailing list