[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;
+ };
+
+ auto instructionID = static_cast<spirv::GraphDebugInfoExtInst>(operands[3]);
+ switch (instructionID) {
+ case spirv::GraphDebugInfoExtInst::DebugGraph: {
+ if (operands.size() < 6)
+ return emitError(unknownLoc, "DebugGraph must have graph and string IDs");
+ auto &graphID = operands[4];
----------------
IgWod wrote:
nit: type and also in few other places below where operands are being read.
https://github.com/llvm/llvm-project/pull/199519
More information about the Mlir-commits
mailing list