File tree Expand file tree Collapse file tree 2 files changed +13
-7
lines changed
lib/Transforms/Instrumentation
test/Instrumentation/AddressSanitizer/SPIRV Expand file tree Collapse file tree 2 files changed +13
-7
lines changed Original file line number Diff line number Diff line change @@ -1450,8 +1450,14 @@ PreservedAnalyses AddressSanitizerPass::run(Module &M,
14501450 const StackSafetyGlobalInfo *const SSGI =
14511451 ClUseStackSafety ? &MAM.getResult <StackSafetyGlobalAnalysis>(M) : nullptr ;
14521452
1453- if (Triple (M.getTargetTriple ()).isSPIROrSPIRV ())
1453+ if (Triple (M.getTargetTriple ()).isSPIROrSPIRV ()) {
14541454 ExtendSpirKernelArgs (M, FAM);
1455+ // FIXME: W/A skip instrumentation if this module has ESIMD
1456+ for (auto &F : M) {
1457+ if (F.hasMetadata (" sycl_explicit_simd" ))
1458+ return PreservedAnalyses::all ();
1459+ }
1460+ }
14551461
14561462 for (Function &F : M) {
14571463 AddressSanitizer FunctionSanitizer (
@@ -3497,10 +3503,6 @@ bool AddressSanitizer::instrumentFunction(Function &F,
34973503 // function isn't supported yet in intel-graphics-compiler.
34983504 if (F.hasFnAttribute (" referenced-indirectly" ))
34993505 return false ;
3500- // FIXME: ESIMD kernel doesn't support noinline functions, so we can't
3501- // support sanitizer for it
3502- if (F.hasMetadata (" sycl_explicit_simd" ))
3503- return false ;
35043506 }
35053507
35063508 bool FunctionModified = false ;
Original file line number Diff line number Diff line change 33target datalayout = "e-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-n8:16:32:64"
44target triple = "spir64-unknown-unknown"
55
6+ ;;
7+ ;; W/A: We skip asan completely if one module has esimd
8+ ;;
9+
610define spir_kernel void @sycl_kernel (ptr addrspace (1 ) %p ) #0 {
711; CHECK-LABEL: define spir_kernel void @sycl_kernel(ptr addrspace(1) %p, ptr addrspace(1) %__asan_launch) #0
812entry:
913 %0 = load i32 , ptr addrspace (1 ) %p , align 4
10- ; CHECK: store ptr addrspace(1) %__asan_launch, ptr addrspace(3) @__AsanLaunchInfo, align 8
11- ; CHECK: call void @__asan_load4
14+ ; CHECK-NOT : store ptr addrspace(1) %__asan_launch, ptr addrspace(3) @__AsanLaunchInfo, align 8
15+ ; CHECK-NOT : call void @__asan_load4
1216 ret void
1317}
1418
You can’t perform that action at this time.
0 commit comments