microsoft / microsoft/DirectXShaderCompiler
Usage of a matrix in a structure that is passed to groupshared memory does not get dead store eliminated
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 3.7k
- Forks
- 900
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 44
Description
Description
When passing a full matrix across to groupshared, elements that are never loaded don't have their stores properly deleted when the index is a compile time constant.
Steps to Reproduce
Add "#define TGSM_MATRIX" to the attached shader and see the number of "addrspace(3)" stores increase from 3 to 16 for the same structure.
Actual Behavior
Expected behavior is that there would only be 3 stores in either version of the shader.
Environment
- DXC version - Any
- Host Operating System - Any
tgsm_matrix.txt
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the attached tgsm_matrix.txt shader and reproduce the issue by adding #define TGSM_MATRIX. Compare the generated addrspace(3) stores in both variants, then trace the dead-store-elimination path responsible for the difference. Done means both versions produce only 3 stores, with coverage for the regression.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- compilers, performance
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100