-
Notifications
You must be signed in to change notification settings - Fork 796
[sycl-post-link] Fix spec constant pattern match for DeviceSanitizer #14740
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
AlexeySachkov
merged 1 commit into
intel:sycl
from
wenju-he:SpecConstants-getStringLiteralArg-asan
Aug 1, 2024
Merged
Changes from all commits
Commits
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 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
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
33 changes: 33 additions & 0 deletions
33
llvm/test/SYCLLowerIR/SpecConstants/literal-address-alloca-asan.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,33 @@ | ||
| ; RUN: opt -passes=spec-constants %s -S -o - | FileCheck %s | ||
|
|
||
| ; Check there is no assert error when literal address is loaded from an alloca | ||
| ; with offset. | ||
|
|
||
| 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-G1" | ||
| target triple = "spir64-unknown-unknown" | ||
|
|
||
| %"class.sycl::_V1::specialization_id" = type { i32 } | ||
|
|
||
| @_ZL9test_id_1 = addrspace(1) constant %"class.sycl::_V1::specialization_id" { i32 42 } | ||
| @__usid_str = constant [36 x i8] c"uide7faddc6b4d2fe92____ZL9test_id_1\00" | ||
|
|
||
| define spir_func void @_ZZZ4mainENKUlRN4sycl3_V17handlerEE_clES2_ENKUlNS0_14kernel_handlerEE_clES4_(ptr addrspace(4) %this1.i7) { | ||
| entry: | ||
| %MyAlloca = alloca i8, i64 224, align 32 | ||
| %0 = ptrtoint ptr %MyAlloca to i64 | ||
| %1 = add i64 %0, 96 | ||
| %2 = inttoptr i64 %1 to ptr | ||
| %SymbolicID.ascast.i = addrspacecast ptr %2 to ptr addrspace(4) | ||
| store ptr addrspace(4) addrspacecast (ptr @__usid_str to ptr addrspace(4)), ptr addrspace(4) %SymbolicID.ascast.i, align 8 | ||
| %3 = load ptr addrspace(4), ptr addrspace(4) %SymbolicID.ascast.i, align 8 | ||
| %4 = load ptr addrspace(4), ptr addrspace(4) %this1.i7, align 8 | ||
|
|
||
| ; CHECK-NOT: call spir_func noundef i32 @_Z37__sycl_getScalar2020SpecConstantValueIiET_PKcPKvS4_( | ||
| ; CHECK: %conv = sitofp i32 %load to double | ||
|
|
||
| %call.i8 = call spir_func i32 @_Z37__sycl_getScalar2020SpecConstantValueIiET_PKcPKvS4_(ptr addrspace(4) %3, ptr addrspace(4) addrspacecast (ptr addrspace(1) @_ZL9test_id_1 to ptr addrspace(4)), ptr addrspace(4) %4) | ||
| %conv = sitofp i32 %call.i8 to double | ||
| ret void | ||
| } | ||
|
|
||
| declare spir_func i32 @_Z37__sycl_getScalar2020SpecConstantValueIiET_PKcPKvS4_(ptr addrspace(4), ptr addrspace(4), ptr addrspace(4)) |
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.
Thanks! Most of pass tests use incorrect approach with testing it through
sycl-post-link, this is a way better direction