[llvm] Add support for NSDI DebugScope, DebugNoScope and DebugInlinedAt (PR #218959)

Juan Manuel Martinez CaamaƱo via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 7 05:18:49 PDT 2026


================
@@ -1270,10 +1308,76 @@ void SPIRVNonSemanticDebugHandler::emitDebugLineForInstruction(
     assert(MI && "Merge instruction must be followed by a terminator");
   }
 
-  // The range of DebugLine must be reset at each basic block boundary.
+  // Both regions are implicitly closed at each basic block boundary. They are
+  // tracked separately because a DebugScope region usually spans several
+  // DebugLine regions, and either one can skip emission on a cache miss.
   if (LastLineMI && MI->getParent() != LastLineMI->getParent())
     LastLineMI = nullptr;
+  if (LastScopeMI && MI->getParent() != LastScopeMI->getParent())
+    LastScopeMI = nullptr;
----------------
jmmartinez wrote:

This snippet in here is odd. It's not related to `resolveDebugLocTarget` (it's using its result though).

Can we move these into their respective `emitDebugScopeForInstruction` / `emitDebugLineForInstruction`?

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


More information about the llvm-commits mailing list