[llvm] [SPIRV] Handle `externally_initialized` for AMDGCN flavoured SPIRV (PR #175277)

Dmitry Sidorov via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 12 05:38:10 PST 2026


MrSidims wrote:

To clarify, the problem statement is: you want to preserve `externally_initialized` after LLVM IR -> SPIR-V -> LLVM IR roundtrip to avoid a situation, when an LLVM rule "_By default, global initializers are optimized by assuming that global variables defined within the module are not modified from their initial values before the start of the global initializer._" kicks in somewhere after SPIR-V consumer, right?

I'm not sure, what `__managed__` keyword does, but for `__constant__` it seem to be reasonable to just add `externally_initialized` to a GV during SPIR-V -> LLVM IR translation if the GV is in `UniformConstant` storage. WDYT?

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


More information about the llvm-commits mailing list