KhronosGroup / KhronosGroup/SPIRV-LLVM-Translator
SPIR-V validation failed: OpenCL.DebugInfo.100 DebugFunction: expected operand Declaration must be a result id of DebugFunctionDeclaration
- Dominant language
- LLVM
- Stars
- 625
- Forks
- 279
- Avg merge
- 3d 5h
- Merged PRs (30d)
- 34
Description
; Steps to reproduce:
; 1. llvm-spirv --spirv-max-version=1.1 --spirv-ext=+all -o reproducer.spv debug_spirv_reproducer.ll
; 2. spirv-val reproducer.spv
;
; Expected error:
; SPIR-V validation failed: OpenCL.DebugInfo.100 DebugFunction: expected operand Declaration must be a result id of DebugFunctionDeclaration
; %N = OpExtInst %void %2 DebugFunction %M %L %K 4 0 %J %O FlagIsDefinition|FlagPrototyped 4 %_Z5kernelv %P
;
; The issue: llvm-spirv generates DebugFunction with DebugInfoNone instead of DebugFunctionDeclaration
[debug_spirv_reproducer.ll.zip](https://github.com/user-attachments/files/20959551/debug_spirv_reproducer.ll.zip)
Contributor guide
Research direction
Start with the attached debug_spirv_reproducer.ll and reproduce the failure using the listed llvm-spirv command, then run spirv-val on reproducer.spv. Trace how the DebugFunction declaration operand is generated and compare it with the expected DebugFunctionDeclaration result id. Done means the reproducer validates without the reported operand error.
Written by the indexing model from the issue text.
Assessment
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 43/100