From 09168482793302bc076f08f86d604e96bb19d7f8 Mon Sep 17 00:00:00 2001 From: Maksim Sabianin Date: Tue, 23 Jun 2026 17:16:28 +0200 Subject: [PATCH 1/3] [SYCL] Fix skipped check for device_global property in SYCLPostLink This check used to be skipped in the release compilation mode because IR dumping is turned off there. fixes: CMPLRLLVM-74325 --- llvm/lib/SYCLPostLink/ComputeModuleRuntimeInfo.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/llvm/lib/SYCLPostLink/ComputeModuleRuntimeInfo.cpp b/llvm/lib/SYCLPostLink/ComputeModuleRuntimeInfo.cpp index f08bf1a848604..165510c6a4ea1 100644 --- a/llvm/lib/SYCLPostLink/ComputeModuleRuntimeInfo.cpp +++ b/llvm/lib/SYCLPostLink/ComputeModuleRuntimeInfo.cpp @@ -248,11 +248,12 @@ PropSetRegTy computeModuleProperties(const Module &M, if (!GV.hasExternalLinkage()) continue; + if (!isa(GV.getValueType()) + continue; + // Check if it's a device_global by type name (declarations don't have // attributes). - std::string TypeName; - raw_string_ostream(TypeName) << *GV.getValueType(); - + StringRef TypeName = GV.getValueType()->getStructName(); if (TypeName.find("device_global") == std::string::npos) continue; From d6b215af618d2776bc0ff1288f7012c701c2f289 Mon Sep 17 00:00:00 2001 From: Maksim Sabianin Date: Wed, 24 Jun 2026 14:02:41 +0200 Subject: [PATCH 2/3] Update ComputeModuleRuntimeInfo.cpp --- llvm/lib/SYCLPostLink/ComputeModuleRuntimeInfo.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llvm/lib/SYCLPostLink/ComputeModuleRuntimeInfo.cpp b/llvm/lib/SYCLPostLink/ComputeModuleRuntimeInfo.cpp index 165510c6a4ea1..7375b9a33fd0a 100644 --- a/llvm/lib/SYCLPostLink/ComputeModuleRuntimeInfo.cpp +++ b/llvm/lib/SYCLPostLink/ComputeModuleRuntimeInfo.cpp @@ -248,7 +248,7 @@ PropSetRegTy computeModuleProperties(const Module &M, if (!GV.hasExternalLinkage()) continue; - if (!isa(GV.getValueType()) + if (!isa(GV.getValueType())) continue; // Check if it's a device_global by type name (declarations don't have From e5557f2c9c2e17411c6de6ff919702943cf8b3cd Mon Sep 17 00:00:00 2001 From: Maksim Sabianin Date: Wed, 24 Jun 2026 17:28:52 +0200 Subject: [PATCH 3/3] Update ComputeModuleRuntimeInfo.cpp --- llvm/lib/SYCLPostLink/ComputeModuleRuntimeInfo.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/llvm/lib/SYCLPostLink/ComputeModuleRuntimeInfo.cpp b/llvm/lib/SYCLPostLink/ComputeModuleRuntimeInfo.cpp index 7375b9a33fd0a..f69fad9573aa4 100644 --- a/llvm/lib/SYCLPostLink/ComputeModuleRuntimeInfo.cpp +++ b/llvm/lib/SYCLPostLink/ComputeModuleRuntimeInfo.cpp @@ -248,12 +248,13 @@ PropSetRegTy computeModuleProperties(const Module &M, if (!GV.hasExternalLinkage()) continue; - if (!isa(GV.getValueType())) + auto *ST = dyn_cast(GV.getValueType()); + if (!ST || ST->isLiteral()) // Literal structs don't have names. continue; // Check if it's a device_global by type name (declarations don't have // attributes). - StringRef TypeName = GV.getValueType()->getStructName(); + StringRef TypeName = ST->getStructName(); if (TypeName.find("device_global") == std::string::npos) continue;