[llvm] [SPIR-V] Fix lowering of declarations with hidden visibility (PR #185029)
Steven Perron via llvm-commits
llvm-commits at lists.llvm.org
Wed Mar 11 06:19:50 PDT 2026
================
@@ -1197,11 +1197,28 @@ Type *reconstitutePeeledArrayType(Type *Ty) {
std::optional<SPIRV::LinkageType::LinkageType>
getSpirvLinkageTypeFor(const SPIRVSubtarget &ST, const GlobalValue &GV) {
- if (GV.hasLocalLinkage() || GV.hasHiddenVisibility())
+ if (GV.hasLocalLinkage())
return std::nullopt;
- if (GV.isDeclarationForLinker())
+ // Shader targets do not support the Linkage capability unless the module
+ // is a shader library.
+ if (ST.isShader() && !ST.isShaderLibrary())
+ return std::nullopt;
----------------
s-perron wrote:
This is interesting and good to know. There have been informal discussions about enabling linking on SPIR-V for HLSL, but the current linkage capabilities are not expressive enough. It would be nice to have a design doc or something explaining it, and we can see how it will fit with our plans, or if we have any suggestions to make it work better for both of us.
For now, I've approved this PR.
https://github.com/llvm/llvm-project/pull/185029
More information about the llvm-commits
mailing list