-
Notifications
You must be signed in to change notification settings - Fork 15k
[offload][SYCL] Add SYCL Module splitting #119713
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 2 commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
bf48915
[offload][SYCL] Add SYCL Module splitting
maksimsab 115cf87
Address code review feedback.
maksimsab 521ff0d
Merge branch 'main' into split_patch2
maksimsab c054d0f
rename splitSYCLModule to SYCLSplitModule
maksimsab 122425c
Resolve recent CR nits
maksimsab 33b8865
Address some CR issues
maksimsab 18843ff
Perform renaming and simplification of the test
maksimsab e9101e6
remove per-reqd-* tests since corresponding functionality was exclude…
maksimsab 7e84a25
Rework split-with-kernel-declarations.ll.
maksimsab cf807da
remove basic-module-split.ll since it is a copy of split-by-source.ll
maksimsab 92ee37b
Simplify and remove trash
maksimsab 306e3f6
rename the test
maksimsab e223023
add source mode to complex-indirect-call-chain.ll
maksimsab 0a8cc6f
rework tests
maksimsab 9cc3f7f
Merge branch 'main' into split_patch2
maksimsab e0b2b9c
fix typo
maksimsab 958552a
address CR issue
maksimsab 5785d76
fix mistake
maksimsab 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
120 changes: 0 additions & 120 deletions
120
llvm/test/tools/llvm-split/SYCL/device-code-split/auto-module-split-1.ll
bader marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
This file was deleted.
Oops, something went wrong.
107 changes: 107 additions & 0 deletions
107
llvm/test/tools/llvm-split/SYCL/device-code-split/split-by-source.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,107 @@ | ||
| ; Test checks that kernels are being split by attached TU metadata and | ||
| ; used functions are being moved with kernels that use them. | ||
|
|
||
| ; RUN: llvm-split -sycl-split=source -S < %s -o %t | ||
| ; RUN: FileCheck %s -input-file=%t_0.ll --check-prefixes CHECK-TU0,CHECK | ||
| ; RUN: FileCheck %s -input-file=%t_1.ll --check-prefixes CHECK-TU1,CHECK | ||
| ; RUN: FileCheck %s -input-file=%t_0.sym --check-prefixes CHECK-TU0-TXT | ||
| ; RUN: FileCheck %s -input-file=%t_1.sym --check-prefixes CHECK-TU1-TXT | ||
|
|
||
| target datalayout = "e-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024" | ||
| target triple = "spir64-unknown-linux" | ||
|
|
||
| ; CHECK-TU1-NOT: @GV | ||
| ; CHECK-TU0: @GV = internal addrspace(1) constant [1 x i32] [i32 42], align 4 | ||
| @GV = internal addrspace(1) constant [1 x i32] [i32 42], align 4 | ||
|
|
||
| ; CHECK-TU1: define dso_local spir_kernel void @TU1_kernel0 | ||
| ; CHECK-TU1-TXT: TU1_kernel0 | ||
| ; CHECK-TU0-NOT: define dso_local spir_kernel void @TU1_kernel0 | ||
| ; CHECK-TU0-TXT-NOT: TU1_kernel0 | ||
|
|
||
| ; CHECK-TU1: call spir_func void @func1_TU1() | ||
|
|
||
| define dso_local spir_kernel void @TU1_kernel0() #0 { | ||
| entry: | ||
| call spir_func void @func1_TU1() | ||
| ret void | ||
| } | ||
|
|
||
| ; CHECK-TU1: define {{.*}} spir_func void @func1_TU1() | ||
| ; CHECK-TU0-NOT: define {{.*}} spir_func void @func1_TU1() | ||
|
|
||
| ; CHECK-TU1: call spir_func void @func2_TU1() | ||
|
|
||
| define dso_local spir_func void @func1_TU1() { | ||
| entry: | ||
| call spir_func void @func2_TU1() | ||
| ret void | ||
| } | ||
|
|
||
| ; CHECK-TU1: define {{.*}} spir_func void @func2_TU1() | ||
| ; CHECK-TU0-NOT: define {{.*}} spir_func void @func2_TU1() | ||
|
|
||
| define linkonce_odr dso_local spir_func void @func2_TU1() { | ||
| entry: | ||
| ret void | ||
| } | ||
|
|
||
| ; CHECK-TU1: define dso_local spir_kernel void @TU1_kernel1() | ||
| ; CHECK-TU1-TXT: TU1_kernel1 | ||
| ; CHECK-TU0-NOT: define dso_local spir_kernel void @TU1_kernel1() | ||
| ; CHECK-TU0-TXT-NOT: TU1_kernel1 | ||
|
|
||
| ; CHECK-TU1: call spir_func void @func3_TU1() | ||
|
|
||
| define dso_local spir_kernel void @TU1_kernel1() #0 { | ||
| entry: | ||
| call spir_func void @func3_TU1() | ||
| ret void | ||
| } | ||
|
|
||
| ; CHECK-TU1: define {{.*}} spir_func void @func3_TU1() | ||
| ; CHECK-TU0-NOT: define {{.*}} spir_func void @func3_TU1() | ||
|
|
||
| define dso_local spir_func void @func3_TU1() { | ||
| entry: | ||
| ret void | ||
| } | ||
|
|
||
| ; CHECK-TU1-NOT: define dso_local spir_kernel void @TU0_kernel() | ||
| ; CHECK-TU1-TXT-NOT: TU0_kernel | ||
| ; CHECK-TU0: define dso_local spir_kernel void @TU0_kernel() | ||
| ; CHECK-TU0-TXT: TU0_kernel | ||
|
|
||
| ; CHECK-TU0: call spir_func void @func_TU0() | ||
|
|
||
| define dso_local spir_kernel void @TU0_kernel() #1 { | ||
| entry: | ||
| call spir_func void @func_TU0() | ||
| ret void | ||
| } | ||
|
|
||
| ; CHECK-TU1-NOT: define {{.*}} spir_func void @func_TU0() | ||
| ; CHECK-TU0: define {{.*}} spir_func void @func_TU0() | ||
|
|
||
| define dso_local spir_func void @func_TU0() { | ||
| entry: | ||
| ; CHECK-TU0: %0 = load i32, ptr addrspace(4) addrspacecast (ptr addrspace(1) @GV to ptr addrspace(4)), align 4 | ||
| %0 = load i32, ptr addrspace(4) getelementptr inbounds ([1 x i32], ptr addrspace(4) addrspacecast (ptr addrspace(1) @GV to ptr addrspace(4)), i64 0, i64 0), align 4 | ||
| ret void | ||
| } | ||
|
|
||
| attributes #0 = { "sycl-module-id"="TU1.cpp" } | ||
| attributes #1 = { "sycl-module-id"="TU2.cpp" } | ||
|
|
||
| ; Metadata is saved in both modules. | ||
| ; CHECK: !opencl.spir.version = !{!0, !0} | ||
| ; CHECK: !spirv.Source = !{!1, !1} | ||
|
|
||
| !opencl.spir.version = !{!0, !0} | ||
| !spirv.Source = !{!1, !1} | ||
|
|
||
| ; CHECK: !0 = !{i32 1, i32 2} | ||
| ; CHECK: !1 = !{i32 4, i32 100000} | ||
|
|
||
| !0 = !{i32 1, i32 2} | ||
| !1 = !{i32 4, i32 100000} |
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.