[llvm] [SPIRV] Emit intrinsics for globals only in function that references them (PR #178143)

Dmitry Sidorov via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 27 07:03:57 PST 2026


MrSidims wrote:

> Would it be possible to instead create some dummy `__global_init` function that holds all the global declaration/initialization instructions? Or is the problem then that we can't properly reference the global from within functions?

I believe it would cause a problem when a GV is referenced in other function. I feel like that global declarations handling in SPIR-V backend should be revisited as current approach causes multiple translation issues including translation of debug information.

https://github.com/llvm/llvm-project/pull/178143


More information about the llvm-commits mailing list