forked from llvm/llvm-project
-
Couldn't load subscription status.
- Fork 0
[SYCL][SPIR-V Backend] Add SPIR-V backend support inside clang-sycl-linker #3
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
Open
asudarsa
wants to merge
12
commits into
master
Choose a base branch
from
add_spirv_backend_to_clang_sycl_linker
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 7 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
9f33792
Add SPIR-V backend support inside clang-sycl-linker
asudarsa e97d1d5
Minor typo
asudarsa b81a6dd
Address review comments
asudarsa f446dcf
Use TargetMachine API for SPIR-V translation
asudarsa a3eb786
Fix format
asudarsa 9e19659
Removed unneeded update from spir to spirv triple. Remove -triple and…
asudarsa be91b6b
Address review comments
asudarsa aca480f
Address review comments
asudarsa 0cc4423
Readd triple and arch options
asudarsa 72e9f95
Add -spirv-version option to clang-sycl-linker
asudarsa 1d0dfe3
Remove --spirv-version option. SPIR-V version will be part of device …
asudarsa 3e9c850
Minor modifications
asudarsa 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,38 +1,38 @@ | ||
| // Tests the clang-sycl-linker tool. | ||
| // | ||
| // Test a simple case without arguments. | ||
| // RUN: %clangxx -emit-llvm -c %s -o %t_1.bc | ||
| // RUN: %clangxx -emit-llvm -c %s -o %t_2.bc | ||
| // RUN: clang-sycl-linker --dry-run -triple spirv64 %t_1.bc %t_2.bc -o a.spv 2>&1 \ | ||
| // RUN: %clangxx -emit-llvm -c -target spirv64 %s -o %t_1.bc | ||
| // RUN: %clangxx -emit-llvm -c -target spirv64 %s -o %t_2.bc | ||
| // RUN: clang-sycl-linker --dry-run -v -triple=spirv64 %t_1.bc %t_2.bc -o a.spv 2>&1 \ | ||
| // RUN: | FileCheck %s --check-prefix=SIMPLE | ||
| // SIMPLE: "{{.*}}llvm-link{{.*}}" {{.*}}.bc {{.*}}.bc -o [[FIRSTLLVMLINKOUT:.*]].bc --suppress-warnings | ||
| // SIMPLE-NEXT: LLVM-SPIRV-Backend: input: {{.*}}.bc, output: a.spv | ||
| // SIMPLE-NEXT: SPIR-V Backend: input: {{.*}}.bc, output: a.spv | ||
| // | ||
| // Test that llvm-link is not called when only one input is present. | ||
| // RUN: clang-sycl-linker --dry-run -triple spirv64 %t_1.bc -o a.spv 2>&1 \ | ||
| // RUN: clang-sycl-linker --dry-run -v -triple=spirv64 %t_1.bc -o a.spv 2>&1 \ | ||
| // RUN: | FileCheck %s --check-prefix=SIMPLE-NO-LINK | ||
| // SIMPLE-NO-LINK: LLVM-SPIRV-Backend: input: {{.*}}.bc, output: a.spv | ||
| // SIMPLE-NO-LINK: SPIR-V Backend: input: {{.*}}.bc, output: a.spv | ||
| // | ||
| // Test a simple case with device library files specified. | ||
| // RUN: touch %T/lib1.bc | ||
| // RUN: touch %T/lib2.bc | ||
| // RUN: clang-sycl-linker --dry-run -triple spirv64 %t_1.bc %t_2.bc --library-path=%T --device-libs=lib1.bc,lib2.bc -o a.spv 2>&1 \ | ||
| // RUN: clang-sycl-linker --dry-run -v -triple=spirv64 %t_1.bc %t_2.bc --library-path=%T --device-libs=lib1.bc,lib2.bc -o a.spv 2>&1 \ | ||
| // RUN: | FileCheck %s --check-prefix=DEVLIBS | ||
| // DEVLIBS: "{{.*}}llvm-link{{.*}}" {{.*}}.bc {{.*}}.bc -o [[FIRSTLLVMLINKOUT:.*]].bc --suppress-warnings | ||
| // DEVLIBS-NEXT: "{{.*}}llvm-link{{.*}}" -only-needed [[FIRSTLLVMLINKOUT]].bc {{.*}}lib1.bc {{.*}}lib2.bc -o [[SECONDLLVMLINKOUT:.*]].bc --suppress-warnings | ||
| // DEVLIBS-NEXT: LLVM-SPIRV-Backend: input: [[SECONDLLVMLINKOUT]].bc, output: a.spv | ||
| // DEVLIBS-NEXT: SPIR-V Backend: input: [[SECONDLLVMLINKOUT]].bc, output: a.spv | ||
| // | ||
| // Test a simple case with .o (fat object) as input. | ||
| // TODO: Remove this test once fat object support is added. | ||
| // RUN: %clangxx -c %s -o %t.o | ||
| // RUN: not clang-sycl-linker --dry-run -triple spirv64 %t.o -o a.spv 2>&1 \ | ||
| // RUN: %clangxx -c -target spirv64 %s -o %t.o | ||
| // RUN: not clang-sycl-linker --dry-run -v -triple=spirv64 %t.o -o a.spv 2>&1 \ | ||
| // RUN: | FileCheck %s --check-prefix=FILETYPEERROR | ||
| // FILETYPEERROR: Unsupported file type | ||
| // | ||
| // Test to see if device library related errors are emitted. | ||
| // RUN: not clang-sycl-linker --dry-run -triple spirv64 %t_1.bc %t_2.bc --library-path=%T --device-libs= -o a.spv 2>&1 \ | ||
| // RUN: not clang-sycl-linker --dry-run -triple=spirv64 %t_1.bc %t_2.bc --library-path=%T --device-libs= -o a.spv 2>&1 \ | ||
| // RUN: | FileCheck %s --check-prefix=DEVLIBSERR1 | ||
| // DEVLIBSERR1: Number of device library files cannot be zero | ||
| // RUN: not clang-sycl-linker --dry-run -triple spirv64 %t_1.bc %t_2.bc --library-path=%T --device-libs=lib1.bc,lib2.bc,lib3.bc -o a.spv 2>&1 \ | ||
| // RUN: not clang-sycl-linker --dry-run -triple=spirv64 %t_1.bc %t_2.bc --library-path=%T --device-libs=lib1.bc,lib2.bc,lib3.bc -o a.spv 2>&1 \ | ||
| // RUN: | FileCheck %s --check-prefix=DEVLIBSERR2 | ||
| // DEVLIBSERR2: '{{.*}}lib3.bc' SYCL device library file is not found |
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
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.