From ca428e3b3c2fc454ef50a08199a53f8a0a6798b3 Mon Sep 17 00:00:00 2001 From: Karol Herbst Date: Sat, 17 Jan 2026 01:04:20 +0100 Subject: [PATCH] nir: fix nir_fixup_is_exported for LLVM-22 Starting with LLVM-22 we won't see the kernel wrapper anymore, and this is a trivial fix to get around this. See: https://github.com/KhronosGroup/SPIRV-LLVM-Translator/commit/5458eb2511d618426a752bb7e986c5d6940a9bf8 Cc: mesa-stable Acked-by: Alyssa Rosenzweig Part-of: (cherry picked from commit 24d20df3d6be4917d1d221246632279d06e8c61e) --- .pick_status.json | 2 +- src/compiler/nir/nir_fixup_is_exported.c | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/.pick_status.json b/.pick_status.json index 1eb31ba857d..decff169d9b 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -1794,7 +1794,7 @@ "description": "nir: fix nir_fixup_is_exported for LLVM-22", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null, "notes": null diff --git a/src/compiler/nir/nir_fixup_is_exported.c b/src/compiler/nir/nir_fixup_is_exported.c index ed21b88481c..8d61b2e9b59 100644 --- a/src/compiler/nir/nir_fixup_is_exported.c +++ b/src/compiler/nir/nir_fixup_is_exported.c @@ -48,6 +48,15 @@ nir_fixup_is_exported(nir_shader *nir) nir_foreach_function(func, nir) { if (_mesa_set_search(shadowed, func->name)) { func->is_exported = func->is_entrypoint; + } else { + /* Starting with LLVM-22 we don't see the wrappers anymore, so we + * can simply export every entrypoint. + * + * We could do an LLVM version check here, but that's going to be a + * mess making nir depending on LLVM in any way and this seems to work + * for both situations. + */ + func->is_exported |= func->is_entrypoint; } if (func->name[0] == '_') {