-
Notifications
You must be signed in to change notification settings - Fork 797
[DeviceSanitizer] Do sanitize for device globals in AddressSanitizer pass #13678
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
f732178
[DeviceSanitizer] Do sanitize for device globals in AddressSanitizer …
zhaomaosu 186aa75
Merge branch 'sycl' into simplify-device-global
zhaomaosu 84079bc
Add lit tests and option
zhaomaosu 6d9cf77
Merge branch 'sycl' into simplify-device-global
zhaomaosu ef376bb
Minor updates
zhaomaosu 6194a5f
Merge branch 'sycl' into simplify-device-global
zhaomaosu d9c9b9f
Minor fix
zhaomaosu 311a2fe
Merge branch 'sycl' into simplify-device-global
zhaomaosu 3ec0ee0
Ignore __AsanDeviceGlobalMetadata in OffloadBundler
zhaomaosu cf9ed12
Merge branch 'sycl' into simplify-device-global
zhaomaosu 67267f6
Merge branch 'sycl' into simplify-device-global
zhaomaosu b1ac2b0
Update tag
zhaomaosu 26b621a
Merge branch 'sycl' into simplify-device-global
zhaomaosu 3fd3909
Merge branch 'sycl' into simplify-device-global
zhaomaosu 16fd8b5
Merge branch 'sycl' into simplify-device-global
zhaomaosu 12bcc7e
Update comments
zhaomaosu 7bdef55
Update per comment
zhaomaosu c8bf9a8
Bump UR tag
callumfare 96c36a9
Merge branch 'sycl' into simplify-device-global
callumfare File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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
This file contains hidden or 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
13 changes: 13 additions & 0 deletions
13
llvm/test/Instrumentation/AddressSanitizer/SPIRV/device_global.ll
This file contains hidden or 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,13 @@ | ||
; RUN: opt < %s -passes=asan -asan-instrumentation-with-call-threshold=0 -asan-stack=0 -asan-globals=0 -asan-constructor-kind=none -S | FileCheck %s | ||
|
||
; check that image scope device globals can be correctly instrumented. | ||
|
||
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" | ||
target triple = "spir64-unknown-unknown" | ||
|
||
@dev_global = addrspace(1) global { [4 x i32] } zeroinitializer #0 | ||
|
||
; CHECK: @dev_global = addrspace(1) global { { [4 x i32] }, [16 x i8] } | ||
; CHECK: @__AsanDeviceGlobalMetadata = appending local_unnamed_addr addrspace(1) global [1 x { i64, i64, i64 }] [{ i64, i64, i64 } { i64 16, i64 32, i64 ptrtoint (ptr addrspace(1) @dev_global to i64) }] | ||
|
||
attributes #0 = { "sycl-device-global-size"="16" "sycl-device-image-scope" } |
11 changes: 11 additions & 0 deletions
11
llvm/test/Instrumentation/AddressSanitizer/SPIRV/device_global_non_image_scope.ll
This file contains hidden or 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,11 @@ | ||
; RUN: opt < %s -passes=asan -asan-instrumentation-with-call-threshold=0 -asan-stack=0 -asan-globals=0 -asan-constructor-kind=none -S | FileCheck %s | ||
|
||
; check non image scope device globals will not be instrumented. | ||
|
||
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" | ||
target triple = "spir64-unknown-unknown" | ||
|
||
@dev_global = addrspace(1) global { ptr addrspace(1), [4 x i32] } zeroinitializer | ||
|
||
; CHECK: @dev_global = addrspace(1) global { ptr addrspace(1), [4 x i32] } | ||
; CHECK-NOT: @__AsanDeviceGlobalMetadata |
This file contains hidden or 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
This file contains hidden or 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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
# commit 30391c65d2d2ccc7ee3688a14815804bfb7fdf05 | ||
# Merge: 5e6d79b3 58dabfe8 | ||
# commit 0ea47d7c70b9a21a3d90612a0a0e7525034e62f7 | ||
# Merge: e3247c23 e36941cb | ||
# Author: Callum Fare <callum@codeplay.com> | ||
# Date: Fri Nov 15 15:13:20 2024 +0000 | ||
# Merge pull request #2222 from RossBrunton/ross/cfi | ||
# Enable -flto and -fsanitize=cfi in clang | ||
set(UNIFIED_RUNTIME_TAG 30391c65d2d2ccc7ee3688a14815804bfb7fdf05) | ||
# Date: Tue Nov 19 10:24:08 2024 +0000 | ||
# Merge pull request #1584 from zhaomaosu/simplify-device-global | ||
# [DeviceSanitizer] Remove device global "__AsanDeviceGlobalCount" | ||
set(UNIFIED_RUNTIME_TAG 0ea47d7c70b9a21a3d90612a0a0e7525034e62f7) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we upstream this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this is a device sanitizer specific change, it's better to only keep it in intel/llvm unless we have plans to upstream whole device sanitizer implementation.