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

Marcos Maronas via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 9 07:01:22 PDT 2026


================
@@ -1197,11 +1197,23 @@ 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())
+  if (GV.isDeclarationForLinker()) {
+    // Interface variables mustn't not get Import linkage.
----------------
maarquitos14 wrote:

```suggestion
    // Interface variables must not get Import linkage.
```

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


More information about the llvm-commits mailing list