[llvm] [SPIRV] Emit NonSemantic DebugValue (PR #224158)
Diego Novillo via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 22 06:14:28 PDT 2026
================
@@ -515,6 +642,18 @@ MCRegister SPIRVNonSemanticDebugHandler::emitOpConstantI32(
if (!Inserted)
return It->second;
+ for (const MachineInstr *MI : MAI.getMSInstrs(SPIRV::MB_TypeConstVars)) {
+ if (MI->getOpcode() != SPIRV::OpConstantI || MI->getNumOperands() < 3 ||
+ !MI->getOperand(2).isImm())
+ continue;
+ if (MAI.getRegisterAlias(MI->getMF(), MI->getOperand(1).getReg()) !=
+ I32TypeReg ||
+ static_cast<uint64_t>(MI->getOperand(2).getImm()) != Value)
+ continue;
+ It->second = MAI.getRegisterAlias(MI->getMF(), MI->getOperand(0).getReg());
+ return It->second;
+ }
----------------
dnovillo wrote:
Done.
https://github.com/llvm/llvm-project/pull/224158
More information about the llvm-commits
mailing list