When a temporary OpForward instruction is needed during translation to SPIR-V, do not add the decorations yet, as that would result in duplicate decorations when the actual instruction is visited and the OpForward is replaced by a real SPIR-V instruction.
The SPIR-V Validator has recently started checking for duplicate decorations; this fixes some but not all issues arising from the new checks.
When a temporary
OpForward
instruction is needed during translation to SPIR-V, do not add the decorations yet, as that would result in duplicate decorations when the actual instruction is visited and theOpForward
is replaced by a real SPIR-V instruction.The SPIR-V Validator has recently started checking for duplicate decorations; this fixes some but not all issues arising from the new checks.
Contributes to https://github.com/KhronosGroup/SPIRV-LLVM-Translator/issues/2509
(cherry picked from commit a2783135be3f37f1e210aaf219b45a3226d32813)