Skip to content

Commit ce7177d

Browse files
authored
[Driver][SYCL] Improve handling of integration footers when preprocessing (#3878)
When generating and consuming preprocessed files with the integration footer enabled, we need to properly setup the tools used during each particular step. Generation: preprocess host -> append footer -> preprocess again Use: compile preprocessed file
1 parent 24a2ad8 commit ce7177d

12 files changed

+238
-215
lines changed

clang/lib/Driver/Driver.cpp

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5537,6 +5537,25 @@ Action *Driver::ConstructPhaseAction(
55375537
assert(OutputTy != types::TY_INVALID &&
55385538
"Cannot preprocess this input type!");
55395539
}
5540+
types::ID HostPPType = types::getPreprocessedType(Input->getType());
5541+
if (Args.hasArg(options::OPT_fsycl) && HostPPType != types::TY_INVALID &&
5542+
Args.hasArg(options::OPT_fsycl_use_footer) &&
5543+
TargetDeviceOffloadKind == Action::OFK_None) {
5544+
// Performing a host compilation with -fsycl. Append the integration
5545+
// footer to the preprocessed source file. We then add another
5546+
// preprocessed step to complete the action chain.
5547+
auto *Preprocess = C.MakeAction<PreprocessJobAction>(Input, HostPPType);
5548+
auto *AppendFooter =
5549+
C.MakeAction<AppendFooterJobAction>(Preprocess, types::TY_CXX);
5550+
// FIXME: There are 2 issues with dependency generation in regards to
5551+
// the integration footer that need to be addressed.
5552+
// 1) Input file referenced on the RHS of a dependency is based on the
5553+
// input src, which is a temporary. We want this to be the true
5554+
// user input src file.
5555+
// 2) When generating dependencies against a preprocessed file, header
5556+
// file information (using -MD or-MMD) is not provided.
5557+
return C.MakeAction<PreprocessJobAction>(AppendFooter, OutputTy);
5558+
}
55405559
return C.MakeAction<PreprocessJobAction>(Input, OutputTy);
55415560
}
55425561
case phases::Precompile: {
@@ -5582,18 +5601,6 @@ Action *Driver::ConstructPhaseAction(
55825601
return C.MakeAction<CompileJobAction>(Input, types::TY_ModuleFile);
55835602
if (Args.hasArg(options::OPT_verify_pch))
55845603
return C.MakeAction<VerifyPCHJobAction>(Input, types::TY_Nothing);
5585-
if (Args.hasArg(options::OPT_fsycl) &&
5586-
Args.hasArg(options::OPT_fsycl_use_footer) &&
5587-
TargetDeviceOffloadKind == Action::OFK_None) {
5588-
// Performing a host compilation with -fsycl. Append the integrated
5589-
// footer to the preprocessed source file. We then add another
5590-
// preprocessed step so the new file is considered a full compilation.
5591-
auto *AppendFooter =
5592-
C.MakeAction<AppendFooterJobAction>(Input, types::TY_CXX);
5593-
auto *Preprocess =
5594-
C.MakeAction<PreprocessJobAction>(AppendFooter, Input->getType());
5595-
return C.MakeAction<CompileJobAction>(Preprocess, types::TY_LLVM_BC);
5596-
}
55975604
return C.MakeAction<CompileJobAction>(Input, types::TY_LLVM_BC);
55985605
}
55995606
case phases::Backend: {

clang/test/Driver/sycl-int-footer.cpp

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,26 @@
1-
/// Check compilation tool steps when using the integrated footer
1+
/// Check compilation tool steps when using the integration footer
22
// RUN: %clangxx -fsycl -fsycl-use-footer %s -### 2>&1 \
33
// RUN: | FileCheck -check-prefix FOOTER %s
44
// FOOTER: clang{{.*}} "-fsycl-is-device"{{.*}} "-fsycl-int-header=[[INTHEADER:.+\.h]]" "-fsycl-int-footer=[[INTFOOTER:.+\h]]" "-sycl-std={{.*}}"
55
// FOOTER: clang{{.*}} "-include" "[[INTHEADER]]"{{.*}} "-fsycl-is-host"{{.*}} "-E"{{.*}} "-o" "[[PREPROC:.+\.ii]]"
66
// FOOTER: append-file{{.*}} "[[PREPROC]]" "--append=[[INTFOOTER]]" "--output=[[APPENDEDSRC:.+\.cpp]]"
77
// FOOTER: clang{{.*}} "-fsycl-is-host"{{.*}} "[[APPENDEDSRC]]"
88
// FOOTER-NOT: "-include" "[[INTHEADER]]"
9+
10+
/// Preprocessed file creation with integration footer
11+
// RUN: %clangxx -fsycl -fsycl-use-footer -E %s -### 2>&1 \
12+
// RUN: | FileCheck -check-prefix FOOTER_PREPROC_GEN %s
13+
// FOOTER_PREPROC_GEN: clang{{.*}} "-fsycl-is-device"{{.*}} "-fsycl-int-header=[[INTHEADER:.+\.h]]" "-fsycl-int-footer=[[INTFOOTER:.+\h]]" "-sycl-std={{.*}}" "-o" "[[PREPROC_DEVICE:.+\.ii]]"
14+
// FOOTER_PREPROC_GEN: clang{{.*}} "-include" "[[INTHEADER]]"{{.*}} "-fsycl-is-host"{{.*}} "-E"{{.*}} "-o" "[[PREPROC1:.+\.ii]]"
15+
// FOOTER_PREPROC_GEN: append-file{{.*}} "[[PREPROC1]]" "--append=[[INTFOOTER]]" "--output=[[APPENDEDSRC:.+\.cpp]]"
16+
// FOOTER_PREPROC_GEN: clang{{.*}} "-fsycl-is-host"{{.*}} "-E"{{.*}} "-o" "[[PREPROC_HOST:.+\.ii]]"{{.*}} "[[APPENDEDSRC]]"
17+
// FOOTER_PREPROC_GEN: clang-offload-bundler{{.*}} "-inputs=[[PREPROC_DEVICE]],[[PREPROC_HOST]]"
18+
19+
/// Preprocessed file use with integration footer
20+
// RUN: touch %t.ii
21+
// RUN: %clangxx -fsycl -fsycl-use-footer %t.ii -### 2>&1 \
22+
// RUN: | FileCheck -check-prefix FOOTER_PREPROC_USE %s
23+
// FOOTER_PREPROC_USE: clang-offload-bundler{{.*}} "-outputs=[[HOST1:.+\.ii]],[[DEVICE_PP:.+\.ii]]"
24+
// FOOTER_PREPROC_USE: clang{{.*}} "-fsycl-is-device"{{.*}} "[[DEVICE_PP]]"
25+
// FOOTER_PREPROC_USE: clang-offload-bundler{{.*}} "-outputs=[[HOST_PP:.+\.ii]],[[DEVICE1:.+\.ii]]"
26+
// FOOTER_PREPROC_USE: clang{{.*}} "-fsycl-is-host"{{.*}} "[[HOST_PP]]"

clang/test/Driver/sycl-intelfpga-aoco-win.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@
1414
// CHK-FPGA-AOCO-PHASES-WIN: 0: input, "[[INPUTA:.+\.a]]", object, (host-sycl)
1515
// CHK-FPGA-AOCO-PHASES-WIN: 1: input, "[[INPUTSRC:.+\.cpp]]", c++, (host-sycl)
1616
// CHK-FPGA-AOCO-PHASES-WIN: 2: preprocessor, {1}, c++-cpp-output, (host-sycl)
17-
// CHK-FPGA-AOCO-PHASES-WIN: 3: input, "[[INPUTSRC]]", c++, (device-sycl)
18-
// CHK-FPGA-AOCO-PHASES-WIN: 4: preprocessor, {3}, c++-cpp-output, (device-sycl)
19-
// CHK-FPGA-AOCO-PHASES-WIN: 5: compiler, {4}, ir, (device-sycl)
20-
// CHK-FPGA-AOCO-PHASES-WIN: 6: offload, "host-sycl (x86_64-pc-windows-msvc)" {2}, "device-sycl (spir64_fpga-unknown-unknown-sycldevice)" {5}, c++-cpp-output
21-
// CHK-FPGA-AOCO-PHASES-WIN: 7: append-footer, {6}, c++, (host-sycl)
22-
// CHK-FPGA-AOCO-PHASES-WIN: 8: preprocessor, {7}, c++-cpp-output, (host-sycl)
17+
// CHK-FPGA-AOCO-PHASES-WIN: 3: append-footer, {2}, c++, (host-sycl)
18+
// CHK-FPGA-AOCO-PHASES-WIN: 4: preprocessor, {3}, c++-cpp-output, (host-sycl)
19+
// CHK-FPGA-AOCO-PHASES-WIN: 5: input, "[[INPUTSRC]]", c++, (device-sycl)
20+
// CHK-FPGA-AOCO-PHASES-WIN: 6: preprocessor, {5}, c++-cpp-output, (device-sycl)
21+
// CHK-FPGA-AOCO-PHASES-WIN: 7: compiler, {6}, ir, (device-sycl)
22+
// CHK-FPGA-AOCO-PHASES-WIN: 8: offload, "host-sycl (x86_64-pc-windows-msvc)" {4}, "device-sycl (spir64_fpga-unknown-unknown-sycldevice)" {7}, c++-cpp-output
2323
// CHK-FPGA-AOCO-PHASES-WIN: 9: compiler, {8}, ir, (host-sycl)
2424
// CHK-FPGA-AOCO-PHASES-WIN: 10: backend, {9}, assembler, (host-sycl)
2525
// CHK-FPGA-AOCO-PHASES-WIN: 11: assembler, {10}, object, (host-sycl)
@@ -28,7 +28,7 @@
2828
// CHK-FPGA-AOCO-PHASES-WIN: 14: clang-offload-deps, {13}, ir, (host-sycl)
2929
// CHK-FPGA-AOCO-PHASES-WIN: 15: input, "[[INPUTA]]", archive
3030
// CHK-FPGA-AOCO-PHASES-WIN: 16: clang-offload-unbundler, {15}, archive
31-
// CHK-FPGA-AOCO-PHASES-WIN: 17: linker, {5, 14, 16}, ir, (device-sycl)
31+
// CHK-FPGA-AOCO-PHASES-WIN: 17: linker, {7, 14, 16}, ir, (device-sycl)
3232
// CHK-FPGA-AOCO-PHASES-WIN: 18: sycl-post-link, {17}, tempfiletable, (device-sycl)
3333
// CHK-FPGA-AOCO-PHASES-WIN: 19: file-table-tform, {18}, tempfilelist, (device-sycl)
3434
// CHK-FPGA-AOCO-PHASES-WIN: 20: llvm-spirv, {19}, tempfilelist, (device-sycl)

clang/test/Driver/sycl-intelfpga-aoco.cpp

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@
1818
// CHK-FPGA-AOCO-PHASES: 0: input, "[[INPUTA:.+\.a]]", object, (host-sycl)
1919
// CHK-FPGA-AOCO-PHASES: 1: input, "[[INPUTCPP:.+\.cpp]]", c++, (host-sycl)
2020
// CHK-FPGA-AOCO-PHASES: 2: preprocessor, {1}, c++-cpp-output, (host-sycl)
21-
// CHK-FPGA-AOCO-PHASES: 3: input, "[[INPUTCPP]]", c++, (device-sycl)
22-
// CHK-FPGA-AOCO-PHASES: 4: preprocessor, {3}, c++-cpp-output, (device-sycl)
23-
// CHK-FPGA-AOCO-PHASES: 5: compiler, {4}, ir, (device-sycl)
24-
// CHK-FPGA-AOCO-PHASES: 6: offload, "host-sycl (x86_64-unknown-linux-gnu)" {2}, "device-sycl (spir64_fpga-unknown-unknown-sycldevice)" {5}, c++-cpp-output
25-
// CHK-FPGA-AOCO-PHASES: 7: append-footer, {6}, c++, (host-sycl)
26-
// CHK-FPGA-AOCO-PHASES: 8: preprocessor, {7}, c++-cpp-output, (host-sycl)
21+
// CHK-FPGA-AOCO-PHASES: 3: append-footer, {2}, c++, (host-sycl)
22+
// CHK-FPGA-AOCO-PHASES: 4: preprocessor, {3}, c++-cpp-output, (host-sycl)
23+
// CHK-FPGA-AOCO-PHASES: 5: input, "[[INPUTCPP]]", c++, (device-sycl)
24+
// CHK-FPGA-AOCO-PHASES: 6: preprocessor, {5}, c++-cpp-output, (device-sycl)
25+
// CHK-FPGA-AOCO-PHASES: 7: compiler, {6}, ir, (device-sycl)
26+
// CHK-FPGA-AOCO-PHASES: 8: offload, "host-sycl (x86_64-unknown-linux-gnu)" {4}, "device-sycl (spir64_fpga-unknown-unknown-sycldevice)" {7}, c++-cpp-output
2727
// CHK-FPGA-AOCO-PHASES: 9: compiler, {8}, ir, (host-sycl)
2828
// CHK-FPGA-AOCO-PHASES: 10: backend, {9}, assembler, (host-sycl)
2929
// CHK-FPGA-AOCO-PHASES: 11: assembler, {10}, object, (host-sycl)
@@ -32,7 +32,7 @@
3232
// CHK-FPGA-AOCO-PHASES: 14: clang-offload-deps, {13}, ir, (host-sycl)
3333
// CHK-FPGA-AOCO-PHASES: 15: input, "[[INPUTA]]", archive
3434
// CHK-FPGA-AOCO-PHASES: 16: clang-offload-unbundler, {15}, archive
35-
// CHK-FPGA-AOCO-PHASES: 17: linker, {5, 14, 16}, ir, (device-sycl)
35+
// CHK-FPGA-AOCO-PHASES: 17: linker, {7, 14, 16}, ir, (device-sycl)
3636
// CHK-FPGA-AOCO-PHASES: 18: sycl-post-link, {17}, tempfiletable, (device-sycl)
3737
// CHK-FPGA-AOCO-PHASES: 19: file-table-tform, {18}, tempfilelist, (device-sycl)
3838
// CHK-FPGA-AOCO-PHASES: 20: llvm-spirv, {19}, tempfilelist, (device-sycl)
@@ -51,12 +51,12 @@
5151
// CHK-FPGA-AOCO-PHASES-WIN: 0: input, "[[INPUTA:.+\.a]]", object, (host-sycl)
5252
// CHK-FPGA-AOCO-PHASES-WIN: 1: input, "[[INPUTSRC:.+\.cpp]]", c++, (host-sycl)
5353
// CHK-FPGA-AOCO-PHASES-WIN: 2: preprocessor, {1}, c++-cpp-output, (host-sycl)
54-
// CHK-FPGA-AOCO-PHASES-WIN: 3: input, "[[INPUTSRC]]", c++, (device-sycl)
55-
// CHK-FPGA-AOCO-PHASES-WIN: 4: preprocessor, {3}, c++-cpp-output, (device-sycl)
56-
// CHK-FPGA-AOCO-PHASES-WIN: 5: compiler, {4}, ir, (device-sycl)
57-
// CHK-FPGA-AOCO-PHASES-WIN: 6: offload, "host-sycl (x86_64-pc-windows-msvc)" {2}, "device-sycl (spir64_fpga-unknown-unknown-sycldevice)" {5}, c++-cpp-output
58-
// CHK-FPGA-AOCO-PHASES-WIN: 7: append-footer, {6}, c++, (host-sycl)
59-
// CHK-FPGA-AOCO-PHASES-WIN: 8: preprocessor, {7}, c++-cpp-output, (host-sycl)
54+
// CHK-FPGA-AOCO-PHASES-WIN: 3: append-footer, {2}, c++, (host-sycl)
55+
// CHK-FPGA-AOCO-PHASES-WIN: 4: preprocessor, {3}, c++-cpp-output, (host-sycl)
56+
// CHK-FPGA-AOCO-PHASES-WIN: 5: input, "[[INPUTSRC]]", c++, (device-sycl)
57+
// CHK-FPGA-AOCO-PHASES-WIN: 6: preprocessor, {5}, c++-cpp-output, (device-sycl)
58+
// CHK-FPGA-AOCO-PHASES-WIN: 7: compiler, {6}, ir, (device-sycl)
59+
// CHK-FPGA-AOCO-PHASES-WIN: 8: offload, "host-sycl (x86_64-pc-windows-msvc)" {4}, "device-sycl (spir64_fpga-unknown-unknown-sycldevice)" {7}, c++-cpp-output
6060
// CHK-FPGA-AOCO-PHASES-WIN: 9: compiler, {8}, ir, (host-sycl)
6161
// CHK-FPGA-AOCO-PHASES-WIN: 10: backend, {9}, assembler, (host-sycl)
6262
// CHK-FPGA-AOCO-PHASES-WIN: 11: assembler, {10}, object, (host-sycl)
@@ -65,7 +65,7 @@
6565
// CHK-FPGA-AOCO-PHASES-WIN: 14: clang-offload-deps, {13}, ir, (host-sycl)
6666
// CHK-FPGA-AOCO-PHASES-WIN: 15: input, "[[INPUTA]]", archive
6767
// CHK-FPGA-AOCO-PHASES-WIN: 16: clang-offload-unbundler, {15}, archive
68-
// CHK-FPGA-AOCO-PHASES-WIN: 17: linker, {5, 14, 16}, ir, (device-sycl)
68+
// CHK-FPGA-AOCO-PHASES-WIN: 17: linker, {7, 14, 16}, ir, (device-sycl)
6969
// CHK-FPGA-AOCO-PHASES-WIN: 18: sycl-post-link, {17}, tempfiletable, (device-sycl)
7070
// CHK-FPGA-AOCO-PHASES-WIN: 19: file-table-tform, {18}, tempfilelist, (device-sycl)
7171
// CHK-FPGA-AOCO-PHASES-WIN: 20: llvm-spirv, {19}, tempfilelist, (device-sycl)

clang/test/Driver/sycl-offload-intelfpga-emu.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -186,20 +186,20 @@
186186
// RUN: | FileCheck -check-prefixes=CHK-FPGA-LINK-SRC %s
187187
// CHK-FPGA-LINK-SRC: 0: input, "[[INPUT:.+\.cpp]]", c++, (host-sycl)
188188
// CHK-FPGA-LINK-SRC: 1: preprocessor, {0}, c++-cpp-output, (host-sycl)
189-
// CHK-FPGA-LINK-SRC: 2: input, "[[INPUT]]", c++, (device-sycl)
190-
// CHK-FPGA-LINK-SRC: 3: preprocessor, {2}, c++-cpp-output, (device-sycl)
191-
// CHK-FPGA-LINK-SRC: 4: compiler, {3}, ir, (device-sycl)
192-
// CHK-FPGA-LINK-SRC: 5: offload, "host-sycl (x86_64-unknown-linux-gnu)" {1}, "device-sycl (spir64_fpga-unknown-unknown-sycldevice)" {4}, c++-cpp-output
193-
// CHK-FPGA-LINK-SRC: 6: append-footer, {5}, c++, (host-sycl)
194-
// CHK-FPGA-LINK-SRC: 7: preprocessor, {6}, c++-cpp-output, (host-sycl)
189+
// CHK-FPGA-LINK-SRC: 2: append-footer, {1}, c++, (host-sycl)
190+
// CHK-FPGA-LINK-SRC: 3: preprocessor, {2}, c++-cpp-output, (host-sycl)
191+
// CHK-FPGA-LINK-SRC: 4: input, "[[INPUT]]", c++, (device-sycl)
192+
// CHK-FPGA-LINK-SRC: 5: preprocessor, {4}, c++-cpp-output, (device-sycl)
193+
// CHK-FPGA-LINK-SRC: 6: compiler, {5}, ir, (device-sycl)
194+
// CHK-FPGA-LINK-SRC: 7: offload, "host-sycl (x86_64-unknown-linux-gnu)" {3}, "device-sycl (spir64_fpga-unknown-unknown-sycldevice)" {6}, c++-cpp-output
195195
// CHK-FPGA-LINK-SRC: 8: compiler, {7}, ir, (host-sycl)
196196
// CHK-FPGA-LINK-SRC: 9: backend, {8}, assembler, (host-sycl)
197197
// CHK-FPGA-LINK-SRC: 10: assembler, {9}, object, (host-sycl)
198198
// CHK-FPGA-LINK-SRC: 11: clang-offload-wrapper, {10}, ir, (host-sycl)
199199
// CHK-FPGA-LINK-SRC: 12: backend, {11}, assembler, (host-sycl)
200200
// CHK-FPGA-LINK-SRC: 13: assembler, {12}, object, (host-sycl)
201201
// CHK-FPGA-LINK-SRC: 14: linker, {13}, archive, (host-sycl)
202-
// CHK-FPGA-LINK-SRC: 15: linker, {4}, ir, (device-sycl)
202+
// CHK-FPGA-LINK-SRC: 15: linker, {6}, ir, (device-sycl)
203203
// CHK-FPGA-LINK-SRC: 16: sycl-post-link, {15}, tempfiletable, (device-sycl)
204204
// CHK-FPGA-LINK-SRC: 17: file-table-tform, {16}, tempfilelist, (device-sycl)
205205
// CHK-FPGA-LINK-SRC: 18: llvm-spirv, {17}, tempfilelist, (device-sycl)

clang/test/Driver/sycl-offload-intelfpga.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -248,20 +248,20 @@
248248
// RUN: | FileCheck -check-prefixes=CHK-FPGA-LINK-SRC %s
249249
// CHK-FPGA-LINK-SRC: 0: input, "[[INPUT:.+\.cpp]]", c++, (host-sycl)
250250
// CHK-FPGA-LINK-SRC: 1: preprocessor, {0}, c++-cpp-output, (host-sycl)
251-
// CHK-FPGA-LINK-SRC: 2: input, "[[INPUT]]", c++, (device-sycl)
252-
// CHK-FPGA-LINK-SRC: 3: preprocessor, {2}, c++-cpp-output, (device-sycl)
253-
// CHK-FPGA-LINK-SRC: 4: compiler, {3}, ir, (device-sycl)
254-
// CHK-FPGA-LINK-SRC: 5: offload, "host-sycl (x86_64-unknown-linux-gnu)" {1}, "device-sycl (spir64_fpga-unknown-unknown-sycldevice)" {4}, c++-cpp-output
255-
// CHK-FPGA-LINK-SRC: 6: append-footer, {5}, c++, (host-sycl)
256-
// CHK-FPGA-LINK-SRC: 7: preprocessor, {6}, c++-cpp-output, (host-sycl)
251+
// CHK-FPGA-LINK-SRC: 2: append-footer, {1}, c++, (host-sycl)
252+
// CHK-FPGA-LINK-SRC: 3: preprocessor, {2}, c++-cpp-output, (host-sycl)
253+
// CHK-FPGA-LINK-SRC: 4: input, "[[INPUT]]", c++, (device-sycl)
254+
// CHK-FPGA-LINK-SRC: 5: preprocessor, {4}, c++-cpp-output, (device-sycl)
255+
// CHK-FPGA-LINK-SRC: 6: compiler, {5}, ir, (device-sycl)
256+
// CHK-FPGA-LINK-SRC: 7: offload, "host-sycl (x86_64-unknown-linux-gnu)" {3}, "device-sycl (spir64_fpga-unknown-unknown-sycldevice)" {6}, c++-cpp-output
257257
// CHK-FPGA-LINK-SRC: 8: compiler, {7}, ir, (host-sycl)
258258
// CHK-FPGA-LINK-SRC: 9: backend, {8}, assembler, (host-sycl)
259259
// CHK-FPGA-LINK-SRC: 10: assembler, {9}, object, (host-sycl)
260260
// CHK-FPGA-LINK-SRC: 11: clang-offload-wrapper, {10}, ir, (host-sycl)
261261
// CHK-FPGA-LINK-SRC: 12: backend, {11}, assembler, (host-sycl)
262262
// CHK-FPGA-LINK-SRC: 13: assembler, {12}, object, (host-sycl)
263263
// CHK-FPGA-LINK-SRC: 14: linker, {13}, archive, (host-sycl)
264-
// CHK-FPGA-LINK-SRC: 15: linker, {4}, ir, (device-sycl)
264+
// CHK-FPGA-LINK-SRC: 15: linker, {6}, ir, (device-sycl)
265265
// CHK-FPGA-LINK-SRC: 16: sycl-post-link, {15}, tempfiletable, (device-sycl)
266266
// CHK-FPGA-LINK-SRC: 17: file-table-tform, {16}, tempfilelist, (device-sycl)
267267
// CHK-FPGA-LINK-SRC: 18: llvm-spirv, {17}, tempfilelist, (device-sycl)

clang/test/Driver/sycl-offload-nvptx.cpp

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,17 @@
1818
// RUN: | FileCheck -check-prefix=CHK-PHASES-NO-CC %s
1919
// CHK-PHASES-NO-CC: 0: input, "{{.*}}", c++, (host-sycl)
2020
// CHK-PHASES-NO-CC: 1: preprocessor, {0}, c++-cpp-output, (host-sycl)
21-
// CHK-PHASES-NO-CC: 2: input, "{{.*}}", c++, (device-sycl, sm_50)
22-
// CHK-PHASES-NO-CC: 3: preprocessor, {2}, c++-cpp-output, (device-sycl, sm_50)
23-
// CHK-PHASES-NO-CC: 4: compiler, {3}, ir, (device-sycl, sm_50)
24-
// CHK-PHASES-NO-CC: 5: offload, "host-sycl (x86_64-unknown-linux-gnu)" {1}, "device-sycl (nvptx64-nvidia-nvcl-sycldevice:sm_50)" {4}, c++-cpp-output
25-
// CHK-PHASES-NO-CC: 6: append-footer, {5}, c++, (host-sycl)
26-
// CHK-PHASES-NO-CC: 7: preprocessor, {6}, c++-cpp-output, (host-sycl)
21+
// CHK-PHASES-NO-CC: 2: append-footer, {1}, c++, (host-sycl)
22+
// CHK-PHASES-NO-CC: 3: preprocessor, {2}, c++-cpp-output, (host-sycl)
23+
// CHK-PHASES-NO-CC: 4: input, "{{.*}}", c++, (device-sycl, sm_50)
24+
// CHK-PHASES-NO-CC: 5: preprocessor, {4}, c++-cpp-output, (device-sycl, sm_50)
25+
// CHK-PHASES-NO-CC: 6: compiler, {5}, ir, (device-sycl, sm_50)
26+
// CHK-PHASES-NO-CC: 7: offload, "host-sycl (x86_64-unknown-linux-gnu)" {3}, "device-sycl (nvptx64-nvidia-nvcl-sycldevice:sm_50)" {6}, c++-cpp-output
2727
// CHK-PHASES-NO-CC: 8: compiler, {7}, ir, (host-sycl)
2828
// CHK-PHASES-NO-CC: 9: backend, {8}, assembler, (host-sycl)
2929
// CHK-PHASES-NO-CC: 10: assembler, {9}, object, (host-sycl)
3030
// CHK-PHASES-NO-CC: 11: linker, {10}, image, (host-sycl)
31-
// CHK-PHASES-NO-CC: 12: linker, {4}, ir, (device-sycl, sm_50)
31+
// CHK-PHASES-NO-CC: 12: linker, {6}, ir, (device-sycl, sm_50)
3232
// CHK-PHASES-NO-CC: 13: sycl-post-link, {12}, ir, (device-sycl, sm_50)
3333
// CHK-PHASES-NO-CC: 14: backend, {13}, assembler, (device-sycl, sm_50)
3434
// CHK-PHASES-NO-CC: 15: clang-offload-wrapper, {14}, object, (device-sycl, sm_50)
@@ -41,17 +41,17 @@
4141
// RUN: | FileCheck -check-prefix=CHK-PHASES %s
4242
// CHK-PHASES: 0: input, "{{.*}}", c++, (host-sycl)
4343
// CHK-PHASES: 1: preprocessor, {0}, c++-cpp-output, (host-sycl)
44-
// CHK-PHASES: 2: input, "{{.*}}", c++, (device-sycl, sm_35)
45-
// CHK-PHASES: 3: preprocessor, {2}, c++-cpp-output, (device-sycl, sm_35)
46-
// CHK-PHASES: 4: compiler, {3}, ir, (device-sycl, sm_35)
47-
// CHK-PHASES: 5: offload, "host-sycl (x86_64-unknown-linux-gnu)" {1}, "device-sycl (nvptx64-nvidia-nvcl-sycldevice:sm_35)" {4}, c++-cpp-output
48-
// CHK-PHASES: 6: append-footer, {5}, c++, (host-sycl)
49-
// CHK-PHASES: 7: preprocessor, {6}, c++-cpp-output, (host-sycl)
44+
// CHK-PHASES: 2: append-footer, {1}, c++, (host-sycl)
45+
// CHK-PHASES: 3: preprocessor, {2}, c++-cpp-output, (host-sycl)
46+
// CHK-PHASES: 4: input, "{{.*}}", c++, (device-sycl, sm_35)
47+
// CHK-PHASES: 5: preprocessor, {4}, c++-cpp-output, (device-sycl, sm_35)
48+
// CHK-PHASES: 6: compiler, {5}, ir, (device-sycl, sm_35)
49+
// CHK-PHASES: 7: offload, "host-sycl (x86_64-unknown-linux-gnu)" {3}, "device-sycl (nvptx64-nvidia-nvcl-sycldevice:sm_35)" {6}, c++-cpp-output
5050
// CHK-PHASES: 8: compiler, {7}, ir, (host-sycl)
5151
// CHK-PHASES: 9: backend, {8}, assembler, (host-sycl)
5252
// CHK-PHASES: 10: assembler, {9}, object, (host-sycl)
5353
// CHK-PHASES: 11: linker, {10}, image, (host-sycl)
54-
// CHK-PHASES: 12: linker, {4}, ir, (device-sycl, sm_35)
54+
// CHK-PHASES: 12: linker, {6}, ir, (device-sycl, sm_35)
5555
// CHK-PHASES: 13: sycl-post-link, {12}, ir, (device-sycl, sm_35)
5656
// CHK-PHASES: 14: backend, {13}, assembler, (device-sycl, sm_35)
5757
// CHK-PHASES: 15: clang-offload-wrapper, {14}, object, (device-sycl, sm_35)

clang/test/Driver/sycl-offload-static-lib-2.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,12 @@
5050
// STATIC_LIB_SRC: 0: input, "[[INPUTA:.+\.a]]", object, (host-sycl)
5151
// STATIC_LIB_SRC: 1: input, "[[INPUTC:.+\.cpp]]", c++, (host-sycl)
5252
// STATIC_LIB_SRC: 2: preprocessor, {1}, c++-cpp-output, (host-sycl)
53-
// STATIC_LIB_SRC: 3: input, "[[INPUTC]]", c++, (device-sycl)
54-
// STATIC_LIB_SRC: 4: preprocessor, {3}, c++-cpp-output, (device-sycl)
55-
// STATIC_LIB_SRC: 5: compiler, {4}, ir, (device-sycl)
56-
// STATIC_LIB_SRC: 6: offload, "host-sycl (x86_64-unknown-linux-gnu)" {2}, "device-sycl (spir64-unknown-unknown-sycldevice)" {5}, c++-cpp-output
57-
// STATIC_LIB_SRC: 7: append-footer, {6}, c++, (host-sycl)
58-
// STATIC_LIB_SRC: 8: preprocessor, {7}, c++-cpp-output, (host-sycl)
53+
// STATIC_LIB_SRC: 3: append-footer, {2}, c++, (host-sycl)
54+
// STATIC_LIB_SRC: 4: preprocessor, {3}, c++-cpp-output, (host-sycl)
55+
// STATIC_LIB_SRC: 5: input, "[[INPUTC]]", c++, (device-sycl)
56+
// STATIC_LIB_SRC: 6: preprocessor, {5}, c++-cpp-output, (device-sycl)
57+
// STATIC_LIB_SRC: 7: compiler, {6}, ir, (device-sycl)
58+
// STATIC_LIB_SRC: 8: offload, "host-sycl (x86_64-unknown-linux-gnu)" {4}, "device-sycl (spir64-unknown-unknown-sycldevice)" {7}, c++-cpp-output
5959
// STATIC_LIB_SRC: 9: compiler, {8}, ir, (host-sycl)
6060
// STATIC_LIB_SRC: 10: backend, {9}, assembler, (host-sycl)
6161
// STATIC_LIB_SRC: 11: assembler, {10}, object, (host-sycl)
@@ -64,7 +64,7 @@
6464
// STATIC_LIB_SRC: 14: clang-offload-deps, {13}, ir, (host-sycl)
6565
// STATIC_LIB_SRC: 15: input, "[[INPUTA]]", archive
6666
// STATIC_LIB_SRC: 16: clang-offload-unbundler, {15}, archive
67-
// STATIC_LIB_SRC: 17: linker, {5, 14, 16}, ir, (device-sycl)
67+
// STATIC_LIB_SRC: 17: linker, {7, 14, 16}, ir, (device-sycl)
6868
// STATIC_LIB_SRC: 18: sycl-post-link, {17}, tempfiletable, (device-sycl)
6969
// STATIC_LIB_SRC: 19: file-table-tform, {18}, tempfilelist, (device-sycl)
7070
// STATIC_LIB_SRC: 20: llvm-spirv, {19}, tempfilelist, (device-sycl)

0 commit comments

Comments
 (0)