Skip to content

Commit c8b46f1

Browse files
Merge branch 'sycl' into urlza428
2 parents ec36104 + 4679dc0 commit c8b46f1

File tree

86 files changed

+905
-809
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+905
-809
lines changed

.github/workflows/sycl-nightly.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ jobs:
110110
image_options: ${{ matrix.image_options }}
111111
target_devices: ${{ matrix.target_devices }}
112112
tests_selector: ${{ matrix.tests_selector }}
113-
extra_lit_opts: ${{ matrix.extra_lit_opts }}
113+
extra_lit_opts: "--param 'cxx_flags=-D_GLIBCXX_USE_CXX11_ABI=0' ${{ matrix.extra_lit_opts }}"
114114
reset_intel_gpu: ${{ matrix.reset_intel_gpu }}
115115
ref: ${{ github.sha }}
116116
merge_ref: ''

libclc/utils/libclc-remangler/LibclcRemangler.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,8 @@ class BumpPointerAllocator {
105105
public:
106106
BumpPointerAllocator()
107107
: BlockList(new(InitialBuffer) BlockMeta{nullptr, 0}) {}
108+
BumpPointerAllocator(const BumpPointerAllocator &) = delete;
109+
BumpPointerAllocator &operator=(const BumpPointerAllocator &) = delete;
108110

109111
void *allocate(size_t N) {
110112
N = (N + 15u) & ~15u;

llvm/include/llvm/Support/PropertySetIO.h

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,9 @@ class PropertySetRegistry {
212212
static constexpr char SYCL_VIRTUAL_FUNCTIONS[] = "SYCL/virtual functions";
213213
static constexpr char SYCL_IMPLICIT_LOCAL_ARG[] = "SYCL/implicit local arg";
214214

215+
static constexpr char PROPERTY_REQD_WORK_GROUP_SIZE[] =
216+
"reqd_work_group_size_uint64_t";
217+
215218
/// Function for bulk addition of an entire property set in the given
216219
/// \p Category .
217220
template <typename MapTy> void add(StringRef Category, const MapTy &Props) {
@@ -231,6 +234,17 @@ class PropertySetRegistry {
231234
PropSet.insert({PropName, PropertyValue(PropVal)});
232235
}
233236

237+
void remove(StringRef Category, StringRef PropName) {
238+
auto PropertySetIt = PropSetMap.find(Category);
239+
if (PropertySetIt == PropSetMap.end())
240+
return;
241+
auto &PropertySet = PropertySetIt->second;
242+
auto PropIt = PropertySet.find(PropName);
243+
if (PropIt == PropertySet.end())
244+
return;
245+
PropertySet.erase(PropIt);
246+
}
247+
234248
/// Parses from the given \p Buf a property set registry.
235249
static Expected<std::unique_ptr<PropertySetRegistry>>
236250
read(const MemoryBuffer *Buf);

llvm/lib/SYCLLowerIR/SYCLDeviceRequirements.cpp

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ SYCLDeviceRequirements
4040
llvm::computeDeviceRequirements(const Module &M,
4141
const SetVector<Function *> &EntryPoints) {
4242
SYCLDeviceRequirements Reqs;
43-
bool MultipleReqdWGSize = false;
4443
// Process all functions in the module
4544
for (const Function &F : M) {
4645
if (auto *MDN = F.getMetadata("sycl_used_aspects")) {
@@ -81,8 +80,6 @@ llvm::computeDeviceRequirements(const Module &M,
8180
ExtractUnsignedIntegerFromMDNodeOperand(MDN, I));
8281
if (!Reqs.ReqdWorkGroupSize.has_value())
8382
Reqs.ReqdWorkGroupSize = NewReqdWorkGroupSize;
84-
if (Reqs.ReqdWorkGroupSize != NewReqdWorkGroupSize)
85-
MultipleReqdWGSize = true;
8683
}
8784

8885
if (auto *MDN = F.getMetadata("sycl_joint_matrix")) {
@@ -119,13 +116,6 @@ llvm::computeDeviceRequirements(const Module &M,
119116
}
120117
}
121118

122-
// Usually, we would only expect one ReqdWGSize, as the module passed to
123-
// this function would be split according to that. However, when splitting
124-
// is disabled, this cannot be guaranteed. In this case, we reset the value,
125-
// which makes so that no value is reqd_work_group_size data is attached in
126-
// in the device image.
127-
if (MultipleReqdWGSize)
128-
Reqs.ReqdWorkGroupSize.reset();
129119
return Reqs;
130120
}
131121

@@ -152,7 +142,8 @@ std::map<StringRef, util::PropertyValue> SYCLDeviceRequirements::asMap() const {
152142
// reqd_work_group_size_uint64_t attribute. At the next ABI-breaking
153143
// window, this can be changed back to reqd_work_group_size.
154144
if (ReqdWorkGroupSize.has_value())
155-
Requirements["reqd_work_group_size_uint64_t"] = *ReqdWorkGroupSize;
145+
Requirements[util::PropertySetRegistry::PROPERTY_REQD_WORK_GROUP_SIZE] =
146+
*ReqdWorkGroupSize;
156147

157148
if (JointMatrix.has_value())
158149
Requirements["joint_matrix"] = *JointMatrix;

llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1379,7 +1379,7 @@ static void ExtendSpirKernelArgs(Module &M, FunctionAnalysisManager &FAM,
13791379
}
13801380

13811381
// New argument: uintptr_t as(1)*, which is allocated in shared USM buffer
1382-
Types.push_back(IntptrTy->getPointerTo(kSpirOffloadGlobalAS));
1382+
Types.push_back(llvm::PointerType::get(IntptrTy, kSpirOffloadGlobalAS));
13831383

13841384
FunctionType *NewFTy = FunctionType::get(F->getReturnType(), Types, false);
13851385

@@ -1704,7 +1704,7 @@ void AddressSanitizer::AppendDebugInfoToArgs(Instruction *InsertBefore,
17041704

17051705
// SPIR constant address space
17061706
PointerType *ConstASPtrTy =
1707-
Type::getInt8Ty(C)->getPointerTo(kSpirOffloadConstantAS);
1707+
llvm::PointerType::get(Type::getInt8Ty(C), kSpirOffloadConstantAS);
17081708

17091709
// File & Line
17101710
if (Loc) {
@@ -1863,9 +1863,9 @@ void AddressSanitizer::instrumentInitAsanLaunchInfo(
18631863
// FIXME: if the initial value of "__AsanLaunchInfo" is zero, we'll not need
18641864
// this step
18651865
initializeCallbacks(TLI);
1866-
IRB.CreateStore(
1867-
ConstantPointerNull::get(IntptrTy->getPointerTo(kSpirOffloadGlobalAS)),
1868-
AsanLaunchInfo);
1866+
IRB.CreateStore(ConstantPointerNull::get(
1867+
llvm::PointerType::get(IntptrTy, kSpirOffloadGlobalAS)),
1868+
AsanLaunchInfo);
18691869
}
18701870

18711871
// Instrument memset/memmove/memcpy
@@ -3457,7 +3457,7 @@ void AddressSanitizer::initializeCallbacks(const TargetLibraryInfo *TLI) {
34573457
// )
34583458
if (TargetTriple.isSPIROrSPIRV()) {
34593459
auto *Int8PtrTy =
3460-
Type::getInt8Ty(*C)->getPointerTo(kSpirOffloadConstantAS);
3460+
llvm::PointerType::get(Type::getInt8Ty(*C), kSpirOffloadConstantAS);
34613461

34623462
Args1.push_back(Int8PtrTy); // file
34633463
Args1.push_back(Type::getInt32Ty(*C)); // line
@@ -3574,9 +3574,10 @@ void AddressSanitizer::initializeCallbacks(const TargetLibraryInfo *TLI) {
35743574
IRB.getVoidTy(), IntptrTy, Int32Ty);
35753575

35763576
AsanLaunchInfo = M.getOrInsertGlobal(
3577-
"__AsanLaunchInfo", IntptrTy->getPointerTo(kSpirOffloadGlobalAS), [&] {
3577+
"__AsanLaunchInfo",
3578+
llvm::PointerType::get(IntptrTy, kSpirOffloadGlobalAS), [&] {
35783579
return new GlobalVariable(
3579-
M, IntptrTy->getPointerTo(kSpirOffloadGlobalAS), false,
3580+
M, llvm::PointerType::get(IntptrTy, kSpirOffloadGlobalAS), false,
35803581
GlobalVariable::ExternalLinkage, nullptr, "__AsanLaunchInfo",
35813582
nullptr, GlobalVariable::NotThreadLocal, kSpirOffloadLocalAS);
35823583
});

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,15 @@ std::string saveModuleProperties(module_split::ModuleDesc &MD,
310310
auto PropSet =
311311
computeModuleProperties(MD.getModule(), MD.entries(), GlobProps);
312312

313+
// When the split mode is none, the required work group size will be added
314+
// to the whole module, which will make the runtime unable to
315+
// launch the other kernels in the module that have different
316+
// required work group sizes or no required work group sizes. So we need to
317+
// remove the required work group size metadata in this case.
318+
if (SplitMode == module_split::SPLIT_NONE)
319+
PropSet.remove(PropSetRegTy::SYCL_DEVICE_REQUIREMENTS,
320+
PropSetRegTy::PROPERTY_REQD_WORK_GROUP_SIZE);
321+
313322
std::string NewSuff = Suff.str();
314323
if (!Target.empty()) {
315324
PropSet.add(PropSetRegTy::SYCL_DEVICE_REQUIREMENTS, "compile_target",
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
# commit a172cde4bc2857dcf74b0b2907a5b0f90566e808 (HEAD, origin/main, origin/HEAD)
2-
# Merge: 1851eff47b0a cde0d4c820b0
1+
# commit aa72577da55571b15028dd1710e02a7ea4f62338
2+
# Merge: 89def64486dd 3d2b7210e352
33
# Author: Martin Grant <[email protected]>
44
# Date: Thu Dec 5 12:29:44 2024 +0000
55
# Merge pull request #2249 from zhaomaosu/use-device-usm-for-rtl-data
66
# [DeviceASAN] Use device usm to sync asan runtime data instead of shared usm
7-
set(UNIFIED_RUNTIME_TAG 60e6f5e5e63b06e887aa2a692650b40f2fbc4b66)
7+
set(UNIFIED_RUNTIME_TAG dbf1b7073174777e2dbe01f40739f72f70e39302)

0 commit comments

Comments
 (0)