[all-commits] [llvm/llvm-project] 3db0dd: Implement support for NSDI DebugFunctionDefinition...
Manuel Carrasco via All-commits
all-commits at lists.llvm.org
Mon Aug 3 04:44:50 PDT 2026
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 3db0dd71c8579fb825bdd2c6148b53496e485375
https://github.com/llvm/llvm-project/commit/3db0dd71c8579fb825bdd2c6148b53496e485375
Author: Manuel Carrasco <Manuel.Carrasco at amd.com>
Date: 2026-08-03 (Mon, 03 Aug 2026)
Changed paths:
M llvm/lib/Target/SPIRV/SPIRVAsmPrinter.cpp
M llvm/lib/Target/SPIRV/SPIRVNonSemanticDebugHandler.cpp
M llvm/lib/Target/SPIRV/SPIRVNonSemanticDebugHandler.h
A llvm/test/CodeGen/SPIRV/debug-info/debug-function-definition-after-opvariable.ll
A llvm/test/CodeGen/SPIRV/debug-info/debug-function-definition-call-before-alloca.ll
A llvm/test/CodeGen/SPIRV/debug-info/debug-function-definition-calls.ll
A llvm/test/CodeGen/SPIRV/debug-info/debug-function-definition-external-call.ll
A llvm/test/CodeGen/SPIRV/debug-info/debug-function-definition.ll
Log Message:
-----------
Implement support for NSDI DebugFunctionDefinition. (#211853)
This PR depends on the DebugFunction PR:
https://github.com/llvm/llvm-project/pull/211760. This PR implements
support for
[DebugFunctionDefinition](https://github.khronos.org/SPIRV-Registry/nonsemantic/NonSemantic.Shader.DebugInfo.html#DebugFunctionDefinition).
DebugFunctionDefinition must be emitted within the instruction sequence
of its corresponding OpFunction. The current implementation inserts
DebugFunctionDefinition immediately after the last OpVariable, if one
exists, or otherwise immediately after the first OpLabel. The goal is to
satisfy the following
[requirement](https://github.khronos.org/SPIRV-Registry/nonsemantic/NonSemantic.Shader.DebugInfo.html#_binary_form):
> DebugScope, DebugNoScope, DebugDeclare, DebugValue, DebugLine,
DebugNoLine, and DebugFunctionDefinition instructions may interleave
with instructions inside a function, but they must appear at valid
locations within a block as required by SPV_KHR_non_semantic_info. In
particular, they cannot appear before any OpPhi or function-level
variable declarations in a block, and they cannot appear after a merge
instruction.
To support this, I updated SPIRVAsmPrinter to notify the debug handler
whenever an instruction is emitted. The debug handler maintains a small
amount of state so it can detect when the last OpVariable or the first
OpLabel has been emitted and insert DebugFunctionDefinition at the
appropriate location.
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