Skip to content

Commit 7452e5d

Browse files
committed
merge sanitizer kernel metadata pass
1 parent fb32ace commit 7452e5d

File tree

5 files changed

+10
-92
lines changed

5 files changed

+10
-92
lines changed

llvm/include/llvm/SYCLLowerIR/AsanKernelMetadata.h

Lines changed: 0 additions & 23 deletions
This file was deleted.

llvm/lib/SYCLLowerIR/AsanKernelMetadata.cpp

Lines changed: 0 additions & 63 deletions
This file was deleted.

llvm/lib/SYCLLowerIR/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ add_llvm_component_library(LLVMSYCLLowerIR
6969
SYCLPropagateJointMatrixUsage.cpp
7070
SYCLVirtualFunctionsAnalysis.cpp
7171
SYCLUtils.cpp
72-
AsanKernelMetadata.cpp
7372

7473
LocalAccessorToSharedMemory.cpp
7574
GlobalOffset.cpp

llvm/lib/SYCLLowerIR/SanitizerKernelMetadata.cpp

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
//
77
//===----------------------------------------------------------------------===//
88
// This pass fixes attributes and metadata of global variable
9-
// "__SanitizerKernelMetadata".
10-
// We treat "__SanitizerKernelMetadata" as a device global variable, so that it
11-
// can be read by runtime. "spirv.Decorations" is removed by llvm-link, so we
12-
// add it here again.
9+
// "__AsanKernelMetadata" or "__MsanKernelMetadata".
10+
// We treat "KernelMetadata" as a device global variable, so that it
11+
// can be read by runtime.
12+
// "spirv.Decorations" is removed by llvm-link, so we add it here again.
1313
//===----------------------------------------------------------------------===//
1414

1515
#include "llvm/SYCLLowerIR/SanitizerKernelMetadata.h"
@@ -27,7 +27,11 @@ constexpr uint32_t SPIRV_HOST_ACCESS_DECOR = 6147;
2727

2828
PreservedAnalyses SanitizerKernelMetadataPass::run(Module &M,
2929
ModuleAnalysisManager &MAM) {
30-
auto *KernelMetadata = M.getNamedGlobal("__MsanKernelMetadata");
30+
auto *KernelMetadata = M.getNamedGlobal("__AsanKernelMetadata");
31+
32+
if (!KernelMetadata)
33+
KernelMetadata = M.getNamedGlobal("__MsanKernelMetadata");
34+
3135
if (!KernelMetadata)
3236
return PreservedAnalyses::all();
3337

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -795,6 +795,7 @@ processInputModule(std::unique_ptr<Module> M) {
795795
if (isModuleUsingAsan(*M) || isModuleUsingMsan(*M)) {
796796
// Fix attributes and metadata of KernelMetadata
797797
Modified |= runModulePass<SanitizerKernelMetadataPass>(*M);
798+
}
798799

799800
// Transform Joint Matrix builtin calls to align them with SPIR-V friendly
800801
// LLVM IR specification.

0 commit comments

Comments
 (0)