KhronosGroup / KhronosGroup/SPIRV-LLVM-Translator

Translator incapable to generate TypeStruct EntryPoint parameters

Open
#2,510 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
LLVM
Stars
625
Forks
279
Avg merge
3d 5h
Merged PRs (30d)
34

Description

clang following spir calling convention will generate byval pointer on a kernel if a structure is passed as kernel argument, see https://godbolt.org/z/c994q86xr .

Translator generates SPIR-V following input LLVM IR 1:1 and also generates byval pointer. Meanwhile in SPIR-V it's not disallowed to use directly TypeStruct EntryPoint parameter, and in some cases it's a missing optimization opportunity.

Need to investigate if we can promote byval pointer and if it breaks anything end-2-end

Contributor guide

Open the contributing guide

Research direction

Start with the linked Godbolt example and trace how the translator handles the clang-generated LLVM IR byval pointer for a kernel structure argument. Investigate whether promoting it to a SPIR-V TypeStruct EntryPoint parameter preserves end-to-end behavior; done means the approach is validated without breaking existing translation.

Written by the indexing model from the issue text.

Assessment

Domain
compilers
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.