Description
Loop unrolling causes duplicate decoration when the phi instruction is decorated. This is due to a bug in spirv-opt: KhronosGroup/SPIRV-Tools#6689
I've already provided a fix for the bug in spirv-tools: KhronosGroup/SPIRV-Tools#6690
But this will need to merged once the issue is fixed.
Steps to Reproduce
This is a simple shader that reproduces the issue:
RWStructuredBuffer<float> outp;
StructuredBuffer<float> inp;
[numthreads(1, 1, 1)]
void main() {
min16float acc = 0;
[unroll] for (uint i = 0; i < 8; i++) {
min16float x = (min16float)inp[i];
acc = min(acc, x * x);
}
outp[0] = acc;
}
You can check it out here: https://godbolt.org/z/eT7dr797f
Actual Behavior
The compiler produces this output:
fatal error: generated SPIR-V is invalid: ID '11' decorated with RelaxedPrecision multiple times is not allowed.
%11 = OpExtInst %float %1 NMin %23 %24
note: please file a bug report on https://github.com/Microsoft/DirectXShaderCompiler/issues with source code if possible
Compiler returned: 5
Environment
The issue occurs in dxc 1.10 and 1.9, but not in 1.8
Description
Loop unrolling causes duplicate decoration when the phi instruction is decorated. This is due to a bug in spirv-opt: KhronosGroup/SPIRV-Tools#6689
I've already provided a fix for the bug in spirv-tools: KhronosGroup/SPIRV-Tools#6690
But this will need to merged once the issue is fixed.
Steps to Reproduce
This is a simple shader that reproduces the issue:
You can check it out here: https://godbolt.org/z/eT7dr797f
Actual Behavior
The compiler produces this output:
Environment
The issue occurs in dxc 1.10 and 1.9, but not in 1.8