[Mlir-commits] [mlir] [mlir][spirv] Add SPIR-V NonSemantic.Graph.DebugInfo (PR #199519)

Igor Wodiany llvmlistbot at llvm.org
Tue May 26 02:10:55 PDT 2026


================
@@ -388,6 +403,95 @@ LogicalResult spirv::Deserializer::processUndef(ArrayRef<uint32_t> operands) {
   return success();
 }
 
+LogicalResult
+spirv::Deserializer::processDebugInfoExtInst(ArrayRef<uint32_t> operands,
+                                             bool deferInstructions) {
+  if (deferInstructions) {
+    deferredInstructions.emplace_back(spirv::Opcode::OpExtInst, operands);
+    return success();
+  }
+
+  if (operands.size() < 4) {
+    return emitError(unknownLoc,
+                     "OpExtInst must have at least 4 operands, result type "
+                     "<id>, result <id>, set <id> and instruction opcode");
+  }
+
+  auto &extensionSetName = extendedInstSets[operands[2]];
+  assert(extensionSetName == extDebugInfo);
+
+  auto getDebugLoc = [&](uint32_t stringID) -> FailureOr<Location> {
+    auto stringIt = debugInfoMap.find(stringID);
+    if (stringIt == debugInfoMap.end()) {
+      emitError(unknownLoc, "undefined string <id> ")
+          << stringID << " in DebugInfo";
+      return failure();
+    }
+    Location loc = getLocFromDebugInfoString(opBuilder, stringIt->second);
+    return loc;
----------------
IgWod wrote:

```suggestion
    return getLocFromDebugInfoString(opBuilder, stringIt->second);
```

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


More information about the Mlir-commits mailing list