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,
1450
1450
const StackSafetyGlobalInfo *const SSGI =
1451
1451
ClUseStackSafety ? &MAM.getResult <StackSafetyGlobalAnalysis>(M) : nullptr ;
1452
1452
1453
- if (Triple (M.getTargetTriple ()).isSPIROrSPIRV ())
1453
+ if (Triple (M.getTargetTriple ()).isSPIROrSPIRV ()) {
1454
1454
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
+ }
1455
1461
1456
1462
for (Function &F : M) {
1457
1463
AddressSanitizer FunctionSanitizer (
@@ -3497,10 +3503,6 @@ bool AddressSanitizer::instrumentFunction(Function &F,
3497
3503
// function isn't supported yet in intel-graphics-compiler.
3498
3504
if (F.hasFnAttribute (" referenced-indirectly" ))
3499
3505
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 ;
3504
3506
}
3505
3507
3506
3508
bool FunctionModified = false ;
Original file line number Diff line number Diff line change 3
3
target 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"
4
4
target triple = "spir64-unknown-unknown"
5
5
6
+ ;;
7
+ ;; W/A: We skip asan completely if one module has esimd
8
+ ;;
9
+
6
10
define spir_kernel void @sycl_kernel (ptr addrspace (1 ) %p ) #0 {
7
11
; CHECK-LABEL: define spir_kernel void @sycl_kernel(ptr addrspace(1) %p, ptr addrspace(1) %__asan_launch) #0
8
12
entry:
9
13
%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
12
16
ret void
13
17
}
14
18
You can’t perform that action at this time.
0 commit comments