[llvm] f55e57c - [Coroutines][NFC] Only look for Alloca or Load when finding dbg.declare for temp spills

Wei Wang via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 9 00:20:05 PDT 2023


Author: Wei Wang
Date: 2023-08-09T00:19:43-07:00
New Revision: f55e57ca0c43294e5c0021c1ddf7e36f3474a8f2

URL: https://github.com/llvm/llvm-project/commit/f55e57ca0c43294e5c0021c1ddf7e36f3474a8f2
DIFF: https://github.com/llvm/llvm-project/commit/f55e57ca0c43294e5c0021c1ddf7e36f3474a8f2.diff

LOG: [Coroutines][NFC] Only look for Alloca or Load when finding dbg.declare for temp spills

We only look for Alloca or Load in this case, so making it explicit.

Reviewed By: ChuanqiXu, MatzeB

Differential Revision: https://reviews.llvm.org/D157423

Added: 
    

Modified: 
    llvm/lib/Transforms/Coroutines/CoroFrame.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/Coroutines/CoroFrame.cpp b/llvm/lib/Transforms/Coroutines/CoroFrame.cpp
index 58115fafbdf8ea..ea2189b4af2b7f 100644
--- a/llvm/lib/Transforms/Coroutines/CoroFrame.cpp
+++ b/llvm/lib/Transforms/Coroutines/CoroFrame.cpp
@@ -1865,6 +1865,8 @@ static void insertSpills(const FrameDataInfo &FrameData, coro::Shape &Shape) {
             if (LdInst->getPointerOperandType() != LdInst->getType())
               break;
             CurDef = LdInst->getPointerOperand();
+            if (!isa<AllocaInst, LoadInst>(CurDef))
+              break;
             DIs = FindDbgDeclareUses(CurDef);
           }
         }


        


More information about the llvm-commits mailing list