-
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
Changes from all commits
f301dc6
131a671
f2b5c59
7f190ca
9b434ef
bd41c5b
6bbda3f
ba12722
e82f1ea
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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
|
||||||||||||||||||||||||
| // 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 | ||||||||||||||||||||||||
|
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. This PR also changes AOT behavior: image-embedded link-opts are now forwarded to ocloc, whereas before only compile-opts reached the AOT backend. This is reasonable, but it's a behavior change independent of the token-splitting fix — please call it out in the PR description. |
||||||||||||||||||||||||
| // 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. | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
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.