-
Notifications
You must be signed in to change notification settings - Fork 809
[SYCL] Initial printf support for non-constant AS format strings #5069
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 1 commit
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
7f05718
[SYCL] Initial printf support for non-constant AS format strings
0039b2c
Code style & a few conceptual upgrades
a24796d
Register the pass with the new pass manager
b5dc85a
Merge remote-tracking branch 'intel/sycl' into printf-address-space
f134ee8
Ensure correct llvm::Type* for literal & more refactoring
c16fcbb
Improve the function search
41eaf3b
Ugly implementation for the O1 case
a26f7c8
Extend value stripping to loads/stores for O0 cases
9150b8d
Replace call operands instead of re-creating calls
f467434
Huge refactoring
00066b6
More refactoring & descriptive comments added
896f296
Fix comment style
2fa7434
Refactor getCASLiteral back to being a function
ac0372b
Merge remote-tracking branch 'intel/sycl' into printf-address-space
1e83f16
Avoid "null character SetName" assertions caused by StringRef specifics
5c5b875
Improve formatting
e5ae867
Avoid using the error-prone Module::getOrInsertGlobal w/ callback
39efbb4
Wrap the newly created globals into constant pointer casts if needed
4d1c6be
Replace the wrapper calls directly with builtin calls
87d4137
Add LIT tests
6c8122b
Simplify call replacing (since we're always dealing with constants)
c1563da
Correct registration with the new PM & run LITs with that as well
f783309
[Review] Move/rename the LIT tests
52f7ca7
[Review] Address LIT-related comments
a37be74
[Review] Address code comments, pt. I
d2fb5f9
[Review][RFC] Address code comments, pt. II
6959690
[Review] Address code comments, pt. III
dd68d58
[Review] Update CODEOWNERS
d74fb42
[Review] Address code comments, pt. IV
040752c
[Review] Update the comment section in builtins.hpp
ee76f9d
Fix LIT setup for negative checks & factor them out into a separate test
1e3493e
Remove unneeded CHECK-NOT's from regular LIT
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
18 changes: 18 additions & 0 deletions
18
llvm/test/SYCLLowerIR/printf_addrspace/generic_as_negative_checks.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,18 @@ | ||
| ; generic_as.ll | ||
| ; RUN: opt < %S/generic_as.ll --SYCLMutatePrintfAddrspace -S | FileCheck %s --check-prefix=CHECK-BUILTIN | ||
| ; RUN: opt < %S/generic_as.ll --SYCLMutatePrintfAddrspace -S --enable-new-pm=1 | FileCheck %s --check-prefix=CHECK-BUILTIN | ||
|
|
||
| ; generic_as_no_opt.ll | ||
| ; RUN: opt < %S/generic_as_no_opt.ll --SYCLMutatePrintfAddrspace -S | FileCheck %s --check-prefixes=CHECK-WRAPPER,CHECK-BUILTIN | ||
| ; RUN: opt < %S/generic_as_no_opt.ll --SYCLMutatePrintfAddrspace -S --enable-new-pm=1 | FileCheck %s --check-prefixes=CHECK-WRAPPER,CHECK-BUILTIN | ||
|
|
||
| ; generic_as_variadic.ll | ||
| ; RUN: opt < %S/generic_as_variadic.ll --SYCLMutatePrintfAddrspace -S | FileCheck %s --check-prefix=CHECK-BUILTIN | ||
| ; RUN: opt < %S/generic_as_variadic.ll --SYCLMutatePrintfAddrspace -S --enable-new-pm=1 | FileCheck %s --check-prefix=CHECK-BUILTIN | ||
|
|
||
| ; Check that the wrapper bodies have been deleted after call replacement | ||
| ; CHECK-WRAPPER-NOT: spir_func i32 @{{.*}}sycl{{.*}}printf | ||
|
|
||
| ; Make sure the generic AS declarations have been wiped out | ||
| ; in favor of the single constant AS & variadic declaration: | ||
| ; CHECK-BUILTIN-NOT: declare dso_local spir_func i32 @_Z18__spirv_ocl_printf{{.*}}(i8 addrspace(4)*, {{.+}}) |
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
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.
Uh oh!
There was an error while loading. Please reload this page.