forked from intel/llvm
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[DeviceSanitizer] Don't instrument referenced-indirectly functions (i…
…ntel#14298) When we create SLM __AsanLaunchInfo and store newly added kernel arg __asan_launch into the SLM, the SLM is loaded in asan report function. If instructions in referenced-indirectly function are instrumented, the report function is called. However, access to SLM in referenced- indirectly function isn't supported in intel-graphics-compiler yet.
- Loading branch information
Showing
2 changed files
with
33 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
llvm/test/Instrumentation/AddressSanitizer/SPIRV/skip_referenced_indirectly.ll
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
; RUN: opt < %s -passes=asan -asan-instrumentation-with-call-threshold=0 | FileCheck %s | ||
|
||
; Check referenced-indirectly function isn't instrumented. | ||
|
||
target triple = "spir64-unknown-unknown" | ||
|
||
%structtype = type { [3 x ptr addrspace(4)] } | ||
%class.Base = type <{ ptr addrspace(4), i32, [4 x i8] }> | ||
@_ZTV8Derived1 = linkonce_odr addrspace(1) constant %structtype { [3 x ptr addrspace(4)] [ptr addrspace(4) null, ptr addrspace(4) null, ptr addrspace(4) addrspacecast (ptr @_ZN8Derived17displayEv to ptr addrspace(4))] }, align 8, !spirv.Decorations !0 | ||
|
||
define linkonce_odr spir_func i32 @_ZN8Derived17displayEv(ptr addrspace(4) align 8 %this) sanitize_address "referenced-indirectly" { | ||
entry: | ||
; CHECK-NOT: call void @__asan_load | ||
|
||
%base_data = getelementptr inbounds %class.Base, ptr addrspace(4) %this, i64 0, i32 1 | ||
%1 = load i32, ptr addrspace(4) %base_data, align 8 | ||
ret i32 %1 | ||
} | ||
|
||
!0 = !{!1, !2, !3} | ||
!1 = !{i32 22} | ||
!2 = !{i32 41, !"_ZTV8Derived1", i32 2} | ||
!3 = !{i32 44, i32 8} |