[llvm] [coro][CoroSplit] Use `llvm.lifetime.end` to compute putting objects on the frame vs the stack (PR #90265)

Alan Zhao via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 29 16:19:55 PDT 2024


================
@@ -1614,6 +1621,24 @@ struct AllocaUseVisitor : PtrUseVisitor<AllocaUseVisitor> {
       // suspend point between lifetime markers. This should also cover the
       // case of a single lifetime.start intrinsic in a loop with suspend point.
       if (PI.isEscaped()) {
+        // If there is no explicit lifetime.end, then assume the address can
----------------
alanzhao1 wrote:

I think I misunderstood your initial comment - my apologies.

If I understand correctly, you're saying that the following code before the line `if (PI.isEscaped()) {`:

```cpp
for (auto *I : Users)
  for (auto *S : LifetimeStarts)
    if (Checker.isDefinitionAcrossSuspend(*S, I))
      return true;
```

is not necessary because we're checking for all `Users` instead of just `llvm.lifetime.end`, so therefore, we can replace those lines of code with the `lifetime.end` logic I wrote below.

I made this change and `ninja check-llvm` passed locally, so LMK if this is what you meant.

https://github.com/llvm/llvm-project/pull/90265


More information about the llvm-commits mailing list