[llvm] [SPIR-V] Fix lowering of declarations with hidden visibility (PR #185029)

Dmitry Sidorov via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 6 09:00:03 PST 2026


MrSidims wrote:

> I suppose this strips the visibility and on the way back it would all become default?

Correct, visibility will be lost.

>  For AMDGCN we tend to use protected for kernels and globals and hidden for everything else. 
> Does SPIR-V have a heuristic for this?

Per my perspective, lost of protected is not a problem at all of AMDGCN due to [it's already handled](https://github.com/llvm/llvm-project/blob/main/llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUTargetStreamer.cpp#L1022) by AMDGPU backend.

Hidden visibility is tricker. Neither https://github.com/KhronosGroup/SPIRV-LLVM-Translator nor https://github.com/ROCm/SPIRV-LLVM-Translator have it. While it's possible to add it, I doubt it's needed, since for AMDGCN SPIR-V flow would go through Comgr and it does internalization already, see https://github.com/ROCm/llvm-project/blob/amd-staging/amd/comgr/src/comgr-compiler.cpp#L1318 .

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


More information about the llvm-commits mailing list