https://github.com/Eric-Guo-NXP updated 
https://github.com/llvm/llvm-project/pull/202891

>From dbad6bd4a9e908820f6a539d7531af7dfc6951e4 Mon Sep 17 00:00:00 2001
From: Eric Guo <[email protected]>
Date: Tue, 16 Jun 2026 13:48:26 +0800
Subject: [PATCH] [libclc] Emit pristine frontend IR for SPIR-V to keep helpers
 inlinable

PR #158791 removed always_inline from _CLC_INLINE/_CLC_DEF. SPIR-V
targets built at -O0 and never run 'opt', so helpers are no longer
inlined and survive as real calls, causing NIR validation
failures in rusticl (e.g. OpenCL CTS math_brute_force -w cos).

Instead of re-forcing always_inline, build with
'-Xclang -disable-llvm-passes' so the frontend emits pristine IR where
helpers keep inlinehint and get inlined downstream.

Co-authored-by: Wenju He <[email protected]>
---
 libclc/CMakeLists.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libclc/CMakeLists.txt b/libclc/CMakeLists.txt
index bc3624688a087..a4d8fa5b0ccbf 100644
--- a/libclc/CMakeLists.txt
+++ b/libclc/CMakeLists.txt
@@ -145,7 +145,7 @@ if(LIBCLC_TARGET_ARCH IN_LIST LIBCLC_ARCHS_SPIRV)
   if(LIBCLC_TARGET_OS STREQUAL vulkan)
     list(APPEND target_compile_flags -Wno-unknown-assumption 
-U__opencl_c_int64)
   else()
-    list(APPEND target_compile_flags -O0 -finline-hint-functions)
+    list(APPEND target_compile_flags "SHELL:-Xclang -disable-llvm-passes")
     list(APPEND target_extra_defines CLC_SPIRV)
     set(opt_flags)
   endif()

_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to