KhronosGroup / KhronosGroup/SPIRV-LLVM-Translator
spirv-val reports undefined function ID when using OpTaskSequenceCreateINTEL
- Dominant language
- LLVM
- Stars
- 625
- Forks
- 279
- Avg merge
- 3d 5h
- Merged PRs (30d)
- 34
Description
In the test file of SPV_INTEL_task_sequence, the following test files
```
task_sequence_zero_capacity_literals.ll
task_sequence.ll
```
we observe the following validation error when running spirv-val:
```
error: line 83: ID '24[%_Z4multii]' has not been defined
%call_i1 = OpTaskSequenceCreateINTEL %17 %_Z4multii 10 4294967295 17 1
```
The SPIR-V emitted by the backend places the instruction:
` %call_i1 = OpTaskSequenceCreateINTEL %17 %_Z4multii 10 4294967295 17 1`
before the definition of the %_Z4multii function. Since SPIR-V validation requires that all IDs used must be declared before use (especially function IDs), this leads to a validation error.
Contributor guide
Research direction
Start with the SPV_INTEL_task_sequence tests, especially task_sequence_zero_capacity_literals.ll and task_sequence.ll, and reproduce the failure with spirv-val. Trace the backend output around OpTaskSequenceCreateINTEL and the %_Z4multii function; done means both test files emit valid SPIR-V without an undefined-function-ID validation error.
Written by the indexing model from the issue text.
Assessment
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100