-
Notifications
You must be signed in to change notification settings - Fork 798
[sycl-post-link] Adds property listing exported functions #4626
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 5 commits into
intel:sycl
from
steffenlarsen:steffen/sycl-post-link-exported-symbols
Sep 29, 2021
Merged
Changes from 3 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
9626740
[sycl-post-link] Adds property listing exported functions
steffenlarsen 3cb7fd2
Fix formatting
steffenlarsen 368a5bc
Add new option to driver test
steffenlarsen 545d22f
Remove table file checks
steffenlarsen 79da471
Add implicit-check-not for NotExported
steffenlarsen 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
129 changes: 129 additions & 0 deletions
129
llvm/test/tools/sycl-post-link/emit_exported_symbols.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,129 @@ | ||
| ; This test checks that the post-link tool generates list of exported symbols. | ||
| ; | ||
| ; Global scope | ||
| ; RUN: sycl-post-link -symbols -emit-exported-symbols -S %s -o %t.global.files.table | ||
| ; RUN: FileCheck %s -input-file=%t.global.files.table --check-prefixes CHECK-GLOBAL-TABLE | ||
| ; RUN: FileCheck %s -input-file=%t.global.files_0.prop --check-prefixes CHECK-GLOBAL-PROP | ||
| ; | ||
| ; Per-module split | ||
| ; RUN: sycl-post-link -symbols -split=source -emit-exported-symbols -S %s -o %t.per_module.files.table | ||
| ; RUN: FileCheck %s -input-file=%t.per_module.files.table --check-prefixes CHECK-PERMODULE-TABLE | ||
| ; RUN: FileCheck %s -input-file=%t.per_module.files_0.prop --check-prefixes CHECK-PERMODULE-0-PROP | ||
| ; RUN: FileCheck %s -input-file=%t.per_module.files_1.prop --check-prefixes CHECK-PERMODULE-1-PROP | ||
| ; RUN: FileCheck %s -input-file=%t.per_module.files_2.prop --check-prefixes CHECK-KERNELONLY-PROP | ||
| ; | ||
| ; Per-kernel split | ||
| ; RUN: sycl-post-link -symbols -split=kernel -emit-exported-symbols -S %s -o %t.per_kernel.files.table | ||
| ; RUN: FileCheck %s -input-file=%t.per_kernel.files.table --check-prefixes CHECK-PERKERNEL-TABLE | ||
| ; RUN: FileCheck %s -input-file=%t.per_kernel.files_0.prop --check-prefixes CHECK-PERKERNEL-0-PROP | ||
| ; RUN: FileCheck %s -input-file=%t.per_kernel.files_1.prop --check-prefixes CHECK-PERKERNEL-1-PROP | ||
| ; RUN: FileCheck %s -input-file=%t.per_kernel.files_2.prop --check-prefixes CHECK-PERKERNEL-2-PROP | ||
| ; RUN: FileCheck %s -input-file=%t.per_kernel.files_3.prop --check-prefixes CHECK-KERNELONLY-PROP | ||
| ; RUN: FileCheck %s -input-file=%t.per_kernel.files_4.prop --check-prefixes CHECK-KERNELONLY-PROP | ||
|
|
||
| target triple = "spir64-unknown-unknown" | ||
|
|
||
| define dso_local spir_kernel void @SpirKernel1(float %arg1) #0 { | ||
| entry: | ||
| ret void | ||
| } | ||
|
|
||
| define dso_local spir_kernel void @SpirKernel2(float %arg1) #2 { | ||
| entry: | ||
| ret void | ||
| } | ||
|
|
||
| define dso_local spir_func void @ExportedSpirFunc1(float %arg1) #0 { | ||
| entry: | ||
| ret void | ||
| } | ||
|
|
||
| define dso_local spir_func void @ExportedSpirFunc2(i32 %arg1, i32 %arg2) #1 { | ||
| entry: | ||
| ret void | ||
| } | ||
|
|
||
| define dso_local spir_func void @ExportedSpirFunc3(float %arg1) #0 { | ||
| entry: | ||
| ret void | ||
| } | ||
|
|
||
| define dso_local spir_func void @NotExportedSpirFunc1(float %arg1) { | ||
| entry: | ||
| ret void | ||
| } | ||
|
|
||
| attributes #0 = { "sycl-module-id"="a.cpp" } | ||
| attributes #1 = { "sycl-module-id"="b.cpp" } | ||
| attributes #2 = { "sycl-module-id"="c.cpp" } | ||
|
|
||
| ; Global scope | ||
| ; CHECK-GLOBAL-PROP: [SYCL/exported symbols] | ||
| ; CHECK-GLOBAL-PROP-NEXT: ExportedSpirFunc1 | ||
| ; CHECK-GLOBAL-PROP-NEXT: ExportedSpirFunc2 | ||
| ; CHECK-GLOBAL-PROP-NEXT: ExportedSpirFunc3 | ||
| ; CHECK-GLOBAL-PROP-NOT: SpirKernel1 | ||
| ; CHECK-GLOBAL-PROP-NOT: NotExportedSpirFunc1 | ||
|
|
||
| ; CHECK-GLOBAL-TABLE: [Code|Properties|Symbols] | ||
| ; CHECK-GLOBAL-TABLE-NEXT: {{.*}}global.files_0.prop | ||
| ; CHECK-GLOBAL-TABLE-EMPTY: | ||
|
|
||
| ; Per-module split | ||
| ; CHECK-PERMODULE-0-PROP: [SYCL/exported symbols] | ||
| ; CHECK-PERMODULE-0-PROP-NEXT: ExportedSpirFunc1 | ||
| ; CHECK-PERMODULE-0-PROP-NEXT: ExportedSpirFunc3 | ||
| ; CHECK-PERMODULE-0-PROP-NOT: ExportedSpirFunc2 | ||
| ; CHECK-PERMODULE-0-PROP-NOT: SpirKernel1 | ||
| ; CHECK-PERMODULE-0-PROP-NOT: NotExportedSpirFunc1 | ||
|
|
||
| ; CHECK-PERMODULE-1-PROP: [SYCL/exported symbols] | ||
| ; CHECK-PERMODULE-1-PROP-NEXT: ExportedSpirFunc2 | ||
| ; CHECK-PERMODULE-1-PROP-NOT: ExportedSpirFunc1 | ||
| ; CHECK-PERMODULE-1-PROP-NOT: ExportedSpirFunc3 | ||
| ; CHECK-PERMODULE-1-PROP-NOT: SpirKernel1 | ||
| ; CHECK-PERMODULE-1-PROP-NOT: NotExportedSpirFunc1 | ||
|
|
||
| ; CHECK-PERMODULE-TABLE: [Code|Properties|Symbols] | ||
| ; CHECK-PERMODULE-TABLE-NEXT: {{.*}}per_module.files_0.prop | ||
| ; CHECK-PERMODULE-TABLE-NEXT: {{.*}}per_module.files_1.prop | ||
| ; CHECK-PERMODULE-TABLE-NEXT: {{.*}}per_module.files_2.prop | ||
| ; CHECK-PERMODULE-TABLE-EMPTY: | ||
|
|
||
steffenlarsen marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| ; Per-kernel split | ||
| ; CHECK-PERKERNEL-0-PROP: [SYCL/exported symbols] | ||
| ; CHECK-PERKERNEL-0-PROP-NEXT: ExportedSpirFunc1 | ||
| ; CHECK-PERKERNEL-0-PROP-NOT: ExportedSpirFunc2 | ||
| ; CHECK-PERKERNEL-0-PROP-NOT: ExportedSpirFunc3 | ||
| ; CHECK-PERKERNEL-0-PROP-NOT: SpirKernel1 | ||
| ; CHECK-PERKERNEL-0-PROP-NOT: NotExportedSpirFunc1 | ||
|
|
||
| ; CHECK-PERKERNEL-1-PROP: [SYCL/exported symbols] | ||
| ; CHECK-PERKERNEL-1-PROP-NEXT: ExportedSpirFunc2 | ||
| ; CHECK-PERKERNEL-1-PROP-NOT: ExportedSpirFunc1 | ||
| ; CHECK-PERKERNEL-1-PROP-NOT: ExportedSpirFunc3 | ||
| ; CHECK-PERKERNEL-1-PROP-NOT: SpirKernel1 | ||
| ; CHECK-PERKERNEL-1-PROP-NOT: NotExportedSpirFunc1 | ||
|
|
||
| ; CHECK-PERKERNEL-2-PROP: [SYCL/exported symbols] | ||
| ; CHECK-PERKERNEL-2-PROP-NEXT: ExportedSpirFunc3 | ||
| ; CHECK-PERKERNEL-2-PROP-NOT: ExportedSpirFunc1 | ||
| ; CHECK-PERKERNEL-2-PROP-NOT: ExportedSpirFunc2 | ||
| ; CHECK-PERKERNEL-2-PROP-NOT: SpirKernel1 | ||
| ; CHECK-PERKERNEL-2-PROP-NOT: NotExportedSpirFunc1 | ||
|
|
||
| ; CHECK-PERKERNEL-TABLE: [Code|Properties|Symbols] | ||
| ; CHECK-PERKERNEL-TABLE-NEXT: {{.*}}per_kernel.files_0.prop | ||
| ; CHECK-PERKERNEL-TABLE-NEXT: {{.*}}per_kernel.files_1.prop | ||
| ; CHECK-PERKERNEL-TABLE-NEXT: {{.*}}per_kernel.files_2.prop | ||
| ; CHECK-PERKERNEL-TABLE-NEXT: {{.*}}per_kernel.files_3.prop | ||
| ; CHECK-PERKERNEL-TABLE-NEXT: {{.*}}per_kernel.files_4.prop | ||
| ; CHECK-PERKERNEL-TABLE-EMPTY: | ||
|
|
||
| ; Kernel-only generated modules should have no exported Symbols | ||
| ; CHECK-KERNELONLY-PROP-NOT: [SYCL/exported symbols] | ||
| ; CHECK-KERNELONLY-PROP-NOT: ExportedSpirFunc3 | ||
| ; CHECK-KERNELONLY-PROP-NOT: ExportedSpirFunc1 | ||
| ; CHECK-KERNELONLY-PROP-NOT: ExportedSpirFunc2 | ||
| ; CHECK-KERNELONLY-PROP-NOT: SpirKernel1 | ||
| ; CHECK-KERNELONLY-PROP-NOT: NotExportedSpirFunc1 | ||
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.
Uh oh!
There was an error while loading. Please reload this page.