Skip to content

Commit 652b46d

Browse files
[sycl-post-link] Set isEsimdImage property for ESIMD modules after splitting (#3131)
1 parent ae4c648 commit 652b46d

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

llvm/test/tools/sycl-post-link/sycl-esimd/basic-sycl-esimd-split.ll

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@
22
; RUN: FileCheck %s -input-file=%t.table
33
; RUN: FileCheck %s -input-file=%t_0.ll --check-prefixes CHECK-SYCL-IR
44
; RUN: FileCheck %s -input-file=%t_esimd_0.ll --check-prefixes CHECK-ESIMD-IR
5+
; RUN: FileCheck %s -input-file=%t_0.prop --check-prefixes CHECK-SYCL-PROP
6+
; RUN: FileCheck %s -input-file=%t_esimd_0.prop --check-prefixes CHECK-ESIMD-PROP
57

6-
; This is basic test of splitting SYCL and ESIMD kernels into separate
7-
; modules.
8+
; This is basic test of splitting SYCL and ESIMD kernels into separate modules.
9+
; ESIMD module should have isEsimdImage=1 property set after splitting.
810

911
target datalayout = "e-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024"
1012
target triple = "spir64-unknown-linux-sycldevice"
@@ -41,5 +43,10 @@ attributes #0 = { "sycl-module-id"="a.cpp" }
4143
; CHECK-SYCL-IR-DAG: define dso_local spir_kernel void @SYCL_kernel()
4244
; CHECK-SYCL-IR-DAG: declare dso_local spir_func i64 @_Z28__spirv_GlobalInvocationId_xv()
4345

46+
; CHECK-SYCL-PROP-NOT: isEsimdImage=1|1
47+
4448
; CHECK-ESIMD-IR-DAG: define dso_local spir_kernel void @ESIMD_kernel()
4549
; CHECK-ESIMD-IR-DAG: declare dso_local spir_func i64 @_Z28__spirv_GlobalInvocationId_xv()
50+
51+
; CHECK-ESIMD-PROP: [SYCL/misc properties]
52+
; CHECK-ESIMD-PROP: isEsimdImage=1|1

llvm/tools/sycl-post-link/sycl-post-link.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -586,6 +586,12 @@ static string_vector saveDeviceImageProperty(
586586
NameInfoPair.first, llvm::util::PropertyValue(Data, DataBitSize)));
587587
}
588588
}
589+
590+
if (ImgPSInfo.IsEsimdKernel) {
591+
PropSet[llvm::util::PropertySetRegistry::SYCL_MISC_PROP].insert(
592+
{"isEsimdImage", true});
593+
}
594+
589595
std::error_code EC;
590596
std::string SCFile =
591597
makeResultFileName(".prop", I, ImgPSInfo.IsEsimdKernel ? "esimd_" : "");

0 commit comments

Comments
 (0)