Skip to content
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

Add option -include-footer. #14402

Merged
merged 12 commits into from
Jul 18, 2024
1 change: 1 addition & 0 deletions clang/include/clang/Lex/Preprocessor.h
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,7 @@ class Preprocessor {
public:
/// The kind of translation unit we are processing.
const TranslationUnitKind TUKind;
bool IncludeFooterProcessed;

/// Returns a pointer into the given file's buffer that's guaranteed
/// to be between tokens. The returned pointer is always before \p Start.
Expand Down
3 changes: 2 additions & 1 deletion clang/lib/Driver/Driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8106,7 +8106,8 @@ Action *Driver::ConstructPhaseAction(
if (Args.hasArg(options::OPT_fsycl) && HostPPType != types::TY_INVALID &&
!Args.hasArg(options::OPT_fno_sycl_use_footer) &&
TargetDeviceOffloadKind == Action::OFK_None &&
Input->getType() != types::TY_CUDA_DEVICE) {
Input->getType() != types::TY_CUDA_DEVICE &&
Args.hasArg(options::OPT_fsycl_host_compiler_EQ)) {
// Performing a host compilation with -fsycl. Append the integration
// footer to the source file.
auto *AppendFooter =
Expand Down
39 changes: 13 additions & 26 deletions clang/lib/Driver/ToolChains/Clang.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1057,14 +1057,6 @@ void Clang::AddPreprocessingOptions(Compilation &C, const JobAction &JA,
C.getDriver().addFPGATempDepFile(DepFile, BaseName);
};

// Do not add dependency generation information when compiling the source +
// footer combination. The dependency generation is done in a separate
// compile step so we can retain original source information.
// TODO: remove this when/if we can improve the host compilation situation
// when dealing with the temporary file generated for the footer.
if (ContainsAppendFooterAction(&JA))
ArgM = nullptr;

if (ArgM) {
// Determine the output location.
const char *DepFile;
Expand Down Expand Up @@ -1337,24 +1329,6 @@ void Clang::AddPreprocessingOptions(Compilation &C, const JobAction &JA,
A->render(Args, CmdArgs);
}

// The file being compiled that contains the integration footer is not being
// compiled in the directory of the original source. Add that directory
// as an -iquote option so we can properly find potential user headers there.
// The original source search directory should also be placed before any user
// search directories.
if (ContainsAppendFooterAction(&JA)) {
SmallString<128> SourcePath(Inputs[0].getBaseInput());
llvm::sys::path::remove_filename(SourcePath);
if (!SourcePath.empty()) {
CmdArgs.push_back("-iquote");
CmdArgs.push_back(Args.MakeArgString(SourcePath));
} else if (llvm::ErrorOr<std::string> CWD =
D.getVFS().getCurrentWorkingDirectory()) {
CmdArgs.push_back("-iquote");
CmdArgs.push_back(Args.MakeArgString(*CWD));
}
}

Args.addAllArgs(CmdArgs,
{options::OPT_D, options::OPT_U, options::OPT_I_Group,
options::OPT_F, options::OPT_index_header_map,
Expand Down Expand Up @@ -5613,6 +5587,19 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
// included, enable the integration header based diagnostics.
CmdArgs.push_back("-fsycl-enable-int-header-diags");
}

// Add the -include-footer option to add the integration footer
StringRef Footer = D.getIntegrationFooter(Input.getBaseInput());
if (types::getPreprocessedType(Input.getType()) != types::TY_INVALID &&
!Args.hasArg(options::OPT_fno_sycl_use_footer) && !Footer.empty()) {
CmdArgs.push_back("-include-footer");
CmdArgs.push_back(Args.MakeArgString(Footer));
// When creating dependency information, filter out the generated
// integration footer file.
CmdArgs.push_back("-dependency-filter");
CmdArgs.push_back(Args.MakeArgString(Footer));
}

// Let the FE know we are doing a SYCL offload compilation, but we are
// doing the host pass.
CmdArgs.push_back("-fsycl-is-host");
Expand Down
3 changes: 2 additions & 1 deletion clang/lib/Frontend/PrintPreprocessedOutput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1200,7 +1200,8 @@ void clang::DoPrintPreprocessedInput(Preprocessor &PP, raw_ostream *OS,
PrintPreprocessedTokens(PP, Tok, Callbacks);
*OS << '\n';

if (!PP.getPreprocessorOpts().IncludeFooter.empty()) {
if (!PP.getPreprocessorOpts().IncludeFooter.empty() &&
!PP.IncludeFooterProcessed) {
assert(PP.getLangOpts().SYCLIsHost &&
"The 'include-footer' is expected in host compilation only");
SourceLocation Loc = Tok.getLocation();
Expand Down
34 changes: 34 additions & 0 deletions clang/lib/Lex/PPLexerChange.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,18 @@ void Preprocessor::diagnoseMissingHeaderInUmbrellaDir(const Module &Mod) {
}
}

static FileID ComputeValidFooterFileID(SourceManager &SM, StringRef Footer) {
FileID FooterFileID;
llvm::Expected<FileEntryRef> ExpectedFileRef =
SM.getFileManager().getFileRef(Footer);
if (ExpectedFileRef) {
FooterFileID = SM.getOrCreateFileID(ExpectedFileRef.get(),
SrcMgr::CharacteristicKind::C_User);
}
assert(FooterFileID.isValid() && "expecting a valid footer FileID");
return FooterFileID;
}

/// HandleEndOfFile - This callback is invoked when the lexer hits the end of
/// the current file. This either returns the EOF token or pops a level off
/// the include stack and keeps going.
Expand Down Expand Up @@ -534,6 +546,28 @@ bool Preprocessor::HandleEndOfFile(Token &Result, bool isEndOfMacro) {
return LeavingSubmodule;
}
}

if (isInPrimaryFile() && getLangOpts().SYCLIsHost &&
!getPreprocessorOpts().IncludeFooter.empty()) {
SourceManager &SourceMgr = getSourceManager();
SourceLocation Loc = CurLexer->getFileLoc();

FileID FooterFileID = ComputeValidFooterFileID(
SourceMgr, getPreprocessorOpts().IncludeFooter);
if (!FooterFileID.isInvalid() && !IncludeFooterProcessed) {
IncludeFooterProcessed = true;
// Mark the footer file as included
if (OptionalFileEntryRef FE =
SourceMgr.getFileEntryRefForID(FooterFileID))
markIncluded(*FE);
clang::Lexer *LexerSave = CurLexer.get();
clang::PreprocessorLexer *CurPPLexerSave =
CurPPLexer->getPP()->getCurrentLexer();
EnterSourceFile(FooterFileID, CurDirLookup, Result.getLocation());
return false;
}
}

// If this is the end of the main file, form an EOF token.
assert(CurLexer && "Got EOF but no current lexer set!");
const char *EndPos = getCurLexerEndPos();
Expand Down
2 changes: 1 addition & 1 deletion clang/lib/Lex/Preprocessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ Preprocessor::Preprocessor(std::shared_ptr<PreprocessorOptions> PPOpts,
// deferred to Preprocessor::Initialize().
Identifiers(IILookup), PragmaHandlers(new PragmaNamespace(StringRef())),
TUKind(TUKind), SkipMainFilePreamble(0, true),
CurSubmoduleState(&NullSubmoduleState) {
IncludeFooterProcessed(false), CurSubmoduleState(&NullSubmoduleState) {
OwnsHeaderSearch = OwnsHeaders;

// Default to discarding comments.
Expand Down
68 changes: 32 additions & 36 deletions clang/test/Driver/sycl-cuda-tu-offload.cu
Original file line number Diff line number Diff line change
Expand Up @@ -13,43 +13,39 @@
// DEFAULT-PHASES: +- 8: linker, {3, 7}, ir, (device-sycl, sm_80)
// DEFAULT-PHASES: +- 9: offload, "device-sycl (nvptx64-nvidia-cuda:sm_80)" {8}, ir
// DEFAULT-PHASES: | +- 10: input, "{{.*}}", cuda, (host-cuda-sycl)
// DEFAULT-PHASES: | +- 11: append-footer, {10}, cuda, (host-cuda-sycl)
// DEFAULT-PHASES: | +- 12: preprocessor, {11}, cuda-cpp-output, (host-cuda-sycl)
// DEFAULT-PHASES: | +- 13: offload, "host-cuda-sycl (x86_64-unknown-linux-gnu)" {12}, "device-sycl (nvptx64-nvidia-cuda:sm_80)" {2}, cuda-cpp-output
// DEFAULT-PHASES: | +- 14: compiler, {13}, ir, (host-cuda-sycl)
// DEFAULT-PHASES: | | +- 15: backend, {6}, assembler, (device-cuda, sm_80)
// DEFAULT-PHASES: | | +- 16: assembler, {15}, object, (device-cuda, sm_80)
// DEFAULT-PHASES: | | +- 17: offload, "device-cuda (nvptx64-nvidia-cuda:sm_80)" {16}, object
// DEFAULT-PHASES: | | |- 18: offload, "device-cuda (nvptx64-nvidia-cuda:sm_80)" {15}, assembler
// DEFAULT-PHASES: | |- 19: linker, {17, 18}, cuda-fatbin, (device-cuda)
// DEFAULT-PHASES: | +- 20: offload, "host-cuda-sycl (x86_64-unknown-linux-gnu)" {14}, "device-cuda (nvptx64-nvidia-cuda)" {19}, ir
// DEFAULT-PHASES: | +- 21: backend, {20}, assembler, (host-cuda-sycl)
// DEFAULT-PHASES: |- 22: assembler, {21}, object, (host-cuda-sycl)
// DEFAULT-PHASES: 23: clang-offload-bundler, {9, 22}, object, (host-cuda-sycl)


// DEFAULT-PHASES: | +- 11: preprocessor, {10}, cuda-cpp-output, (host-cuda-sycl)
// DEFAULT-PHASES: | +- 12: offload, "host-cuda-sycl (x86_64-unknown-linux-gnu)" {11}, "device-sycl (nvptx64-nvidia-cuda:sm_80)" {2}, cuda-cpp-output
// DEFAULT-PHASES: | +- 13: compiler, {12}, ir, (host-cuda-sycl)
// DEFAULT-PHASES: | | +- 14: backend, {6}, assembler, (device-cuda, sm_80)
// DEFAULT-PHASES: | | +- 15: assembler, {14}, object, (device-cuda, sm_80)
// DEFAULT-PHASES: | | +- 16: offload, "device-cuda (nvptx64-nvidia-cuda:sm_80)" {15}, object
// DEFAULT-PHASES: | | |- 17: offload, "device-cuda (nvptx64-nvidia-cuda:sm_80)" {14}, assembler
// DEFAULT-PHASES: | |- 18: linker, {16, 17}, cuda-fatbin, (device-cuda)
// DEFAULT-PHASES: | +- 19: offload, "host-cuda-sycl (x86_64-unknown-linux-gnu)" {13}, "device-cuda (nvptx64-nvidia-cuda)" {18}, ir
// DEFAULT-PHASES: | +- 20: backend, {19}, assembler, (host-cuda-sycl)
// DEFAULT-PHASES: |- 21: assembler, {20}, object, (host-cuda-sycl)
// DEFAULT-PHASES: 22: clang-offload-bundler, {9, 21}, object, (host-cuda-sycl)

// RUN: %clangxx -ccc-print-phases --sysroot=%S/Inputs/SYCL --cuda-path=%S/Inputs/CUDA_111/usr/local/cuda -fsycl-libspirv-path=%S/Inputs/SYCL/lib/nvidiacl -target x86_64-unknown-linux-gnu -fsycl -fsycl-targets=nvptx64-nvidia-cuda -Xsycl-target-backend --cuda-gpu-arch=sm_80 --cuda-gpu-arch=sm_80 %s 2>&1 | FileCheck %s --check-prefix=DEFAULT-PHASES2

// DEFAULT-PHASES2: +- 0: input, "{{.*}}", cuda, (host-cuda-sycl)
// DEFAULT-PHASES2: +- 1: append-footer, {0}, cuda, (host-cuda-sycl)
// DEFAULT-PHASES2: +- 2: preprocessor, {1}, cuda-cpp-output, (host-cuda-sycl)
// DEFAULT-PHASES2: | +- 3: input, "{{.*}}", cuda, (device-sycl, sm_80)
// DEFAULT-PHASES2: | +- 4: preprocessor, {3}, cuda-cpp-output, (device-sycl, sm_80)
// DEFAULT-PHASES2: |- 5: compiler, {4}, ir, (device-sycl, sm_80)
// DEFAULT-PHASES2: +- 6: offload, "host-cuda-sycl (x86_64-unknown-linux-gnu)" {2}, "device-sycl (nvptx64-nvidia-cuda:sm_80)" {5}, cuda-cpp-output
// DEFAULT-PHASES2: +- 7: compiler, {6}, ir, (host-cuda-sycl)
// DEFAULT-PHASES2: | +- 8: input, "{{.*}}", cuda, (device-cuda, sm_80)
// DEFAULT-PHASES2: | +- 9: preprocessor, {8}, cuda-cpp-output, (device-cuda, sm_80)
// DEFAULT-PHASES2: | +- 10: compiler, {9}, ir, (device-cuda, sm_80)
// DEFAULT-PHASES2: | +- 11: backend, {10}, assembler, (device-cuda, sm_80)
// DEFAULT-PHASES2: | +- 12: assembler, {11}, object, (device-cuda, sm_80)
// DEFAULT-PHASES2: | +- 13: offload, "device-cuda (nvptx64-nvidia-cuda:sm_80)" {12}, object
// DEFAULT-PHASES2: | |- 14: offload, "device-cuda (nvptx64-nvidia-cuda:sm_80)" {11}, assembler
// DEFAULT-PHASES2: |- 15: linker, {13, 14}, cuda-fatbin, (device-cuda)
// DEFAULT-PHASES2: +- 16: offload, "host-cuda-sycl (x86_64-unknown-linux-gnu)" {7}, "device-cuda (nvptx64-nvidia-cuda)" {15}, ir
// DEFAULT-PHASES2: +- 17: backend, {16}, assembler, (host-cuda-sycl)
// DEFAULT-PHASES2: +- 18: assembler, {17}, object, (host-cuda-sycl)
// DEFAULT-PHASES2: +- 19: offload, "host-cuda-sycl (x86_64-unknown-linux-gnu)" {18}, object
// DEFAULT-PHASES2: | |- 20: offload, "device-cuda (nvptx64-nvidia-cuda:sm_80)" {10}, ir
// DEFAULT-PHASES2: | +- 21: linker, {5, 20}, ir, (device-sycl, sm_80)
// DEFAULT-PHASES2: +- 1: preprocessor, {0}, cuda-cpp-output, (host-cuda-sycl)
// DEFAULT-PHASES2: | +- 2: input, "{{.*}}", cuda, (device-sycl, sm_80)
// DEFAULT-PHASES2: | +- 3: preprocessor, {2}, cuda-cpp-output, (device-sycl, sm_80)
// DEFAULT-PHASES2: |- 4: compiler, {3}, ir, (device-sycl, sm_80)
// DEFAULT-PHASES2: +- 5: offload, "host-cuda-sycl (x86_64-unknown-linux-gnu)" {1}, "device-sycl (nvptx64-nvidia-cuda:sm_80)" {4}, cuda-cpp-output
// DEFAULT-PHASES2: +- 6: compiler, {5}, ir, (host-cuda-sycl)
// DEFAULT-PHASES2: | +- 7: input, "{{.*}}", cuda, (device-cuda, sm_80)
// DEFAULT-PHASES2: | +- 8: preprocessor, {7}, cuda-cpp-output, (device-cuda, sm_80)
// DEFAULT-PHASES2: | +- 9: compiler, {8}, ir, (device-cuda, sm_80)
// DEFAULT-PHASES2: | +- 10: backend, {9}, assembler, (device-cuda, sm_80)
// DEFAULT-PHASES2: | +- 11: assembler, {10}, object, (device-cuda, sm_80)
// DEFAULT-PHASES2: | +- 12: offload, "device-cuda (nvptx64-nvidia-cuda:sm_80)" {11}, object
// DEFAULT-PHASES2: | |- 13: offload, "device-cuda (nvptx64-nvidia-cuda:sm_80)" {10}, assembler
// DEFAULT-PHASES2: |- 14: linker, {12, 13}, cuda-fatbin, (device-cuda)
// DEFAULT-PHASES2: +- 15: offload, "host-cuda-sycl (x86_64-unknown-linux-gnu)" {6}, "device-cuda (nvptx64-nvidia-cuda)" {14}, ir
// DEFAULT-PHASES2: +- 16: backend, {15}, assembler, (host-cuda-sycl)
// DEFAULT-PHASES2: +- 17: assembler, {16}, object, (host-cuda-sycl)
// DEFAULT-PHASES2: +- 18: offload, "host-cuda-sycl (x86_64-unknown-linux-gnu)" {17}, object
// DEFAULT-PHASES2: | |- 19: offload, "device-cuda (nvptx64-nvidia-cuda:sm_80)" {9}, ir
// DEFAULT-PHASES2: | +- 20: linker, {4, 19}, ir, (device-sycl, sm_80)
42 changes: 19 additions & 23 deletions clang/test/Driver/sycl-early-device-link-old-model.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@
// CREATE_IMAGE: file-table-tform{{.*}} "-o" "[[TFORM_TABLE:.+\.table]]" "[[POSTLINK_TABLE]]" "[[OCLOC_OUT]]"
// CREATE_IMAGE: clang-offload-wrapper{{.*}} "-o=[[WRAPPER_BC:.+\.bc]]"
// CREATE_IMAGE: llc{{.*}} "-o" "[[DEVICE_OBJECT:.+\.o]]" "[[WRAPPER_BC]]"
// CREATE_IMAGE: append-file{{.*}} "--output=[[APPEND_SOURCE:.+\.cpp]]
// CREATE_IMAGE: clang{{.*}} "-fsycl-is-host"{{.*}} "-o" "[[HOST_OBJECT:.+\.o]]"{{.*}} "[[APPEND_SOURCE]]"
// CREATE_IMAGE: clang{{.*}} "-fsycl-is-host"{{.*}} "-o" "[[HOST_OBJECT:.+\.o]]"
// CREATE_IMAGE: clang-offload-bundler{{.*}} "-targets=sycl-spir64_gen_image-unknown-unknown,host-x86_64-unknown-linux-gnu" "-output={{.*}}" "-input=[[DEVICE_OBJECT]]" "-input=[[HOST_OBJECT]]"

// RUN: %clangxx -c -fno-sycl-rdc -fsycl --no-offload-new-driver -fsycl-targets=spir64_gen \
Expand All @@ -42,13 +41,12 @@
// CREATE_IMAGE_PHASES: 13: clang-offload-wrapper, {12}, object, (device-sycl)
// CREATE_IMAGE_PHASES: 14: offload, "device-sycl (spir64_gen-unknown-unknown)" {13}, object
// CREATE_IMAGE_PHASES: 15: input, "[[INPUT]]", c++, (host-sycl)
// CREATE_IMAGE_PHASES: 16: append-footer, {15}, c++, (host-sycl)
// CREATE_IMAGE_PHASES: 17: preprocessor, {16}, c++-cpp-output, (host-sycl)
// CREATE_IMAGE_PHASES: 18: offload, "host-sycl (x86_64-unknown-linux-gnu)" {17}, "device-sycl (spir64_gen-unknown-unknown)" {13}, c++-cpp-output
// CREATE_IMAGE_PHASES: 19: compiler, {18}, ir, (host-sycl)
// CREATE_IMAGE_PHASES: 20: backend, {19}, assembler, (host-sycl)
// CREATE_IMAGE_PHASES: 21: assembler, {20}, object, (host-sycl)
// CREATE_IMAGE_PHASES: 22: clang-offload-bundler, {14, 21}, object, (host-sycl)
// CREATE_IMAGE_PHASES: 16: preprocessor, {15}, c++-cpp-output, (host-sycl)
// CREATE_IMAGE_PHASES: 17: offload, "host-sycl (x86_64-unknown-linux-gnu)" {16}, "device-sycl (spir64_gen-unknown-unknown)" {13}, c++-cpp-output
// CREATE_IMAGE_PHASES: 18: compiler, {17}, ir, (host-sycl)
// CREATE_IMAGE_PHASES: 19: backend, {18}, assembler, (host-sycl)
// CREATE_IMAGE_PHASES: 20: assembler, {19}, object, (host-sycl)
// CREATE_IMAGE_PHASES: 21: clang-offload-bundler, {14, 20}, object, (host-sycl)

// Use of -fno-sycl-rdc -c with non-AOT should not perform the device link.
// RUN: %clangxx -c -fno-sycl-rdc -fsycl --no-offload-new-driver -fsycl-targets=spir64 \
Expand All @@ -60,13 +58,12 @@
// JIT_ONLY_PHASES: 2: compiler, {1}, ir, (device-sycl)
// JIT_ONLY_PHASES: 3: offload, "device-sycl (spir64-unknown-unknown)" {2}, ir
// JIT_ONLY_PHASES: 4: input, "[[INPUT]]", c++, (host-sycl)
// JIT_ONLY_PHASES: 5: append-footer, {4}, c++, (host-sycl)
// JIT_ONLY_PHASES: 6: preprocessor, {5}, c++-cpp-output, (host-sycl)
// JIT_ONLY_PHASES: 7: offload, "host-sycl (x86_64-unknown-linux-gnu)" {6}, "device-sycl (spir64-unknown-unknown)" {2}, c++-cpp-output
// JIT_ONLY_PHASES: 8: compiler, {7}, ir, (host-sycl)
// JIT_ONLY_PHASES: 9: backend, {8}, assembler, (host-sycl)
// JIT_ONLY_PHASES: 10: assembler, {9}, object, (host-sycl)
// JIT_ONLY_PHASES: 11: clang-offload-bundler, {3, 10}, object, (host-sycl)
// JIT_ONLY_PHASES: 5: preprocessor, {4}, c++-cpp-output, (host-sycl)
// JIT_ONLY_PHASES: 6: offload, "host-sycl (x86_64-unknown-linux-gnu)" {5}, "device-sycl (spir64-unknown-unknown)" {2}, c++-cpp-output
// JIT_ONLY_PHASES: 7: compiler, {6}, ir, (host-sycl)
// JIT_ONLY_PHASES: 8: backend, {7}, assembler, (host-sycl)
// JIT_ONLY_PHASES: 9: assembler, {8}, object, (host-sycl)
// JIT_ONLY_PHASES: 10: clang-offload-bundler, {3, 9}, object, (host-sycl)

// Mix and match JIT and AOT phases check. Expectation is for AOT to perform
// early device link, and JIT to just produce the LLVM-IR.
Expand Down Expand Up @@ -95,13 +92,12 @@
// JIT_AOT_PHASES: 17: clang-offload-wrapper, {16}, object, (device-sycl)
// JIT_AOT_PHASES: 18: offload, "device-sycl (spir64_gen-unknown-unknown)" {17}, object
// JIT_AOT_PHASES: 19: input, "[[INPUT]]", c++, (host-sycl)
// JIT_AOT_PHASES: 20: append-footer, {19}, c++, (host-sycl)
// JIT_AOT_PHASES: 21: preprocessor, {20}, c++-cpp-output, (host-sycl)
// JIT_AOT_PHASES: 22: offload, "host-sycl (x86_64-unknown-linux-gnu)" {21}, "device-sycl (spir64_gen-unknown-unknown)" {17}, c++-cpp-output
// JIT_AOT_PHASES: 23: compiler, {22}, ir, (host-sycl)
// JIT_AOT_PHASES: 24: backend, {23}, assembler, (host-sycl)
// JIT_AOT_PHASES: 25: assembler, {24}, object, (host-sycl)
// JIT_AOT_PHASES: 26: clang-offload-bundler, {3, 18, 25}, object, (host-sycl)
// JIT_AOT_PHASES: 20: preprocessor, {19}, c++-cpp-output, (host-sycl)
// JIT_AOT_PHASES: 21: offload, "host-sycl (x86_64-unknown-linux-gnu)" {20}, "device-sycl (spir64_gen-unknown-unknown)" {17}, c++-cpp-output
// JIT_AOT_PHASES: 22: compiler, {21}, ir, (host-sycl)
// JIT_AOT_PHASES: 23: backend, {22}, assembler, (host-sycl)
// JIT_AOT_PHASES: 24: assembler, {23}, object, (host-sycl)
// JIT_AOT_PHASES: 25: clang-offload-bundler, {3, 18, 24}, object, (host-sycl)

// Consume object and library that contain final device images.
// RUN: %clangxx -fsycl --no-offload-new-driver --target=x86_64-unknown-linux-gnu -### \
Expand Down
4 changes: 2 additions & 2 deletions clang/test/Driver/sycl-embed-ir.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// RUN: %clangxx -fsycl -fsycl-targets=nvidia_gpu_sm_80 -fsycl-embed-ir -ccc-print-phases %s 2>&1 | \
// RUN: FileCheck -check-prefix=CHECK-NV %s

// CHECK-NV: [[IR:[0-9]+]]: compiler, {4}, ir, (device-sycl, sm_80)
// CHECK-NV: [[IR:[0-9]+]]: compiler, {3}, ir, (device-sycl, sm_80)
// CHECK-NV: [[IR_OFFLOAD:[0-9]+]]: offload, "host-sycl (x86_64-unknown-linux-gnu)" {{{.*}}}, "device-sycl (nvptx64-nvidia-cuda:sm_80)" {[[IR]]}, c++-cpp-output
// CHECK-NV: [[COMPILER:[0-9]+]]: compiler, {[[IR_OFFLOAD]]}, ir, (host-sycl)
// CHECK-NV: [[BACKEND:[0-9]+]]: backend, {[[COMPILER]]}, assembler, (host-sycl)
Expand All @@ -19,7 +19,7 @@
// RUN: %clangxx -fsycl -fsycl-targets=amd_gpu_gfx1010 -fsycl-embed-ir -ccc-print-phases %s 2>&1 | \
// RUN: FileCheck -check-prefix=CHECK-AMD %s

// CHECK-AMD: [[IR:[0-9]+]]: compiler, {4}, ir, (device-sycl, gfx1010)
// CHECK-AMD: [[IR:[0-9]+]]: compiler, {3}, ir, (device-sycl, gfx1010)
// CHECK-AMD: [[IR_OFFLOAD:[0-9]+]]: offload, "host-sycl (x86_64-unknown-linux-gnu)" {{{.*}}}, "device-sycl (amdgcn-amd-amdhsa:gfx1010)" {[[IR]]}, c++-cpp-output
// CHECK-AMD: [[COMPILER:[0-9]+]]: compiler, {[[IR_OFFLOAD]]}, ir, (host-sycl)
// CHECK-AMD: [[BACKEND:[0-9]+]]: backend, {[[COMPILER]]}, assembler, (host-sycl)
Expand Down
Loading
Loading