Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1344,7 +1344,7 @@ static void ExtendSpirKernelArgs(Module &M, FunctionAnalysisManager &FAM,

auto KernelName = F.getName();
auto *KernelNameGV = GetOrCreateGlobalString(
M, "__asan_kernel", KernelName, kSpirOffloadGlobalAS);
M, "__asan_kernel", KernelName, kSpirOffloadConstantAS);
SpirKernelsMetadata.emplace_back(ConstantStruct::get(
StructTy, ConstantExpr::getPointerCast(KernelNameGV, IntptrTy),
ConstantInt::get(IntptrTy, KernelName.size())));
Expand Down
4 changes: 2 additions & 2 deletions llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -763,7 +763,7 @@ Constant *getOrCreateGlobalString(Module &M, StringRef Name, StringRef Value,
static void extendSpirKernelArgs(Module &M) {
SmallVector<Constant *, 8> SpirKernelsMetadata;

auto DL = M.getDataLayout();
const auto &DL = M.getDataLayout();
Type *IntptrTy = DL.getIntPtrType(M.getContext());

// SpirKernelsMetadata only saves fixed kernels, and is described by
Expand All @@ -781,7 +781,7 @@ static void extendSpirKernelArgs(Module &M) {

auto KernelName = F.getName();
auto *KernelNameGV = getOrCreateGlobalString(M, "__msan_kernel", KernelName,
kSpirOffloadGlobalAS);
kSpirOffloadConstantAS);
SpirKernelsMetadata.emplace_back(ConstantStruct::get(
StructTy, ConstantExpr::getPointerCast(KernelNameGV, IntptrTy),
ConstantInt::get(IntptrTy, KernelName.size())));
Expand Down
Loading