https://github.com/YuriPlyakhin updated 
https://github.com/llvm/llvm-project/pull/197596

>From 542ca06bb75f351966a8f4369cacae623f798f50 Mon Sep 17 00:00:00 2001
From: "Plyakhin, Yury" <[email protected]>
Date: Thu, 14 May 2026 02:16:32 +0200
Subject: [PATCH 1/2] Remove unnecessary check for empty symbols image from
 clang-sycl-linker

---
 clang/tools/clang-sycl-linker/ClangSYCLLinker.cpp | 2 --
 1 file changed, 2 deletions(-)

diff --git a/clang/tools/clang-sycl-linker/ClangSYCLLinker.cpp 
b/clang/tools/clang-sycl-linker/ClangSYCLLinker.cpp
index f8c66f164754b..c6bbe6d42058d 100644
--- a/clang/tools/clang-sycl-linker/ClangSYCLLinker.cpp
+++ b/clang/tools/clang-sycl-linker/ClangSYCLLinker.cpp
@@ -698,8 +698,6 @@ Error runSYCLLink(ArrayRef<std::string> Files, const 
ArgList &Args) {
   // Collect all images to be packed into a single OffloadBinary.
   SmallVector<OffloadingImage> Images;
   for (SplitModule &SI : SplitModules) {
-    if (SI.Symbols.empty())
-      continue;
     llvm::ErrorOr<std::unique_ptr<llvm::MemoryBuffer>> FileOrErr =
         llvm::MemoryBuffer::getFileOrSTDIN(SI.ModuleFilePath);
     if (std::error_code EC = FileOrErr.getError()) {

>From 278aa9fac206a77c66e20941479c876a7b864bc9 Mon Sep 17 00:00:00 2001
From: "Plyakhin, Yury" <[email protected]>
Date: Fri, 15 May 2026 01:47:36 +0200
Subject: [PATCH 2/2] added test

---
 clang/test/Tooling/clang-sycl-linker.ll | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/clang/test/Tooling/clang-sycl-linker.ll 
b/clang/test/Tooling/clang-sycl-linker.ll
index 958dc031b6899..0e20f1cd0bdd8 100644
--- a/clang/test/Tooling/clang-sycl-linker.ll
+++ b/clang/test/Tooling/clang-sycl-linker.ll
@@ -72,6 +72,13 @@
 ; RUN: not clang-sycl-linker --dry-run %t/input1.bc %t/input2.bc -o a.out 2>&1 
\
 ; RUN:   | FileCheck %s --check-prefix=NOTARGET
 ; NOTARGET: Target triple must be specified
+;
+; Input with no entry points still produces an offload image.
+; RUN: llvm-as %t/no-entry-points.ll -o %t/no-entry-points.bc
+; RUN: clang-sycl-linker --dry-run -triple=spirv64 %t/no-entry-points.bc -o 
%t/no-entry-points.out
+; RUN: llvm-objdump --offloading %t/no-entry-points.out | FileCheck %s 
--check-prefix=NO-ENTRY-POINTS
+; NO-ENTRY-POINTS: OFFLOADING IMAGE [0]:
+; NO-ENTRY-POINTS: producer        sycl
 
 ;--- input1.ll
 target datalayout = 
"e-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-n8:16:32:64-G1"
@@ -92,3 +99,11 @@ define spir_kernel void @kernel_b() #0 {
 }
 
 attributes #0 = { "sycl-module-id"="TU2.cpp" }
+
+;--- no-entry-points.ll
+target datalayout = 
"e-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-n8:16:32:64-G1"
+target triple = "spirv64"
+
+define spir_func i32 @helper() {
+  ret i32 0
+}

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

Reply via email to