Skip to content

Commit aab5d74

Browse files
PietroGhguwedolinskyAlexeySachkovsteffenlarsen
authored
[SYCL][NATIVECPU] Support multiple SYCL targets in the same compiler invocation (#10495)
This PR adds support to multiple SYCL targets alongside `native_cpu` in the same compiler invocation (e.g. `clang++ -fsycl -fsycl-targets=native_cpu,spir64 input.cpp`). In order to implement this we had to make changes to multiple components, here is a quick overview: * Driver: changes in the Driver allow to correctly parse all the targets passed to `-fsycl-targets` (before we were just looking for `native_cpu`, ignoring the others). The Driver now also calls `sycl-post-link` and `clang-offload-wrapper`, performing a compilation flow more similar to the one used for other targets. * Sema: since the kernel name needs to be the same for all the SYCL targets, the change to the kernel name in Sema has been removed, and replaced with an LLVM Pass that gets run when lowering the device module (`llvm/lib/SYCLLowerIR/RenameKernelSYCLNativeCPU.cpp`). * Runtime: The definition for `_pi_program` in the Native CPU Plug-In now supports multiple kernels in one program, and the `__SYCL_PI_DEVICE_BINARY_TARGET_NATIVE_CPU` binary type has been added in order to identify kernels compiled for Native CPU. * clang-offload-wrapper: for Native CPU, the offload-wrapper doesn't bundle the device code in the host module, but instead produces an array containing function declarations that are resolved by the linker, see `sycl/doc/design/SYCLNativeCPU.md` for more information. --------- Co-authored-by: Uwe Dolinsky <[email protected]> Co-authored-by: Alexey Sachkov <[email protected]> Co-authored-by: Steffen Larsen <[email protected]>
1 parent f7b00b7 commit aab5d74

36 files changed

+477
-393
lines changed

clang/include/clang/Basic/SYCLNativeCPUHelpers.h

Lines changed: 0 additions & 7 deletions
This file was deleted.

clang/lib/CodeGen/BackendUtil.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
#include "clang/Basic/CodeGenOptions.h"
1111
#include "clang/Basic/Diagnostic.h"
1212
#include "clang/Basic/LangOptions.h"
13-
#include "clang/Basic/SYCLNativeCPUHelpers.h"
1413
#include "clang/Basic/TargetOptions.h"
1514
#include "clang/Basic/Targets/SPIR.h"
1615
#include "clang/Frontend/FrontendDiagnostic.h"
@@ -47,10 +46,10 @@
4746
#include "llvm/Passes/StandardInstrumentations.h"
4847
#include "llvm/SYCLLowerIR/CompileTimePropertiesPass.h"
4948
#include "llvm/SYCLLowerIR/ESIMD/ESIMDVerifier.h"
50-
#include "llvm/SYCLLowerIR/EmitSYCLNativeCPUHeader.h"
5149
#include "llvm/SYCLLowerIR/LowerWGLocalMemory.h"
5250
#include "llvm/SYCLLowerIR/MutatePrintfAddrspace.h"
5351
#include "llvm/SYCLLowerIR/PrepareSYCLNativeCPU.h"
52+
#include "llvm/SYCLLowerIR/RenameKernelSYCLNativeCPU.h"
5453
#include "llvm/SYCLLowerIR/SYCLAddOptLevelAttribute.h"
5554
#include "llvm/SYCLLowerIR/SYCLPropagateAspectsUsage.h"
5655
#include "llvm/Support/BuryPointer.h"
@@ -108,6 +107,10 @@ extern cl::opt<bool> DebugInfoCorrelate;
108107
static cl::opt<bool> ClSanitizeOnOptimizerEarlyEP(
109108
"sanitizer-early-opt-ep", cl::Optional,
110109
cl::desc("Insert sanitizers on OptimizerEarlyEP."), cl::init(false));
110+
111+
static cl::opt<bool> SYCLNativeCPURename(
112+
"sycl-native-cpu-rename", cl::init(false),
113+
cl::desc("Rename kernel functions for SYCL Native CPU"));
111114
}
112115

113116
namespace {
@@ -1048,6 +1051,8 @@ void EmitAssemblyHelper::RunOptimizationPipeline(
10481051
MPM = PB.buildPerModuleDefaultPipeline(Level);
10491052
}
10501053

1054+
if (SYCLNativeCPURename)
1055+
MPM.addPass(RenameKernelSYCLNativeCPUPass());
10511056
if (LangOpts.SYCLIsDevice) {
10521057
MPM.addPass(SYCLMutatePrintfAddrspacePass());
10531058
if (LangOpts.EnableDAEInSpirKernels)
@@ -1078,8 +1083,6 @@ void EmitAssemblyHelper::RunOptimizationPipeline(
10781083
MPM.addPass(CompileTimePropertiesPass());
10791084

10801085
if (LangOpts.SYCLIsNativeCPU) {
1081-
MPM.addPass(
1082-
EmitSYCLNativeCPUHeaderPass(getNativeCPUHeaderName(LangOpts)));
10831086
MPM.addPass(PrepareSYCLNativeCPUPass());
10841087
}
10851088
}

clang/lib/Driver/Driver.cpp

Lines changed: 35 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1169,23 +1169,19 @@ void Driver::CreateOffloadingDeviceToolChains(Compilation &C,
11691169
checkSingleArgValidity(DeviceCodeSplit,
11701170
{"per_kernel", "per_source", "auto", "off"});
11711171

1172-
bool IsSYCLNativeCPU = isSYCLNativeCPU(C.getInputArgs());
11731172
Arg *SYCLForceTarget =
11741173
getArgRequiringSYCLRuntime(options::OPT_fsycl_force_target_EQ);
11751174
if (SYCLForceTarget) {
11761175
StringRef Val(SYCLForceTarget->getValue());
11771176
llvm::Triple TT(MakeSYCLDeviceTriple(Val));
1178-
// Todo: we skip the check for the valid SYCL target, because currently
1179-
// setting native_cpu as a target overrides all the other targets,
1180-
// re-enable the check once native_cpu can coexist.
1181-
if (!IsSYCLNativeCPU && !isValidSYCLTriple(TT))
1177+
if (!isValidSYCLTriple(TT))
11821178
Diag(clang::diag::err_drv_invalid_sycl_target) << Val;
11831179
}
11841180
bool HasSYCLTargetsOption = SYCLTargets || SYCLLinkTargets || SYCLAddTargets;
11851181

11861182
llvm::StringMap<StringRef> FoundNormalizedTriples;
11871183
llvm::SmallVector<llvm::Triple, 4> UniqueSYCLTriplesVec;
1188-
if (!IsSYCLNativeCPU && HasSYCLTargetsOption) {
1184+
if (HasSYCLTargetsOption) {
11891185
// At this point, we know we have a valid combination
11901186
// of -fsycl*target options passed
11911187
Arg *SYCLTargetsValues = SYCLTargets ? SYCLTargets : SYCLLinkTargets;
@@ -1220,6 +1216,12 @@ void Driver::CreateOffloadingDeviceToolChains(Compilation &C,
12201216
continue;
12211217
}
12221218
UserTargetName = "amdgcn-amd-amdhsa";
1219+
} else if (Val == "native_cpu") {
1220+
const ToolChain *HostTC =
1221+
C.getSingleOffloadToolChain<Action::OFK_Host>();
1222+
llvm::Triple HostTriple = HostTC->getTriple();
1223+
UniqueSYCLTriplesVec.push_back(HostTriple);
1224+
continue;
12231225
}
12241226

12251227
if (!isValidSYCLTriple(MakeSYCLDeviceTriple(UserTargetName))) {
@@ -1287,11 +1289,6 @@ void Driver::CreateOffloadingDeviceToolChains(Compilation &C,
12871289
Diag(clang::diag::warn_drv_empty_joined_argument)
12881290
<< SYCLAddTargets->getAsString(C.getInputArgs());
12891291
}
1290-
} else if (IsSYCLNativeCPU) {
1291-
const ToolChain *HostTC = C.getSingleOffloadToolChain<Action::OFK_Host>();
1292-
llvm::Triple HostTriple = HostTC->getTriple();
1293-
UniqueSYCLTriplesVec.push_back(HostTriple);
1294-
addSYCLDefaultTriple(C, UniqueSYCLTriplesVec);
12951292
} else {
12961293
// If -fsycl is supplied without -fsycl-*targets we will assume SPIR-V
12971294
// unless -fintelfpga is supplied, which uses SPIR-V with fpga AOT.
@@ -5496,6 +5493,9 @@ class OffloadingActionBuilder final {
54965493
bool isSpirvAOT = TT.getSubArch() == llvm::Triple::SPIRSubArch_fpga ||
54975494
TT.getSubArch() == llvm::Triple::SPIRSubArch_gen ||
54985495
TT.getSubArch() == llvm::Triple::SPIRSubArch_x86_64;
5496+
const bool isSYCLNativeCPU =
5497+
TC->getAuxTriple() &&
5498+
driver::isSYCLNativeCPU(TT, *TC->getAuxTriple());
54995499
for (const auto &Input : LI) {
55005500
if (TT.getSubArch() == llvm::Triple::SPIRSubArch_fpga &&
55015501
types::isFPGA(Input->getType())) {
@@ -5717,26 +5717,14 @@ class OffloadingActionBuilder final {
57175717
} else
57185718
FullDeviceLinkAction = FullLinkObject;
57195719

5720-
bool IsSYCLNativeCPU = isSYCLNativeCPU(Args);
5721-
if (IsSYCLNativeCPU) {
5722-
// for SYCL Native CPU, we just take the linked device
5723-
// modules, lower them to an object file , and link it to the host
5724-
// object file.
5725-
auto *backendAct = C.MakeAction<BackendJobAction>(
5726-
FullDeviceLinkAction, types::TY_PP_Asm);
5727-
auto *asmAct =
5728-
C.MakeAction<AssembleJobAction>(backendAct, types::TY_Object);
5729-
DA.add(*asmAct, *TC, BoundArch, Action::OFK_SYCL);
5730-
return;
5731-
}
5732-
57335720
// reflects whether current target is ahead-of-time and can't
57345721
// support runtime setting of specialization constants
5735-
bool isAOT = isNVPTX || isAMDGCN || isSpirvAOT;
5722+
bool isAOT = isNVPTX || isAMDGCN || isSpirvAOT || isSYCLNativeCPU;
57365723

57375724
// post link is not optional - even if not splitting, always need to
57385725
// process specialization constants
5739-
types::ID PostLinkOutType = isSPIR ? types::TY_Tempfiletable
5726+
types::ID PostLinkOutType = isSPIR || isSYCLNativeCPU
5727+
? types::TY_Tempfiletable
57405728
: types::TY_LLVM_BC;
57415729
auto createPostLinkAction = [&]() {
57425730
// For SPIR-V targets, force TY_Tempfiletable.
@@ -5746,6 +5734,20 @@ class OffloadingActionBuilder final {
57465734
return TypedPostLinkAction;
57475735
};
57485736
Action *PostLinkAction = createPostLinkAction();
5737+
if (isSYCLNativeCPU) {
5738+
// for SYCL Native CPU, we just take the linked device
5739+
// modules, lower them to an object file , and link it to the host
5740+
// object file.
5741+
auto *backendAct = C.MakeAction<BackendJobAction>(
5742+
FullDeviceLinkAction, types::TY_PP_Asm);
5743+
auto *asmAct =
5744+
C.MakeAction<AssembleJobAction>(backendAct, types::TY_Object);
5745+
DA.add(*asmAct, *TC, BoundArch, Action::OFK_SYCL);
5746+
auto *DeviceWrappingAction = C.MakeAction<OffloadWrapperJobAction>(
5747+
PostLinkAction, types::TY_Object);
5748+
DA.add(*DeviceWrappingAction, *TC, BoundArch, Action::OFK_SYCL);
5749+
continue;
5750+
}
57495751
if (isNVPTX && Args.hasArg(options::OPT_fsycl_embed_ir)) {
57505752
// When compiling for Nvidia/CUDA devices and the user requested the
57515753
// IR to be embedded in the application (via option), run the output
@@ -6119,17 +6121,8 @@ class OffloadingActionBuilder final {
61196121
bool GpuInitHasErrors = false;
61206122
bool HasSYCLTargetsOption =
61216123
SYCLAddTargets || SYCLTargets || SYCLLinkTargets;
6122-
bool IsSYCLNativeCPU = isSYCLNativeCPU(C.getInputArgs());
61236124

6124-
// check if multiple targets are passed along with native_cpu:
6125-
// currently native_cpu overrides all the other targets, so we emit a
6126-
// warning
6127-
if (IsSYCLNativeCPU) {
6128-
auto *SYCLTargets = Args.getLastArg(options::OPT_fsycl_targets_EQ);
6129-
if (SYCLTargets->getNumValues() > 1)
6130-
C.getDriver().Diag(clang::diag::warn_drv_sycl_native_cpu_and_targets);
6131-
}
6132-
if (!IsSYCLNativeCPU && HasSYCLTargetsOption) {
6125+
if (HasSYCLTargetsOption) {
61336126
if (SYCLTargets || SYCLLinkTargets) {
61346127
Arg *SYCLTargetsValues = SYCLTargets ? SYCLTargets : SYCLLinkTargets;
61356128
// Fill SYCLTripleList
@@ -6163,6 +6156,12 @@ class OffloadingActionBuilder final {
61636156
C.getDriver().MakeSYCLDeviceTriple("amdgcn-amd-amdhsa"),
61646157
ValidDevice->data());
61656158
UserTargetName = "amdgcn-amd-amdhsa";
6159+
} else if (Val == "native_cpu") {
6160+
const ToolChain *HostTC =
6161+
C.getSingleOffloadToolChain<Action::OFK_Host>();
6162+
llvm::Triple TT = HostTC->getTriple();
6163+
SYCLTripleList.push_back(TT);
6164+
continue;
61666165
}
61676166

61686167
llvm::Triple TT(C.getDriver().MakeSYCLDeviceTriple(Val));
@@ -6249,14 +6248,6 @@ class OffloadingActionBuilder final {
62496248
GpuArchList.emplace_back(TT, nullptr);
62506249
}
62516250
}
6252-
} else if (IsSYCLNativeCPU) {
6253-
const ToolChain *HostTC =
6254-
C.getSingleOffloadToolChain<Action::OFK_Host>();
6255-
llvm::Triple TT = HostTC->getTriple();
6256-
auto TCIt = llvm::find_if(
6257-
ToolChains, [&](auto &TC) { return TT == TC->getTriple(); });
6258-
SYCLTripleList.push_back(TT);
6259-
SYCLTargetInfoList.emplace_back(*TCIt, nullptr);
62606251
} else if (HasValidSYCLRuntime) {
62616252
// -fsycl is provided without -fsycl-*targets.
62626253
bool SYCLfpga = C.getInputArgs().hasArg(options::OPT_fintelfpga);

clang/lib/Driver/ToolChains/Clang.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4977,7 +4977,7 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
49774977
bool IsFPGASYCLOffloadDevice =
49784978
IsSYCLOffloadDevice &&
49794979
Triple.getSubArch() == llvm::Triple::SPIRSubArch_fpga;
4980-
bool IsSYCLNativeCPU = isSYCLNativeCPU(Args);
4980+
const bool IsSYCLNativeCPU = isSYCLNativeCPU(TC, C.getDefaultToolChain());
49814981

49824982
// Perform the SYCL host compilation using an external compiler if the user
49834983
// requested.
@@ -5468,6 +5468,10 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
54685468
CmdArgs.push_back("-emit-obj");
54695469
CollectArgsForIntegratedAssembler(C, Args, CmdArgs, D);
54705470
}
5471+
if (IsSYCLOffloadDevice && IsSYCLNativeCPU) {
5472+
CmdArgs.push_back("-mllvm");
5473+
CmdArgs.push_back("-sycl-native-cpu-rename");
5474+
}
54715475

54725476
// Also ignore explicit -force_cpusubtype_ALL option.
54735477
(void)Args.hasArg(options::OPT_force__cpusubtype__ALL);
@@ -9409,6 +9413,10 @@ void OffloadWrapper::ConstructJob(Compilation &C, const JobAction &JA,
94099413
TargetTripleOpt = ("llvm_" + TargetTripleOpt).str();
94109414
}
94119415

9416+
const bool IsSYCLNativeCPU = isSYCLNativeCPU(TC, C.getDefaultToolChain());
9417+
if (IsSYCLNativeCPU) {
9418+
TargetTripleOpt = "native_cpu";
9419+
}
94129420
WrapperArgs.push_back(
94139421
C.getArgs().MakeArgString(Twine("-target=") + TargetTripleOpt));
94149422

clang/lib/Driver/ToolChains/SYCL.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -810,7 +810,7 @@ void SYCL::x86_64::BackendCompiler::ConstructJob(
810810
SYCLToolChain::SYCLToolChain(const Driver &D, const llvm::Triple &Triple,
811811
const ToolChain &HostTC, const ArgList &Args)
812812
: ToolChain(D, Triple, Args), HostTC(HostTC),
813-
IsSYCLNativeCPU(isSYCLNativeCPU(Args)) {
813+
IsSYCLNativeCPU(Triple == HostTC.getTriple()) {
814814
// Lookup binaries into the driver directory, this is used to
815815
// discover the clang-offload-bundler executable.
816816
getProgramPaths().push_back(getDriver().Dir);

clang/lib/Driver/ToolChains/SYCL.h

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,13 +202,13 @@ class LLVM_LIBRARY_VISIBILITY SYCLToolChain : public ToolChain {
202202
llvm::opt::ArgStringList &CC1Args) const override;
203203

204204
const ToolChain &HostTC;
205+
const bool IsSYCLNativeCPU;
205206

206207
protected:
207208
Tool *buildBackendCompiler() const override;
208209
Tool *buildLinker() const override;
209210

210211
private:
211-
bool IsSYCLNativeCPU;
212212
void TranslateGPUTargetOpt(const llvm::opt::ArgList &Args,
213213
llvm::opt::ArgStringList &CmdArgs,
214214
llvm::opt::OptSpecifier Opt_EQ) const;
@@ -223,6 +223,14 @@ template <typename ArgListT> bool isSYCLNativeCPU(const ArgListT &Args) {
223223
}
224224
return false;
225225
}
226+
227+
inline bool isSYCLNativeCPU(const llvm::Triple HostT, const llvm::Triple DevT) {
228+
return HostT == DevT;
229+
}
230+
231+
inline bool isSYCLNativeCPU(const ToolChain &TC1, const ToolChain &TC2) {
232+
return isSYCLNativeCPU(TC1.getTriple(), TC2.getTriple());
233+
}
226234
} // end namespace driver
227235
} // end namespace clang
228236

clang/lib/Sema/SemaSYCL.cpp

Lines changed: 10 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
#include "clang/Basic/Attributes.h"
2121
#include "clang/Basic/Builtins.h"
2222
#include "clang/Basic/Diagnostic.h"
23-
#include "clang/Basic/SYCLNativeCPUHelpers.h"
2423
#include "clang/Basic/Version.h"
2524
#include "clang/Sema/Initialization.h"
2625
#include "clang/Sema/Sema.h"
@@ -1028,15 +1027,6 @@ static QualType calculateKernelNameType(ASTContext &Ctx,
10281027
return TAL->get(0).getAsType().getCanonicalType();
10291028
}
10301029

1031-
// Kernel names are currently mangled as type names which
1032-
// may collide (in the IR) with the "real" type names generated
1033-
// for RTTI etc when compiling host and device code together.
1034-
// Therefore the mangling of the kernel function is changed for
1035-
// NativeCPU to avoid such potential collision.
1036-
static void changeManglingForNativeCPU(std::string &Name) {
1037-
Name.append("_NativeCPUKernel");
1038-
}
1039-
10401030
// Gets a name for the OpenCL kernel function, calculated from the first
10411031
// template argument of the kernel caller function.
10421032
static std::pair<std::string, std::string>
@@ -1054,12 +1044,18 @@ constructKernelName(Sema &S, const FunctionDecl *KernelCallerFunc,
10541044
std::string StableName =
10551045
SYCLUniqueStableNameExpr::ComputeName(S.getASTContext(), KernelNameType);
10561046

1057-
// When compiling for the SYCLNativeCPU device we need a C++ identifier
1058-
// as the kernel name and cannot use the name produced by some manglers
1059-
// including the MS mangler.
1047+
// For NativeCPU the kernel name is set to the stable GNU-mangled name
1048+
// because the default mangling may be different, for example on Windows.
1049+
// This is needed for compiling kernels for multiple SYCL targets to ensure
1050+
// the same kernel name can be used for kernel lookup in different target
1051+
// binaries. This assumes that all SYCL targets use the same mangling
1052+
// produced for the stable name.
1053+
// Todo: Check if this assumption is valid, and if it would be better
1054+
// instead to always compile the NativeCPU device code in GNU mode which
1055+
// may cause issues when compiling headers with non-standard extensions
1056+
// written for compilers with different C++ ABIs (like MS VS).
10601057
if (S.getLangOpts().SYCLIsNativeCPU) {
10611058
MangledName = StableName;
1062-
changeManglingForNativeCPU(MangledName);
10631059
}
10641060

10651061
return {MangledName, StableName};
@@ -5682,16 +5678,6 @@ bool SYCLIntegrationFooter::emit(raw_ostream &OS) {
56825678
}
56835679
}
56845680

5685-
if (S.getLangOpts().SYCLIsNativeCPU) {
5686-
// This is a temporary workaround for the integration header file
5687-
// being emitted too early.
5688-
std::string HCName = getNativeCPUHeaderName(S.getLangOpts());
5689-
5690-
OS << "\n// including the kernel handlers calling the kernels\n";
5691-
OS << "\n#include \"";
5692-
OS << HCName;
5693-
OS << "\"\n\n";
5694-
}
56955681
if (EmittedFirstSpecConstant)
56965682
OS << "#include <sycl/detail/spec_const_integration.hpp>\n";
56975683

clang/test/CodeGenSYCL/native_cpu_basic.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ void gen() {
5050
}
5151

5252
// Check name mangling
53-
// CHECK-DAG: @_ZTS6init_aIiE_NativeCPUKernel_NativeCPUKernel({{.*}})
54-
// CHECK-DAG: @_ZTS6init_aIfE_NativeCPUKernel_NativeCPUKernel({{.*}})
53+
// CHECK-DAG: @_ZTS6init_aIiE.NativeCPUKernel({{.*}})
54+
// CHECK-DAG: @_ZTS6init_aIfE.NativeCPUKernel({{.*}})
5555

5656
// Check Native CPU module flag
5757
// CHECK-DAG: !{{[0-9]*}} = !{i32 1, !"is-native-cpu", i32 1}

clang/test/Driver/sycl-native-cpu-fsycl.cpp

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,20 @@
1919
//CHECK_ACTIONS:| +- 11: linker, {5}, ir, (device-sycl)
2020
//CHECK_ACTIONS:| +- 12: backend, {11}, assembler, (device-sycl)
2121
//CHECK_ACTIONS:|- 13: assembler, {12}, object, (device-sycl)
22-
//CHECK_ACTIONS:14: offload, "host-sycl ({{.*}})" {10}, "device-sycl ({{.*}})" {13}, image
22+
//call sycl-post-link and clang-offload-wrapper
23+
//CHECK_ACTIONS:| +- 14: sycl-post-link, {11}, tempfiletable, (device-sycl)
24+
//CHECK_ACTIONS:|- 15: clang-offload-wrapper, {14}, object, (device-sycl)
25+
//CHECK_ACTIONS:16: offload, "host-sycl ({{.*}})" {10}, "device-sycl ({{.*}})" {13}, "device-sycl ({{.*}})" {15}, image
2326

2427

2528
//CHECK_BINDINGS:# "{{.*}}" - "clang", inputs: ["{{.*}}sycl-native-cpu-fsycl.cpp"], output: "[[KERNELIR:.*]].bc"
2629
//CHECK_BINDINGS:# "{{.*}}" - "SYCL::Linker", inputs: ["[[KERNELIR]].bc"], output: "[[KERNELLINK:.*]].bc"
2730
//CHECK_BINDINGS:# "{{.*}}" - "clang", inputs: ["[[KERNELLINK]].bc"], output: "[[KERNELOBJ:.*]].o"
31+
//CHECK_BINDINGS:# "{{.*}}" - "SYCL post link", inputs: ["[[KERNELLINK]].bc"], output: "[[TABLEFILE:.*]].table"
32+
//CHECK_BINDINGS:# "{{.*}}" - "offload wrapper", inputs: ["[[TABLEFILE]].table"], output: "[[WRAPPEROBJ:.*]].o"
2833
//CHECK_BINDINGS:# "{{.*}}" - "Append Footer to source", inputs: ["{{.*}}sycl-native-cpu-fsycl.cpp"], output: "[[SRCWFOOTER:.*]].cpp"
2934
//CHECK_BINDINGS:# "{{.*}}" - "clang", inputs: ["[[SRCWFOOTER]].cpp", "[[KERNELIR]].bc"], output: "[[HOSTOBJ:.*]].o"
30-
//CHECK_BINDINGS:# "{{.*}}" - "{{.*}}::Linker", inputs: ["[[HOSTOBJ]].o", "[[KERNELOBJ]].o"], output: "a.{{.*}}"
35+
//CHECK_BINDINGS:# "{{.*}}" - "{{.*}}::Linker", inputs: ["[[HOSTOBJ]].o", "[[KERNELOBJ]].o", "[[WRAPPEROBJ]].o"], output: "a.{{.*}}"
3136

3237
//CHECK_INVO:{{.*}}clang{{.*}}-fsycl-is-device{{.*}}"-fsycl-is-native-cpu" "-D" "__SYCL_NATIVE_CPU__"
3338
//CHECK_INVO:{{.*}}clang{{.*}}"-x" "ir"
@@ -48,4 +53,6 @@
4853
//CHECK_ACTIONS-AARCH64:| +- 11: linker, {5}, ir, (device-sycl)
4954
//CHECK_ACTIONS-AARCH64:| +- 12: backend, {11}, assembler, (device-sycl)
5055
//CHECK_ACTIONS-AARCH64:|- 13: assembler, {12}, object, (device-sycl)
51-
//CHECK_ACTIONS-AARCH64:14: offload, "host-sycl (aarch64-unknown-linux-gnu)" {10}, "device-sycl (aarch64-unknown-linux-gnu)" {13}, image
56+
//CHECK_ACTIONS-AARCH64:| +- 14: sycl-post-link, {11}, tempfiletable, (device-sycl)
57+
//CHECK_ACTIONS-AARCH64:|- 15: clang-offload-wrapper, {14}, object, (device-sycl)
58+
//CHECK_ACTIONS-AARCH64:16: offload, "host-sycl (aarch64-unknown-linux-gnu)" {10}, "device-sycl (aarch64-unknown-linux-gnu)" {13}, "device-sycl (aarch64-unknown-linux-gnu)" {15}, image

clang/test/Driver/sycl-native-cpu-warn.cpp

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)