[all-commits] [llvm/llvm-project] 32fa99: [SPIRV] Add support for NSDI DebugLocalVariable.
Manuel Carrasco via All-commits
all-commits at lists.llvm.org
Fri Sep 11 05:26:03 PDT 2026
Branch: refs/heads/users/mgcarrasco/nsdi-debug-declare-new
Home: https://github.com/llvm/llvm-project
Commit: 32fa990a46e4ed2e713cf919d12d627572b2de4f
https://github.com/llvm/llvm-project/commit/32fa990a46e4ed2e713cf919d12d627572b2de4f
Author: Manuel Carrasco <Manuel.Carrasco at amd.com>
Date: 2026-09-11 (Fri, 11 Sep 2026)
Changed paths:
M llvm/lib/Target/SPIRV/SPIRVNonSemanticDebugHandler.cpp
M llvm/lib/Target/SPIRV/SPIRVNonSemanticDebugHandler.h
A llvm/test/CodeGen/SPIRV/debug-info/debug-local-variable-dbg-value.ll
A llvm/test/CodeGen/SPIRV/debug-info/debug-local-variable-records-and-retained.ll
A llvm/test/CodeGen/SPIRV/debug-info/debug-local-variable-retained-nodes.ll
A llvm/test/CodeGen/SPIRV/debug-info/debug-local-variable-skip-type.ll
A llvm/test/CodeGen/SPIRV/debug-info/debug-local-variable.ll
Log Message:
-----------
[SPIRV] Add support for NSDI DebugLocalVariable.
Commit: 6468e9e0868ad6590bbf886301d7b1d6fb3244b9
https://github.com/llvm/llvm-project/commit/6468e9e0868ad6590bbf886301d7b1d6fb3244b9
Author: Manuel Carrasco <Manuel.Carrasco at amd.com>
Date: 2026-09-11 (Fri, 11 Sep 2026)
Changed paths:
M llvm/lib/Target/SPIRV/SPIRVNonSemanticDebugHandler.cpp
M llvm/lib/Target/SPIRV/SPIRVNonSemanticDebugHandler.h
A llvm/test/CodeGen/SPIRV/debug-info/debug-declare-access-chain.ll
A llvm/test/CodeGen/SPIRV/debug-info/debug-declare-dbg-value-variadic.ll
A llvm/test/CodeGen/SPIRV/debug-info/debug-declare-dead-alloca.ll
A llvm/test/CodeGen/SPIRV/debug-info/debug-declare-expression-unsupported.ll
A llvm/test/CodeGen/SPIRV/debug-info/debug-declare-expression-xderef.ll
A llvm/test/CodeGen/SPIRV/debug-info/debug-declare-function-parameter.ll
A llvm/test/CodeGen/SPIRV/debug-info/debug-declare-int-storage.ll
A llvm/test/CodeGen/SPIRV/debug-info/debug-declare-line-scope.ll
A llvm/test/CodeGen/SPIRV/debug-info/debug-declare-module-scope-variable.ll
A llvm/test/CodeGen/SPIRV/debug-info/debug-declare-null-storage.ll
A llvm/test/CodeGen/SPIRV/debug-info/debug-declare-poison-storage.ll
A llvm/test/CodeGen/SPIRV/debug-info/debug-declare-skip-type.ll
A llvm/test/CodeGen/SPIRV/debug-info/debug-declare.ll
A llvm/test/CodeGen/SPIRV/debug-info/debug-expression-bit-piece.ll
A llvm/test/CodeGen/SPIRV/debug-info/debug-expression-operations.ll
A llvm/test/CodeGen/SPIRV/debug-info/debug-expression-out-of-range.ll
A llvm/test/CodeGen/SPIRV/debug-info/debug-global-variable-constant-value.ll
M llvm/test/CodeGen/SPIRV/debug-info/debug-global-variable-init-expr.ll
M llvm/test/CodeGen/SPIRV/debug-info/debug-local-variable-dbg-value.ll
Log Message:
-----------
[SPIRV] Emit NonSemantic DebugDeclare, DebugExpression and DebugOperation.
Add support for
[DebugDeclare](https://github.khronos.org/SPIRV-Registry/nonsemantic/NonSemantic.Shader.DebugInfo.html#DebugDeclare),
[DebugExpression](https://github.khronos.org/SPIRV-Registry/nonsemantic/NonSemantic.Shader.DebugInfo.html#DebugExpression)
and
[DebugOperation](https://github.khronos.org/SPIRV-Registry/nonsemantic/NonSemantic.Shader.DebugInfo.html#DebugOperation).
Changes:
- Emit DebugDeclare from an indirect DBG_VALUE whose location register is
defined by OpVariable, which is what the spec requires of the Variable
operand. #dbg_declare does not survive as its own opcode in MIR, IRTranslator
lowers it to an indirect DBG_VALUE.
- Skip every other shape instead of emitting an invalid instruction: an access
chain into a field, an OpFunctionParameter for a byval argument, a constant
address, a register left without a def after dead storage was erased, a
variadic #dbg_value, an expression using an unmapped operation, and a variable
whose DebugLocalVariable was not emitted.
- Collect expressions from MIR, so DebugExpression and DebugOperation are
emitted at module scope and shared by every declare using the same
DIExpression.
- Map the nine operations the instruction set defines, and reject an
expression whole when an argument does not fit in 32 bits (as per spec).
- Cache DebugLocalVariable result ids, which emitDebugLocalVariable already
returned but nothing stored.
- Add tests for each emitted and skipped case, for the interaction with
DebugLine and DebugScope, and for the expression operations.
spirv-val and the spec disagree in two places, in opposite directions:
- DebugDeclare's Variable operand: spirv-val accepts an OpFunctionParameter,
while the spec names only OpVariable. This patch follows the spec, so the byval
case is skipped even though spirv-val would take it, see
debug-declare-function-parameter.ll.
- DebugGlobalVariable's Variable operand: spirv-val rejects a DebugExpression
there although the spec permits one, KhronosGroup/SPIRV-Tools#6469, see debug-global-variable-constant-value.ll.
Commit: fe825db56bfe2a59e31835f0d2b813a1b9b0c0cd
https://github.com/llvm/llvm-project/commit/fe825db56bfe2a59e31835f0d2b813a1b9b0c0cd
Author: Manuel Carrasco <Manuel.Carrasco at amd.com>
Date: 2026-09-11 (Fri, 11 Sep 2026)
Changed paths:
M llvm/test/CodeGen/SPIRV/debug-info/debug-declare-module-scope-variable.ll
Log Message:
-----------
Fix linter.
Commit: 089724ff9d65406c5a3fa4c2169e2aa97dc0a2c5
https://github.com/llvm/llvm-project/commit/089724ff9d65406c5a3fa4c2169e2aa97dc0a2c5
Author: Manuel Carrasco <Manuel.Carrasco at amd.com>
Date: 2026-09-11 (Fri, 11 Sep 2026)
Changed paths:
M llvm/lib/Target/SPIRV/SPIRVNonSemanticDebugHandler.cpp
Log Message:
-----------
[reviews] fix typos.
Commit: d36c99fe52646975929d0e996c0cd5b3c909c935
https://github.com/llvm/llvm-project/commit/d36c99fe52646975929d0e996c0cd5b3c909c935
Author: Manuel Carrasco <Manuel.Carrasco at amd.com>
Date: 2026-09-11 (Fri, 11 Sep 2026)
Changed paths:
M llvm/lib/Target/SPIRV/SPIRVNonSemanticDebugHandler.cpp
M llvm/lib/Target/SPIRV/SPIRVNonSemanticDebugHandler.h
A llvm/test/CodeGen/SPIRV/debug-info/debug-expression-operation-cache.ll
Log Message:
-----------
Cache DebugOperation.
Compare: https://github.com/llvm/llvm-project/compare/bab4f38c7842...d36c99fe5264
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list