You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[SPIR-V] -Gis flag causing invalid SPIR-V to be generated for mad for 32 bit integers #7706
The problem is that in handling the -Gis flag it blindly sticks the NoContraction flag all over instructions without checking if the instruction is already decorated.
Off the top of my head, I don't know how to fix it. The ideal solution is that the decorations would get uniqued at some point. Individual pass should not have to avoid adding the decoration because an earlier pass did or a later pass will. We will try to look into it soon.
Activity
llvm-beanz commentedon Aug 19, 2025
I looked briefly into this hoping it would be easy. I think the problem is a design flaw in the EmitVisitor which you can see here:
https://github.com/microsoft/DirectXShaderCompiler/blob/main/tools/clang/lib/SPIRV/EmitVisitor.cpp#L450
The problem is that in handling the
-Gisflag it blindly sticks the NoContraction flag all over instructions without checking if the instruction is already decorated.Curious if Steven Perron (@s-perron) and/or Nathan Gauër (@Keenuts) have an idea of how this could be done better.
Add `mad` tests (#316)
s-perron commentedon Aug 20, 2025
Off the top of my head, I don't know how to fix it. The ideal solution is that the decorations would get uniqued at some point. Individual pass should not have to avoid adding the decoration because an earlier pass did or a later pass will. We will try to look into it soon.
alsepkow commentedon Nov 19, 2026
test/Feature/HLSLLib/mad.32.test was referencing this bug in an XFAIL
But this fix KhronosGroup/SPIRV-Tools#6828 mitigates the issue. I'm removing the XFAIL but I think this bug still stands.
[HLSL] Remove resolved DXC Vulkan XFAIL for mad.32 (#1738)
joaosaffran commentedon Nov 19, 2026
This was fixed by: KhronosGroup/SPIRV-Tools#6828 and integrated in dxc when a497312 was merged