DirectXShaderCompiler
DirectXShaderCompiler copied to clipboard
DXC not optimizing out code related to groupshared
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.