[PATCH] D96922: [Coroutine] Check indirect uses of alloca when checking lifetime info

John McCall via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 18 20:05:12 PST 2021


rjmccall added a comment.

In D96922#2573433 <https://reviews.llvm.org/D96922#2573433>, @ChuanqiXu wrote:

> In D96922#2572787 <https://reviews.llvm.org/D96922#2572787>, @rjmccall wrote:
>
>> In general, we cannot ever assume that we can see all uses of the alloca, whether direct or indirect; we can do our best when we can reason about particular uses, but we have to have some ability to recognize that the address may have escaped and therefore basically any point within the lifetime of the alloca might be a use.  It doesn't seem like this gets us to that point yet.
>
> Maybe we need to introduce AA or memorySSA to this pass to do that. And from my point of view, the solution now (by AllocaUseVisitor) can be a workaround. We could do analysis in AllocaUseVisitor as conservatively as we could before we introduce memorySSA or AA.

We don't need more information to do that; we need to use the information we have *correctly*.  When you're analyzing uses of the alloca, you need to deal with uses that you don't fully understand by just giving up on the analysis and assuming that the object is used for its entire lifetime (as limited by lifetime intrinsics, if possible, but the entire function if not).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D96922



More information about the llvm-commits mailing list