[llvm] [SPIR-V] Add NonSemantic.AuxData emission (-spirv-preserve-auxdata) and preserve available_externally linkage (PR #200002)

Juan Manuel Martinez CaamaƱo via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 2 02:17:15 PDT 2026


================
@@ -1217,6 +1217,11 @@ getSpirvLinkageTypeFor(const SPIRVSubtarget &ST, const GlobalValue &GV) {
   if (GV.hasLocalLinkage())
     return std::nullopt;
 
+  // Preserved via NonSemantic.AuxData; skip LinkageAttributes.
+  if (const auto *F = dyn_cast<Function>(&GV))
+    if (F->hasFnAttribute(SPIRV_WAS_AVAILABLE_EXTERNALLY_ATTR))
+      return std::nullopt;
+
----------------
jmmartinez wrote:

Should we check in here that the `SPIRV::Extension::SPV_KHR_non_semantic_info` is available?

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


More information about the llvm-commits mailing list