microsoft / microsoft/DirectXShaderCompiler
DXC not optimizing out code related to groupshared
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 3.7k
- Forks
- 900
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 44
Description
For shader like this:
groupshared float a[10];
[numthreads(8,8,1)]
void main() {
a[0] = 1;
}
the output dxil is this:
@"\01?a@@3PAMA" = external addrspace(3) global [10 x float], align 4
define void @main() {
store float 1.000000e+00, float addrspace(3)* getelementptr inbounds ([10 x float], [10 x float] addrspace(3)* @"\01?a@@3PAMA", i32 0, i32 0), align 4, !tbaa !7
ret void
}
Expect the store and the global variable to be removed because there's only store on the global variabl.
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 HLSL reproducer in the issue and inspect the generated DXIL for the groupshared global and its store. Trace the optimization path that handles this shader and add or run a regression test; done means both the unused global and its store are absent from the output.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100