Skip to content

Commit 0f19fbd

Browse files
committed
[SYCL] Use legacy offload entry type for now
llvm/llvm-project#124018 has switched to new offload entry, we need to sync with all runtimes before switching, use legacy offload entry for now.
1 parent b0d0081 commit 0f19fbd

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

llvm/lib/Frontend/Offloading/SYCLOffloadWrapper.cpp

+13-1
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,18 @@ int8_t binaryImageFormatToInt8(SYCLBinaryImageFormat Format) {
6262
}
6363
}
6464

65+
StructType* getLegacyOffloadEntryTy(Module &M) {
66+
LLVMContext &C = M.getContext();
67+
StructType *EntryTy =
68+
StructType::getTypeByName(C, "struct.__tgt_offload_entry");
69+
if (!EntryTy)
70+
EntryTy = StructType::create(
71+
"struct.__tgt_offload_entry", PointerType::getUnqual(C),
72+
PointerType::getUnqual(C), M.getDataLayout().getIntPtrType(C),
73+
Type::getInt32Ty(C), Type::getInt32Ty(C));
74+
return EntryTy;
75+
}
76+
6577
/// Wrapper helper class that creates all LLVM IRs wrapping given images.
6678
/// Note: All created structures, "_pi_device_*", "__sycl_*" and "__tgt*" names
6779
/// in this implementation are aligned with "sycl/include/sycl/detail/pi.h".
@@ -83,7 +95,7 @@ struct Wrapper {
8395

8496
SyclPropTy = getSyclPropTy();
8597
SyclPropSetTy = getSyclPropSetTy();
86-
EntryTy = offloading::getEntryTy(M);
98+
EntryTy = getLegacyOffloadEntryTy(M);
8799
SyclDeviceImageTy = getSyclDeviceImageTy();
88100
SyclBinDescTy = getSyclBinDescTy();
89101
}

0 commit comments

Comments
 (0)