[PATCH] D146543: [Coroutines] Look for dbg.declare for temp spills

Chuanqi Xu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 23 02:08:04 PDT 2023


ChuanqiXu added a comment.

> Does your downstream patch address the same issue? Maybe we can consolidate here.

Oh, not exactly. It looks like you're saving the debug information under O0. While we're trying to save the debug information within optimization, which might not be so natural. And it looks like the problem occurs within opaque pointer and our downstream compiler didn't start to use opaque pointer yet. So in another word, this should be regression bug if I understand things correctly.



================
Comment at: llvm/lib/Transforms/Coroutines/CoroFrame.cpp:1849-1859
+        // Try best to find dbg.declare. If the spill is a temp, there may not
+        // be a direct dbg.declare. Walk up the load chain to find one.
+        auto *CurDef = Def;
+        while (DIs.empty() && isa<LoadInst>(CurDef)) {
+          auto *LdInst = cast<LoadInst>(CurDef);
+          // Only consider ptr to ptr same type load.
+          if (LdInst->getPointerOperandType() != LdInst->getType())
----------------
We handled similar thing in https://github.com/llvm/llvm-project/blob/47bff1cc46b5de96841fd1592df0c828e1d38e35/llvm/lib/Transforms/Coroutines/CoroFrame.cpp#L2815-L2825. Let's handle this there too to avoid redundant code.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D146543



More information about the llvm-commits mailing list