[llvm] [CoroSplit] Always erase lifetime intrinsics for spilled allocas (PR #142551)

Chuanqi Xu via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 3 01:01:49 PDT 2025


================
@@ -1212,14 +1212,25 @@ static void insertSpills(const FrameDataInfo &FrameData, coro::Shape &Shape) {
   Builder.SetInsertPoint(Shape.AllocaSpillBlock,
                          Shape.AllocaSpillBlock->begin());
   SmallVector<Instruction *, 4> UsersToUpdate;
+  SmallVector<Instruction *, 4> Lifetimes;
   for (const auto &A : FrameData.Allocas) {
     AllocaInst *Alloca = A.Alloca;
     UsersToUpdate.clear();
+    Lifetimes.clear();
     for (User *U : Alloca->users()) {
       auto *I = cast<Instruction>(U);
-      if (DT.dominates(Shape.CoroBegin, I))
+      if (I->isLifetimeStartOrEnd())
+        Lifetimes.push_back(I);
----------------
ChuanqiXu9 wrote:

Could we erase lifetimes directly here?

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


More information about the llvm-commits mailing list