[Mlir-commits] [mlir] [mlir][llvm] Handle debug record import edge cases (PR #168774)

Henrich Lauko llvmlistbot at llvm.org
Thu Nov 20 08:00:22 PST 2025


================
@@ -2557,10 +2557,32 @@ LogicalResult ModuleImport::processInstruction(llvm::Instruction *inst) {
   if (auto *intrinsic = dyn_cast<llvm::IntrinsicInst>(inst))
     return convertIntrinsic(intrinsic);
 
-  // Capture instruction with attached debug markers for later processing.
-  if (inst->DebugMarker)
-    for (llvm::DbgRecord &debugRecord : inst->DebugMarker->getDbgRecordRange())
-      addDebugRecord(&debugRecord);
+  // Process debug records attached to this instruction. Debug variable records
+  // are stored for later processing after all SSA values are converted, while
+  // debug label records can be converted immediately.
+  if (inst->DebugMarker) {
+    for (llvm::DbgRecord &debugRecord :
----------------
xlauko wrote:

nit: again inconsistent `dbgVariableRecord` vs. `debugRecord`:

```suggestion
    for (llvm::DbgRecord &dbgRecord :
```

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


More information about the Mlir-commits mailing list