Skip to content

Commit 8237b4b

Browse files
author
iclsrc
committed
Merge from 'sycl' to 'sycl-web' (17 commits)
2 parents 51f0e21 + efed3bb commit 8237b4b

File tree

63 files changed

+1217
-218
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+1217
-218
lines changed

.github/ISSUE_TEMPLATE/1-bug-report.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ body:
1414
attributes:
1515
label: To reproduce
1616
description: Please describe the steps to reproduce the behavior
17-
placeholder: |
17+
value: |
1818
1. Include a code snippet that is as short as possible
1919
2. Specify the command which should be used to compile the program
2020
3. Specify the command which should be used to launch the program
@@ -26,7 +26,7 @@ body:
2626
attributes:
2727
label: Environment
2828
description: Please complete the following information
29-
placeholder: |
29+
value: |
3030
- OS: [e.g Windows/Linux]
3131
- Target device and vendor: [e.g. Intel GPU]
3232
- DPC++ version: [e.g. commit hash or output of `clang++ --version`]

.github/ISSUE_TEMPLATE/2-bug-report-cuda.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ body:
1717
attributes:
1818
label: To reproduce
1919
description: Please describe the steps to reproduce the behavior
20-
placeholder: |
20+
value: |
2121
1. Include code snippet as short as possible
2222
2. Specify the command which should be used to compile the program
2323
3. Specify the command which should be used to launch the program
@@ -29,7 +29,7 @@ body:
2929
attributes:
3030
label: Environment
3131
description: Please complete the following information
32-
placeholder: |
32+
value: |
3333
- OS: [e.g Windows/Linux]
3434
- Target device and vendor: [e.g. Nvidia GPU]
3535
- DPC++ version: [e.g. commit hash or output of `clang++ --version`]

.github/ISSUE_TEMPLATE/3-bug-report-hip.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ body:
1717
attributes:
1818
label: To reproduce
1919
description: Please describe the steps to reproduce the behavior
20-
placeholder: |
20+
value: |
2121
1. Include code snippet as short as possible
2222
2. Specify the command which should be used to compile the program
2323
3. Specify the command which should be used to launch the program
@@ -29,7 +29,7 @@ body:
2929
attributes:
3030
label: Environment
3131
description: Please complete the following information
32-
placeholder: |
32+
value: |
3333
- OS: [e.g Windows/Linux]
3434
- Target device and vendor: [e.g. AMD GPU]
3535
- DPC++ version: [e.g. commit hash or output of `clang++ --version`]

clang/lib/Driver/Driver.cpp

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8186,6 +8186,37 @@ Action *Driver::ConstructPhaseAction(
81868186
TargetDeviceOffloadKind != Action::OFK_None) {
81878187
types::ID Output =
81888188
Args.hasArg(options::OPT_S) ? types::TY_LTO_IR : types::TY_LTO_BC;
8189+
if (getUseNewOffloadingDriver() &&
8190+
getLTOMode(/*IsDeviceOffloadAction=*/true) == LTOK_Thin &&
8191+
TargetDeviceOffloadKind == Action::OFK_SYCL) {
8192+
// For SYCL with thinLTO, run sycl-post-link, extract the BC files from
8193+
// the output table, run the backend on each output table.
8194+
llvm::Triple OffloadTriple =
8195+
Input->getOffloadingToolChain()->getTriple();
8196+
SYCLPostLinkJobAction *TypedPostLinkAction =
8197+
C.MakeAction<SYCLPostLinkJobAction>(Input, types::TY_Tempfiletable,
8198+
types::TY_Tempfiletable);
8199+
TypedPostLinkAction->setRTSetsSpecConstants(
8200+
OffloadTriple.isSPIROrSPIRV() && !OffloadTriple.isSPIRAOT());
8201+
auto *TypedExtractIRFilesAction = C.MakeAction<FileTableTformJobAction>(
8202+
TypedPostLinkAction, types::TY_Tempfilelist,
8203+
types::TY_Tempfilelist);
8204+
8205+
TypedExtractIRFilesAction->addExtractColumnTform(
8206+
FileTableTformJobAction::COL_CODE, false /*drop titles*/);
8207+
auto *OutputAction =
8208+
C.MakeAction<BackendJobAction>(TypedExtractIRFilesAction, Output);
8209+
8210+
auto *ForEach = C.MakeAction<ForEachWrappingAction>(
8211+
TypedExtractIRFilesAction, OutputAction);
8212+
// This final job is mostly a no-op, but we need it to set the Action
8213+
// type to Tempfilelist which is expected by clang-offload-packager.
8214+
auto *ExtractBCFiles = C.MakeAction<FileTableTformJobAction>(
8215+
ForEach, types::TY_Tempfilelist, types::TY_Tempfilelist);
8216+
ExtractBCFiles->addExtractColumnTform(FileTableTformJobAction::COL_ZERO,
8217+
false /*drop titles*/);
8218+
return ExtractBCFiles;
8219+
}
81898220
return C.MakeAction<BackendJobAction>(Input, Output);
81908221
}
81918222
if (Args.hasArg(options::OPT_emit_llvm) ||

clang/lib/Driver/ToolChains/Clang.cpp

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -594,6 +594,11 @@ static void addDashXForInput(const ArgList &Args, const InputInfo &Input,
594594
if (Args.hasArg(options::OPT_verify_pch) && Input.getType() == types::TY_PCH)
595595
return;
596596

597+
// If the input is a Tempfilelist, this call is part for a
598+
// llvm-foreach call and we should infer the type from the file extension.
599+
if (Input.getType() == types::TY_Tempfilelist)
600+
return;
601+
597602
CmdArgs.push_back("-x");
598603
if (Args.hasArg(options::OPT_rewrite_objc))
599604
CmdArgs.push_back(types::getTypeName(types::TY_PP_ObjCXX));
@@ -10272,6 +10277,13 @@ void OffloadPackager::ConstructJob(Compilation &C, const JobAction &JA,
1027210277
C.getArgsForToolChain(TC, OffloadAction->getOffloadingArch(),
1027310278
OffloadAction->getOffloadingDeviceKind());
1027410279
StringRef File = C.getArgs().MakeArgString(TC->getInputFilename(Input));
10280+
10281+
// If the input is a Tempfilelist, it is a response file
10282+
// which internally contains a list of files to be processed.
10283+
// Add an '@' so the tool knows to expand the response file.
10284+
if (Input.getType() == types::TY_Tempfilelist)
10285+
File = C.getArgs().MakeArgString("@" + File);
10286+
1027510287
StringRef Arch = OffloadAction->getOffloadingArch()
1027610288
? OffloadAction->getOffloadingArch()
1027710289
: TCArgs.getLastArgValue(options::OPT_march_EQ);
@@ -11096,8 +11108,9 @@ void LinkerWrapper::ConstructJob(Compilation &C, const JobAction &JA,
1109611108
for (auto &I :
1109711109
llvm::make_range(ToolChainRange.first, ToolChainRange.second)) {
1109811110
const ToolChain *TC = I.second;
11099-
if (TC->getTriple().isSPIROrSPIRV() &&
11100-
TC->getTriple().getSubArch() == llvm::Triple::NoSubArch) {
11111+
// TODO: Third party AOT support needs to be added in new offloading
11112+
// model.
11113+
if (TC->getTriple().isSPIROrSPIRV()) {
1110111114
TargetTriple = TC->getTriple();
1110211115
SmallVector<std::string, 8> SYCLDeviceLibs;
1110311116
bool IsSPIR = TargetTriple.isSPIROrSPIRV();
@@ -11211,7 +11224,7 @@ void LinkerWrapper::ConstructJob(Compilation &C, const JobAction &JA,
1121111224
WrapperOption = "--sycl-backend-compile-options=";
1121211225
}
1121311226
if (TC->getTriple().getSubArch() == llvm::Triple::SPIRSubArch_gen)
11214-
WrapperOption = "--gen-tool-arg=";
11227+
WrapperOption = "--gpu-tool-arg=";
1121511228
if (TC->getTriple().getSubArch() == llvm::Triple::SPIRSubArch_x86_64)
1121611229
WrapperOption = "--cpu-tool-arg=";
1121711230
} else
242 KB
Binary file not shown.
242 KB
Binary file not shown.

clang/test/Driver/linker-wrapper-sycl-win.cpp

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,35 @@
66
// CHK-CMDS-NEXT: "{{.*}}llvm-link.exe" [[FIRSTLLVMLINKIN:.*]].bc -o [[FIRSTLLVMLINKOUT:.*]].bc --suppress-warnings
77
// CHK-CMDS-NEXT: "{{.*}}llvm-link.exe" -only-needed [[FIRSTLLVMLINKOUT]].bc {{.*}}.bc {{.*}}.bc -o [[SECONDLLVMLINKOUT:.*]].bc --suppress-warnings
88
// CHK-CMDS-NEXT: "{{.*}}sycl-post-link.exe"{{.*}} SYCL_POST_LINK_OPTIONS -o [[SYCLPOSTLINKOUT:.*]].table [[SECONDLLVMLINKOUT]].bc
9-
// LLVM-SPIRV is not called in dry-run
10-
// CHK-CMDS-NEXT: offload-wrapper: input: [[LLVMSPIRVOUT:.*]].table, output: [[WRAPPEROUT:.*]].bc
9+
// CHK-CMDS-NEXT: "{{.*}}llvm-spirv.exe"{{.*}} LLVM_SPIRV_OPTIONS -o {{.*}}
10+
// CHK-CMDS-NEXT: offload-wrapper: input: {{.*}}, output: [[WRAPPEROUT:.*]].bc
1111
// CHK-CMDS-NEXT: "{{.*}}llc.exe" -filetype=obj -o [[LLCOUT:.*]].o [[WRAPPEROUT]].bc
1212
// CHK-CMDS-NEXT: "{{.*}}/ld" -- HOST_LINKER_FLAGS -dynamic-linker HOST_DYN_LIB -o a.out [[LLCOUT]].o HOST_LIB_PATH HOST_STAT_LIB {{.*}}test-sycl.o
13+
14+
/// Check for list of commands for standalone clang-linker-wrapper run for sycl (AOT for Intel GPU)
15+
// RUN: clang-linker-wrapper -sycl-device-library-location=%S/Inputs -sycl-device-libraries=libsycl-crt.new.obj,libsycl-complex.new.obj -sycl-post-link-options="SYCL_POST_LINK_OPTIONS" -llvm-spirv-options="LLVM_SPIRV_OPTIONS" "--host-triple=x86_64-pc-windows-msvc" "--linker-path=/usr/bin/ld" "--" HOST_LINKER_FLAGS "-dynamic-linker" HOST_DYN_LIB "-o" "a.out" HOST_LIB_PATH HOST_STAT_LIB %S/Inputs/test-sycl-aot-gen.o --dry-run 2>&1 | FileCheck -check-prefix=CHK-CMDS-AOT-GEN %s
16+
// CHK-CMDS-AOT-GEN: "{{.*}}spirv-to-ir-wrapper.exe" {{.*}} -o [[FIRSTLLVMLINKIN:.*]].bc --llvm-spirv-opts=--spirv-preserve-auxdata --llvm-spirv-opts=--spirv-target-env=SPV-IR --llvm-spirv-opts=--spirv-builtin-format=global
17+
// CHK-CMDS-AOT-GEN-NEXT: "{{.*}}llvm-link.exe" [[FIRSTLLVMLINKIN:.*]].bc -o [[FIRSTLLVMLINKOUT:.*]].bc --suppress-warnings
18+
// CHK-CMDS-AOT-GEN-NEXT: "{{.*}}llvm-link.exe" -only-needed [[FIRSTLLVMLINKOUT]].bc {{.*}}.bc {{.*}}.bc -o [[SECONDLLVMLINKOUT:.*]].bc --suppress-warnings
19+
// CHK-CMDS-AOT-GEN-NEXT: "{{.*}}sycl-post-link.exe"{{.*}} SYCL_POST_LINK_OPTIONS -o [[SYCLPOSTLINKOUT:.*]].table [[SECONDLLVMLINKOUT]].bc
20+
// CHK-CMDS-AOT-GEN-NEXT: "{{.*}}llvm-spirv.exe"{{.*}} LLVM_SPIRV_OPTIONS -o {{.*}}
21+
/// -DFOO1 and -DFOO2 are backend options parsed from device image.
22+
/// These options were specified when the input fat binary (test-sycl-aot-gen.o) was compiled.
23+
// CHK-CMDS-AOT-GEN-NEXT: "{{.*}}ocloc{{.*}} -output_no_suffix -spirv_input -device pvc -device_options pvc -ze-intel-enable-auto-large-GRF-mode -DFOO1 -DFOO2 -output {{.*}} -file {{.*}}
24+
// CHK-CMDS-AOT-GEN-NEXT: offload-wrapper: input: {{.*}}, output: [[WRAPPEROUT:.*]].bc
25+
// CHK-CMDS-AOT-GEN-NEXT: "{{.*}}llc.exe" -filetype=obj -o [[LLCOUT:.*]].o [[WRAPPEROUT]].bc
26+
// 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 {{.*}}test-sycl-aot-gen.o
27+
28+
/// Check for list of commands for standalone clang-linker-wrapper run for sycl (AOT for Intel CPU)
29+
// RUN: clang-linker-wrapper -sycl-device-library-location=%S/Inputs -sycl-device-libraries=libsycl-crt.new.obj,libsycl-complex.new.obj -sycl-post-link-options="SYCL_POST_LINK_OPTIONS" -llvm-spirv-options="LLVM_SPIRV_OPTIONS" "--host-triple=x86_64-pc-windows-msvc" "--linker-path=/usr/bin/ld" "--" HOST_LINKER_FLAGS "-dynamic-linker" HOST_DYN_LIB "-o" "a.out" HOST_LIB_PATH HOST_STAT_LIB %S/Inputs/test-sycl-aot-cpu.o --dry-run 2>&1 | FileCheck -check-prefix=CHK-CMDS-AOT-CPU %s
30+
// CHK-CMDS-AOT-CPU: "{{.*}}spirv-to-ir-wrapper.exe" {{.*}} -o [[FIRSTLLVMLINKIN:.*]].bc --llvm-spirv-opts=--spirv-preserve-auxdata --llvm-spirv-opts=--spirv-target-env=SPV-IR --llvm-spirv-opts=--spirv-builtin-format=global
31+
// CHK-CMDS-AOT-CPU-NEXT: "{{.*}}llvm-link.exe" [[FIRSTLLVMLINKIN:.*]].bc -o [[FIRSTLLVMLINKOUT:.*]].bc --suppress-warnings
32+
// CHK-CMDS-AOT-CPU-NEXT: "{{.*}}llvm-link.exe" -only-needed [[FIRSTLLVMLINKOUT]].bc {{.*}}.bc {{.*}}.bc -o [[SECONDLLVMLINKOUT:.*]].bc --suppress-warnings
33+
// CHK-CMDS-AOT-CPU-NEXT: "{{.*}}sycl-post-link.exe"{{.*}} SYCL_POST_LINK_OPTIONS -o [[SYCLPOSTLINKOUT:.*]].table [[SECONDLLVMLINKOUT]].bc
34+
// CHK-CMDS-AOT-CPU-NEXT: "{{.*}}llvm-spirv.exe"{{.*}} LLVM_SPIRV_OPTIONS -o {{.*}}
35+
/// -DFOO1 and -DFOO2 are backend options parsed from device image.
36+
/// These options were specified when the input fat binary (test-sycl-aot-cpu.o) was compiled.
37+
// CHK-CMDS-AOT-CPU-NEXT: "{{.*}}opencl-aot.exe"{{.*}} --device=cpu -DFOO1 -DFOO2 -o {{.*}}
38+
// CHK-CMDS-AOT-CPU-NEXT: offload-wrapper: input: {{.*}}, output: [[WRAPPEROUT:.*]].bc
39+
// CHK-CMDS-AOT-CPU-NEXT: "{{.*}}llc.exe" -filetype=obj -o [[LLCOUT:.*]].o [[WRAPPEROUT]].bc
40+
// CHK-CMDS-AOT-CPU-NEXT: "{{.*}}/ld" -- HOST_LINKER_FLAGS -dynamic-linker HOST_DYN_LIB -o a.out [[LLCOUT]].o HOST_LIB_PATH HOST_STAT_LIB {{.*}}test-sycl-aot-cpu.o

clang/test/Driver/linker-wrapper-sycl.cpp

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,39 @@
66
// CHK-CMDS-NEXT: "{{.*}}llvm-link" [[FIRSTLLVMLINKIN:.*]].bc -o [[FIRSTLLVMLINKOUT:.*]].bc --suppress-warnings
77
// CHK-CMDS-NEXT: "{{.*}}llvm-link" -only-needed [[FIRSTLLVMLINKOUT]].bc {{.*}}.bc {{.*}}.bc -o [[SECONDLLVMLINKOUT:.*]].bc --suppress-warnings
88
// CHK-CMDS-NEXT: "{{.*}}sycl-post-link"{{.*}} SYCL_POST_LINK_OPTIONS -o [[SYCLPOSTLINKOUT:.*]].table [[SECONDLLVMLINKOUT]].bc
9-
// LLVM-SPIRV is not called in dry-run
10-
// CHK-CMDS-NEXT: offload-wrapper: input: [[LLVMSPIRVOUT:.*]].table, output: [[WRAPPEROUT:.*]].bc
9+
// CHK-CMDS-NEXT: "{{.*}}llvm-spirv"{{.*}} LLVM_SPIRV_OPTIONS -o {{.*}}
10+
// CHK-CMDS-NEXT: offload-wrapper: input: {{.*}}, output: [[WRAPPEROUT:.*]].bc
1111
// CHK-CMDS-NEXT: "{{.*}}llc" -filetype=obj -o [[LLCOUT:.*]].o [[WRAPPEROUT]].bc
1212
// CHK-CMDS-NEXT: "{{.*}}/ld" -- HOST_LINKER_FLAGS -dynamic-linker HOST_DYN_LIB -o a.out [[LLCOUT]].o HOST_LIB_PATH HOST_STAT_LIB {{.*}}test-sycl.o
1313

1414
/// check for PIC for device wrap compilation when using -shared
1515
// RUN: clang-linker-wrapper -sycl-device-library-location=%S/Inputs -sycl-device-libraries=libsycl-crt.new.o,libsycl-complex.new.o -sycl-post-link-options="SYCL_POST_LINK_OPTIONS" -llvm-spirv-options="LLVM_SPIRV_OPTIONS" "--host-triple=x86_64-unknown-linux-gnu" "--triple=spir64" "--linker-path=/usr/bin/ld" -shared "--" HOST_LINKER_FLAGS "-dynamic-linker" HOST_DYN_LIB "-o" "a.out" HOST_LIB_PATH HOST_STAT_LIB %S/Inputs/test-sycl.o --dry-run 2>&1 | FileCheck -check-prefix=CHK-SHARED %s
1616
// CHK-SHARED: "{{.*}}llc"{{.*}} -relocation-model=pic
17+
18+
/// Check for list of commands for standalone clang-linker-wrapper run for sycl (AOT for Intel GPU)
19+
// RUN: clang-linker-wrapper -sycl-device-library-location=%S/Inputs -sycl-device-libraries=libsycl-crt.new.o,libsycl-complex.new.o -sycl-post-link-options="SYCL_POST_LINK_OPTIONS" -llvm-spirv-options="LLVM_SPIRV_OPTIONS" "--host-triple=x86_64-unknown-linux-gnu" "--linker-path=/usr/bin/ld" "--" HOST_LINKER_FLAGS "-dynamic-linker" HOST_DYN_LIB "-o" "a.out" HOST_LIB_PATH HOST_STAT_LIB %S/Inputs/test-sycl-aot-gen.o --dry-run 2>&1 | FileCheck -check-prefix=CHK-CMDS-AOT-GEN %s
20+
// CHK-CMDS-AOT-GEN: "{{.*}}spirv-to-ir-wrapper" {{.*}} -o [[FIRSTLLVMLINKIN:.*]].bc --llvm-spirv-opts=--spirv-preserve-auxdata --llvm-spirv-opts=--spirv-target-env=SPV-IR --llvm-spirv-opts=--spirv-builtin-format=global
21+
// CHK-CMDS-AOT-GEN-NEXT: "{{.*}}llvm-link" [[FIRSTLLVMLINKIN:.*]].bc -o [[FIRSTLLVMLINKOUT:.*]].bc --suppress-warnings
22+
// CHK-CMDS-AOT-GEN-NEXT: "{{.*}}llvm-link" -only-needed [[FIRSTLLVMLINKOUT]].bc {{.*}}.bc {{.*}}.bc -o [[SECONDLLVMLINKOUT:.*]].bc --suppress-warnings
23+
// CHK-CMDS-AOT-GEN-NEXT: "{{.*}}sycl-post-link"{{.*}} SYCL_POST_LINK_OPTIONS -o [[SYCLPOSTLINKOUT:.*]].table [[SECONDLLVMLINKOUT]].bc
24+
// CHK-CMDS-AOT-GEN-NEXT: "{{.*}}llvm-spirv"{{.*}} LLVM_SPIRV_OPTIONS -o {{.*}}
25+
/// -DFOO1 and -DFOO2 are backend options parsed from device image.
26+
/// These options were specified when the input fat binary (test-sycl-aot-gen.o) was compiled.
27+
// CHK-CMDS-AOT-GEN-NEXT: "{{.*}}ocloc"{{.*}} -output_no_suffix -spirv_input -device pvc -device_options pvc -ze-intel-enable-auto-large-GRF-mode -DFOO1 -DFOO2 -output {{.*}} -file {{.*}}
28+
// CHK-CMDS-AOT-GEN-NEXT: offload-wrapper: input: {{.*}}, output: [[WRAPPEROUT:.*]].bc
29+
// CHK-CMDS-AOT-GEN-NEXT: "{{.*}}llc" -filetype=obj -o [[LLCOUT:.*]].o [[WRAPPEROUT]].bc
30+
// 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 {{.*}}test-sycl-aot-gen.o
31+
32+
/// Check for list of commands for standalone clang-linker-wrapper run for sycl (AOT for Intel CPU)
33+
// RUN: clang-linker-wrapper -sycl-device-library-location=%S/Inputs -sycl-device-libraries=libsycl-crt.new.o,libsycl-complex.new.o -sycl-post-link-options="SYCL_POST_LINK_OPTIONS" -llvm-spirv-options="LLVM_SPIRV_OPTIONS" "--host-triple=x86_64-unknown-linux-gnu" "--linker-path=/usr/bin/ld" "--" HOST_LINKER_FLAGS "-dynamic-linker" HOST_DYN_LIB "-o" "a.out" HOST_LIB_PATH HOST_STAT_LIB %S/Inputs/test-sycl-aot-cpu.o --dry-run 2>&1 | FileCheck -check-prefix=CHK-CMDS-AOT-CPU %s
34+
// CHK-CMDS-AOT-CPU: "{{.*}}spirv-to-ir-wrapper" {{.*}} -o [[FIRSTLLVMLINKIN:.*]].bc --llvm-spirv-opts=--spirv-preserve-auxdata --llvm-spirv-opts=--spirv-target-env=SPV-IR --llvm-spirv-opts=--spirv-builtin-format=global
35+
// CHK-CMDS-AOT-CPU-NEXT: "{{.*}}llvm-link" [[FIRSTLLVMLINKIN:.*]].bc -o [[FIRSTLLVMLINKOUT:.*]].bc --suppress-warnings
36+
// CHK-CMDS-AOT-CPU-NEXT: "{{.*}}llvm-link" -only-needed [[FIRSTLLVMLINKOUT]].bc {{.*}}.bc {{.*}}.bc -o [[SECONDLLVMLINKOUT:.*]].bc --suppress-warnings
37+
// CHK-CMDS-AOT-CPU-NEXT: "{{.*}}sycl-post-link"{{.*}} SYCL_POST_LINK_OPTIONS -o [[SYCLPOSTLINKOUT:.*]].table [[SECONDLLVMLINKOUT]].bc
38+
// CHK-CMDS-AOT-CPU-NEXT: "{{.*}}llvm-spirv"{{.*}} LLVM_SPIRV_OPTIONS -o {{.*}}
39+
/// -DFOO1 and -DFOO2 are backend options parsed from device image.
40+
/// These options were specified when the input fat binary (test-sycl-aot-cpu.o) was compiled.
41+
// CHK-CMDS-AOT-CPU-NEXT: "{{.*}}opencl-aot"{{.*}} --device=cpu -DFOO1 -DFOO2 -o {{.*}}
42+
// CHK-CMDS-AOT-CPU-NEXT: offload-wrapper: input: {{.*}}, output: [[WRAPPEROUT:.*]].bc
43+
// CHK-CMDS-AOT-CPU-NEXT: "{{.*}}llc" -filetype=obj -o [[LLCOUT:.*]].o [[WRAPPEROUT]].bc
44+
// CHK-CMDS-AOT-CPU-NEXT: "{{.*}}/ld" -- HOST_LINKER_FLAGS -dynamic-linker HOST_DYN_LIB -o a.out [[LLCOUT]].o HOST_LIB_PATH HOST_STAT_LIB {{.*}}test-sycl-aot-cpu.o

clang/test/Driver/sycl-lto.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,12 @@
88
// RUN: not %clangxx -fsycl --offload-new-driver -foffload-lto=thin -fsycl-device-code-split=off %s -### 2>&1 | FileCheck -check-prefix=CHECK_SPLIT_ERROR %s
99
// CHECK_SPLIT_ERROR: '-fsycl-device-code-split=off' is not supported when '-foffload-lto=thin' is set with '-fsycl'
1010

11-
// Verify there's no error and we see the expected cc1 flags with the new offload driver.
11+
// Verify there's no error and we see the expected cc1 flags and tool invocations with the new offload driver.
1212
// RUN: %clangxx -fsycl --offload-new-driver -foffload-lto=thin %s -### 2>&1 | FileCheck -check-prefix=CHECK_SUPPORTED %s
1313
// CHECK_SUPPORTED: clang{{.*}} "-cc1" "-triple" "spir64-unknown-unknown" {{.*}} "-flto=thin" "-flto-unit"
14+
// CHECK_SUPPORTED: sycl-post-link{{.*}}
15+
// CHECK_SUPPORTED-NEXT: file-table-tform{{.*}}
16+
// CHECK_SUPPORTED-NEXT: llvm-foreach{{.*}} "--" {{.*}}clang{{.*}} "-fsycl-is-device"{{.*}} "-flto=thin" "-flto-unit"
17+
// CHECK_SUPPORTED-NEXT: file-table-tform{{.*}}
18+
// CHECK_SUPPORTED-NEXT: clang-offload-packager{{.*}} "-o" "{{.*}}" "--image=file=@{{.*}}"
1419
// CHECK_SUPPORTED: clang-linker-wrapper{{.*}} "-sycl-thin-lto"

clang/test/Driver/sycl-offload-new-driver.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,10 +166,10 @@
166166
/// Test option passing behavior for clang-offload-wrapper options for AOT.
167167
// RUN: %clangxx --target=x86_64-unknown-linux-gnu -fsycl --offload-new-driver \
168168
// RUN: -fsycl-targets=spir64_gen,spir64_x86_64 \
169-
// RUN: -Xsycl-target-backend=spir64_gen -backend-gen-opt \
169+
// RUN: -Xsycl-target-backend=spir64_gen -backend-gpu-opt \
170170
// RUN: -Xsycl-target-backend=spir64_x86_64 -backend-cpu-opt \
171171
// RUN: -### %s 2>&1 \
172172
// RUN: | FileCheck -check-prefix WRAPPER_OPTIONS_BACKEND_AOT %s
173173
// WRAPPER_OPTIONS_BACKEND_AOT: clang-linker-wrapper{{.*}} "--host-triple=x86_64-unknown-linux-gnu"
174-
// WRAPPER_OPTIONS_BACKEND_AOT-SAME: "--gen-tool-arg={{.*}}-backend-gen-opt"
174+
// WRAPPER_OPTIONS_BACKEND_AOT-SAME: "--gpu-tool-arg={{.*}}-backend-gpu-opt"
175175
// WRAPPER_OPTIONS_BACKEND_AOT-SAME: "--cpu-tool-arg={{.*}}-backend-cpu-opt"

clang/test/SemaSYCL/lb_sm_90.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// REQUIRES: nvptx-registered-target
12
// RUN: %clang_cc1 -internal-isystem %S/Inputs %s -triple nvptx64-nvidia-cuda -target-cpu sm_90 -fsycl-is-device -Wno-c++23-extensions -verify -S -o %t
23

34
// Maximum work groups per multi-processor, mapped to maxclusterrank PTX

0 commit comments

Comments
 (0)