-
Notifications
You must be signed in to change notification settings - Fork 845
[SYCL] Forward AOT backend/linker options as individual tokens #22645
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 all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
f301dc6
[SYCL] Forward AOT backend/linker options as individual tokens
bader 131a671
clang-format
bader f2b5c59
[SYCL] Fix stale AOT device-token tests in clang-linker-wrapper.cpp
bader 7f190ca
[SYCL] Add FIXME on ocloc option string parsing in clang-linker-wrapper
bader 9b434ef
[SYCL] Note driver-side counterpart to linker-wrapper -device detection
bader bd41c5b
[SYCL] Hoist per-triple AOT option computation out of postLinkProcess…
bader 6bbda3f
[SYCL] Drop dead default args on AOTDeviceArgs parameters
bader ba12722
[SYCL] Add FIXME on image-embedded compile/link option space-joining
bader e82f1ea
[SYCL] Note duplicated isSPIRAOT() branch between AOT option channels
bader 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
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -126,11 +126,14 @@ | |||||||||||||||||||||||
| // CHK-CMDS-AOT-GEN-NEXT: clang{{.*}} -c -o [[LLCOUT:.*]].o [[WRAPPEROUT]].bc | ||||||||||||||||||||||||
| // CHK-CMDS-AOT-GEN-NEXT: "{{.*}}/ld" -- HOST_LINKER_FLAGS -dynamic-linker HOST_DYN_LIB -o a.out [[LLCOUT]].o HOST_LIB_PATH HOST_STAT_LIB {{.*}}.o | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| // Check that when "--device-compiler=triple=-device pvc" is specified in clang-linker-wrapper | ||||||||||||||||||||||||
| // (happen when AOT device is specified via -Xsycl-target-backend '-device pvc' in clang), | ||||||||||||||||||||||||
| // the target is not passed to sycl-post-link for filtering. | ||||||||||||||||||||||||
| // RUN: clang-linker-wrapper -sycl-embed-ir --bitcode-library=spir64_gen-unknown-unknown=%t1.devicelib.bc -sycl-post-link-options="SYCL_POST_LINK_OPTIONS" -llvm-spirv-options="LLVM_SPIRV_OPTIONS" "--host-triple=x86_64-unknown-linux-gnu" "--device-compiler=spir64_gen-unknown-unknown=-device pvc" "--linker-path=/usr/bin/ld" "--" HOST_LINKER_FLAGS "-dynamic-linker" HOST_DYN_LIB "-o" "a.out" HOST_LIB_PATH HOST_STAT_LIB %t1.o --dry-run 2>&1 | FileCheck -check-prefix=CHK-NO-CMDS-AOT-GEN %s | ||||||||||||||||||||||||
| // CHK-NO-CMDS-AOT-GEN: sycl-post-link{{.*}} SYCL_POST_LINK_OPTIONS -o {{[^,]*}}.table {{.*}}.bc | ||||||||||||||||||||||||
| // Check that when "-device pvc" specification, split across two separate | ||||||||||||||||||||||||
| // --device-linker= arguments (each --device-compiler=/--device-linker= CLI | ||||||||||||||||||||||||
| // occurrence becomes exactly one ocloc argv entry, so a multi-token value | ||||||||||||||||||||||||
| // like "-device pvc" must be supplied as separate occurrences, not as one | ||||||||||||||||||||||||
| // value containing an embedded space), is reconstructed correctly in the | ||||||||||||||||||||||||
| // ocloc invocation. | ||||||||||||||||||||||||
|
Comment on lines
+129
to
+134
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit
Suggested change
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||||||||||||||||||||||||
| // RUN: clang-linker-wrapper --device-linker=spir64_gen-unknown-unknown=-device --device-linker=spir64_gen-unknown-unknown=pvc --linker-path=/usr/bin/ld -o /dev/null %t1.o --dry-run 2>&1 | FileCheck -check-prefix=CHK-NO-CMDS-AOT-GEN-LINKERARG %s | ||||||||||||||||||||||||
| // CHK-NO-CMDS-AOT-GEN-LINKERARG: ocloc{{.*}} -device pvc -output | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| /// Check for list of commands for standalone clang-linker-wrapper run for sycl (AOT for Intel CPU) | ||||||||||||||||||||||||
| // ------- | ||||||||||||||||||||||||
|
|
@@ -329,9 +332,10 @@ | |||||||||||||||||||||||
| // RUN: --bitcode-library=spir64_gen-unknown-unknown=%t1.devicelib.bc \ | ||||||||||||||||||||||||
| // RUN: %t.aot.o -o %t.out 2>&1 --linker-path="/usr/bin/ld" | FileCheck %s --check-prefix=CHECK-COMPILE-LINK-OPTS-AOT | ||||||||||||||||||||||||
| // | ||||||||||||||||||||||||
| // Check that in AOT case backend options are passed to ocloc and are not passed to offload wrapper | ||||||||||||||||||||||||
| // because SYCL Runtime can't make any use of it in AOT case. | ||||||||||||||||||||||||
| // CHECK-COMPILE-LINK-OPTS-AOT: ocloc{{.*}} -device pvc ccc ccc -output | ||||||||||||||||||||||||
| // Check that in AOT case backend and linker options are passed to ocloc and | ||||||||||||||||||||||||
|
bader marked this conversation as resolved.
|
||||||||||||||||||||||||
| // are not passed to offload wrapper because SYCL runtime can't make any use of | ||||||||||||||||||||||||
| // it in AOT case. | ||||||||||||||||||||||||
| // CHECK-COMPILE-LINK-OPTS-AOT: ocloc{{.*}} -device pvc ccc ccc ddd ddd -output | ||||||||||||||||||||||||
| // CHECK-COMPILE-LINK-OPTS-AOT: offload-wrapper: {{.*}} compile-opts: , link-opts: | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| // TODO: The following check is turned off because clang-linker-wrapper doesn't support | ||||||||||||||||||||||||
|
|
@@ -343,7 +347,7 @@ | |||||||||||||||||||||||
| // rUN: %t.jit_and_aot.o -o %t.out 2>&1 --linker-path="/usr/bin/ld" | FileCheck %s --check-prefix=CHECK-COMPILE-LINK-OPTS-JIT-AND-AOT | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| // cHECK-COMPILE-LINK-OPTS-JIT-AND-AOT: offload-wrapper: {{.*}} compile-opts: aaa aaa, link-opts: bbb bbb | ||||||||||||||||||||||||
| // cHECK-COMPILE-LINK-OPTS-JIT-AND-AOT: ocloc{{.*}} -device pvc ccc ccc | ||||||||||||||||||||||||
| // cHECK-COMPILE-LINK-OPTS-JIT-AND-AOT: ocloc{{.*}} -device pvc ccc ccc ddd ddd | ||||||||||||||||||||||||
| // cHECK-COMPILE-LINK-OPTS-JIT-AND-AOT: offload-wrapper: {{.*}} compile-opts: , link-opts: | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| // Check that missed triple in image causes an error. | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
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
Oops, something went wrong.
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.
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.
The removed
CHK-NO-CMDS-AOT-GENcheck verified that-devicesuppresses theintel_gpu_...prefix passed to sycl-post-link. TheIsDevicePassedWithSyclTargetBackendpath is now untested.Please add a
sycl-post-link{{.*}} -o {{[^,]*}}.tablecheck to the new RUN line.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.
Can you elaborate on what exactly this RUN line is supposed to check?
When I read original comment, I assumed that the goal of this test case is to verify that
clang-linker-wrapperdoes not set somesycl-post-linkargument. If so, I don't think this line does that.sycl-post-link{{.*}}matches any arguments.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.
I see that the test is against
-ooption and line 122 checks "intel_gpu_pvc," prefix.So, the RUN line checks that
-ovalue doesn't have comas to exclude this pattern. Did I get it right?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.
#22694