KhronosGroup / SPIRV-LLVM-Translator

A tool and a library for bi-directional translation between SPIR-V and LLVM IR
Other
460 stars 207 forks source link

[Backport to 17][LLVM->SPIRV] Fix target id in decorates when there is forward decl (#2606) #2619

Closed wenju-he closed 1 week ago

wenju-he commented 1 week ago

When there is forward declaration of a spirv entry, its decorates are not translated until its definition is seen. Forward id is re-used for its entry. Id in entry decorates should use forward id as well.

(cherry picked from commit 305f48884606abf18306db9cdac1487ab6c5d3f1)

wenju-he commented 1 week ago

@MrSidims could you please review this PR? This is similar to https://github.com/KhronosGroup/SPIRV-LLVM-Translator/pull/2612