@@ -1077,8 +1077,8 @@ void Driver::CreateOffloadingDeviceToolChains(Compilation &C,
1077
1077
// SYCL
1078
1078
//
1079
1079
// We need to generate a SYCL toolchain if the user specified targets with
1080
- // the -fsycl-targets, -fsycl-add-targets or -fsycl-link-targets option.
1081
- // If -fsycl is supplied without any of these we will assume SPIR-V.
1080
+ // the -fsycl-targets. If -fsycl is supplied without any of these we will
1081
+ // assume SPIR-V.
1082
1082
// Use of -fsycl-device-only overrides -fsycl.
1083
1083
bool HasValidSYCLRuntime =
1084
1084
C.getInputArgs ().hasFlag (options::OPT_fsycl, options::OPT_fno_sycl,
@@ -1106,10 +1106,6 @@ void Driver::CreateOffloadingDeviceToolChains(Compilation &C,
1106
1106
};
1107
1107
1108
1108
Arg *SYCLTargets = getArgRequiringSYCLRuntime (options::OPT_fsycl_targets_EQ);
1109
- Arg *SYCLLinkTargets =
1110
- getArgRequiringSYCLRuntime (options::OPT_fsycl_link_targets_EQ);
1111
- Arg *SYCLAddTargets =
1112
- getArgRequiringSYCLRuntime (options::OPT_fsycl_add_targets_EQ);
1113
1109
Arg *SYCLLink = getArgRequiringSYCLRuntime (options::OPT_fsycl_link_EQ);
1114
1110
1115
1111
// Check if -fsycl-host-compiler is used in conjunction with -fsycl.
@@ -1118,18 +1114,6 @@ void Driver::CreateOffloadingDeviceToolChains(Compilation &C,
1118
1114
Arg *SYCLHostCompilerOptions =
1119
1115
getArgRequiringSYCLRuntime (options::OPT_fsycl_host_compiler_options_EQ);
1120
1116
1121
- // -fsycl-targets cannot be used with -fsycl-link-targets
1122
- if (SYCLTargets && SYCLLinkTargets)
1123
- Diag (clang::diag::err_drv_option_conflict)
1124
- << SYCLTargets->getSpelling () << SYCLLinkTargets->getSpelling ();
1125
- // -fsycl-link-targets and -fsycl-add-targets cannot be used together
1126
- if (SYCLLinkTargets && SYCLAddTargets)
1127
- Diag (clang::diag::err_drv_option_conflict)
1128
- << SYCLLinkTargets->getSpelling () << SYCLAddTargets->getSpelling ();
1129
- // -fsycl-link-targets is not allowed with -fsycl-link
1130
- if (SYCLLinkTargets && SYCLLink)
1131
- Diag (clang::diag::err_drv_option_conflict)
1132
- << SYCLLink->getSpelling () << SYCLLinkTargets->getSpelling ();
1133
1117
// -fsycl-targets cannot be used with -fintelfpga
1134
1118
if (SYCLTargets && SYCLfpga)
1135
1119
Diag (clang::diag::err_drv_option_conflict)
@@ -1188,14 +1172,14 @@ void Driver::CreateOffloadingDeviceToolChains(Compilation &C,
1188
1172
if (!isValidSYCLTriple (TT))
1189
1173
Diag (clang::diag::err_drv_invalid_sycl_target) << Val;
1190
1174
}
1191
- bool HasSYCLTargetsOption = SYCLTargets || SYCLLinkTargets || SYCLAddTargets ;
1175
+ bool HasSYCLTargetsOption = SYCLTargets;
1192
1176
1193
1177
llvm::StringMap<StringRef> FoundNormalizedTriples;
1194
1178
llvm::SmallVector<llvm::Triple, 4 > UniqueSYCLTriplesVec;
1195
1179
if (HasSYCLTargetsOption) {
1196
1180
// At this point, we know we have a valid combination
1197
1181
// of -fsycl*target options passed
1198
- Arg *SYCLTargetsValues = SYCLTargets ? SYCLTargets : SYCLLinkTargets ;
1182
+ Arg *SYCLTargetsValues = SYCLTargets;
1199
1183
if (SYCLTargetsValues) {
1200
1184
if (SYCLTargetsValues->getNumValues ()) {
1201
1185
@@ -1259,47 +1243,6 @@ void Driver::CreateOffloadingDeviceToolChains(Compilation &C,
1259
1243
Diag (clang::diag::warn_drv_empty_joined_argument)
1260
1244
<< SYCLTargetsValues->getAsString (C.getInputArgs ());
1261
1245
}
1262
- // -fsycl-add-targets is a list of paired items (Triple and file) which are
1263
- // gathered and used to be linked into the final device binary. This can
1264
- // be used with -fsycl-targets to put together the final conglomerate binary
1265
- if (SYCLAddTargets) {
1266
- if (SYCLAddTargets->getNumValues ()) {
1267
- // Use of -fsycl-add-targets adds additional files to the SYCL device
1268
- // link step. Regular offload processing occurs below
1269
- for (StringRef Val : SYCLAddTargets->getValues ()) {
1270
- // Parse out the Triple and Input (triple:binary) and create a
1271
- // ToolChain for each entry.
1272
- // The expected format is 'triple:file', any other format will
1273
- // not be accepted.
1274
- std::pair<StringRef, StringRef> I = Val.split (' :' );
1275
- if (!I.first .empty () && !I.second .empty ()) {
1276
- llvm::Triple TT (I.first );
1277
- if (!isValidSYCLTriple (TT)) {
1278
- Diag (clang::diag::err_drv_invalid_sycl_target) << I.first ;
1279
- continue ;
1280
- }
1281
- std::string NormalizedName = TT.normalize ();
1282
-
1283
- // Make sure we don't have a duplicate triple.
1284
- auto Duplicate = FoundNormalizedTriples.find (NormalizedName);
1285
- if (Duplicate != FoundNormalizedTriples.end ())
1286
- // The toolchain for this triple was already created
1287
- continue ;
1288
-
1289
- // Store the current triple so that we can check for duplicates in
1290
- // the following iterations.
1291
- FoundNormalizedTriples[NormalizedName] = Val;
1292
- UniqueSYCLTriplesVec.push_back (TT);
1293
- } else {
1294
- // No colon found, do not use the input
1295
- C.getDriver ().Diag (diag::err_drv_unsupported_option_argument)
1296
- << SYCLAddTargets->getSpelling () << Val;
1297
- }
1298
- }
1299
- } else
1300
- Diag (clang::diag::warn_drv_empty_joined_argument)
1301
- << SYCLAddTargets->getAsString (C.getInputArgs ());
1302
- }
1303
1246
} else {
1304
1247
// If -fsycl is supplied without -fsycl-*targets we will assume SPIR-V
1305
1248
// unless -fintelfpga is supplied, which uses SPIR-V with fpga AOT.
@@ -5040,9 +4983,6 @@ class OffloadingActionBuilder final {
5040
4983
ExternalCudaAction = nullptr ;
5041
4984
}
5042
4985
5043
- // With -fsycl-link-targets, we will take the unbundled binaries
5044
- // for each device and link them together to a single binary that will
5045
- // be used in a split compilation step.
5046
4986
if (CompileDeviceOnly && !SYCLDeviceActions.empty ()) {
5047
4987
for (auto SDA : SYCLDeviceActions)
5048
4988
SYCLLinkBinaryList.push_back (SDA);
@@ -6369,8 +6309,6 @@ class OffloadingActionBuilder final {
6369
6309
if (ToolChains.empty ())
6370
6310
return false ;
6371
6311
6372
- Arg *SYCLLinkTargets =
6373
- Args.getLastArg (options::OPT_fsycl_link_targets_EQ);
6374
6312
auto *DeviceCodeSplitArg =
6375
6313
Args.getLastArg (options::OPT_fsycl_device_code_split_EQ);
6376
6314
// -fsycl-device-code-split is an alias to
@@ -6380,24 +6318,22 @@ class OffloadingActionBuilder final {
6380
6318
// Gather information about the SYCL Ahead of Time targets. The targets
6381
6319
// are determined on the SubArch values passed along in the triple.
6382
6320
Arg *SYCLTargets =
6383
- C.getInputArgs ().getLastArg (options::OPT_fsycl_targets_EQ);
6384
- Arg *SYCLAddTargets = Args.getLastArg (options::OPT_fsycl_add_targets_EQ);
6321
+ C.getInputArgs ().getLastArg (options::OPT_fsycl_targets_EQ);
6385
6322
Arg *SYCLfpga = C.getInputArgs ().getLastArg (options::OPT_fintelfpga);
6386
6323
bool HasValidSYCLRuntime = C.getInputArgs ().hasFlag (
6387
6324
options::OPT_fsycl, options::OPT_fno_sycl, false );
6388
6325
bool SYCLfpgaTriple = false ;
6389
6326
bool ShouldAddDefaultTriple = true ;
6390
6327
bool GpuInitHasErrors = false ;
6391
- bool HasSYCLTargetsOption =
6392
- SYCLAddTargets || SYCLTargets || SYCLLinkTargets;
6328
+ bool HasSYCLTargetsOption = SYCLTargets;
6393
6329
6394
6330
// Make -fintelfpga flag imply -fsycl.
6395
6331
if (SYCLfpga && !HasValidSYCLRuntime)
6396
6332
HasValidSYCLRuntime = true ;
6397
6333
6398
6334
if (HasSYCLTargetsOption) {
6399
- if (SYCLTargets || SYCLLinkTargets ) {
6400
- Arg *SYCLTargetsValues = SYCLTargets ? SYCLTargets : SYCLLinkTargets ;
6335
+ if (SYCLTargets) {
6336
+ Arg *SYCLTargetsValues = SYCLTargets;
6401
6337
// Fill SYCLTripleList
6402
6338
llvm::StringMap<StringRef> FoundNormalizedTriples;
6403
6339
for (StringRef Val : SYCLTargetsValues->getValues ()) {
@@ -6498,29 +6434,6 @@ class OffloadingActionBuilder final {
6498
6434
}
6499
6435
}
6500
6436
}
6501
- if (SYCLAddTargets) {
6502
- for (StringRef Val : SYCLAddTargets->getValues ()) {
6503
- // Parse out the Triple and Input (triple:binary). At this point,
6504
- // the format has already been validated at the Driver level.
6505
- // Populate the pairs. Each of these will be wrapped and fed
6506
- // into the final binary.
6507
- std::pair<StringRef, StringRef> I = Val.split (' :' );
6508
- llvm::Triple TT (I.first );
6509
-
6510
- auto TCIt = llvm::find_if (
6511
- ToolChains, [&](auto &TC) { return TT == TC->getTriple (); });
6512
- assert (TCIt != ToolChains.end () &&
6513
- " Toolchain was not created for this platform" );
6514
-
6515
- const char *TF = C.getArgs ().MakeArgString (I.second );
6516
- // populate the AOT binary inputs vector.
6517
- SYCLAOTInputs.push_back (std::make_pair (TT, TF));
6518
- ShouldAddDefaultTriple = false ;
6519
- // Add an empty entry to the Device list
6520
- if (TT.getSubArch () == llvm::Triple::SPIRSubArch_gen)
6521
- GpuArchList.emplace_back (TT, nullptr );
6522
- }
6523
- }
6524
6437
} else if (HasValidSYCLRuntime) {
6525
6438
// -fsycl is provided without -fsycl-*targets.
6526
6439
bool SYCLfpga = C.getInputArgs ().hasArg (options::OPT_fintelfpga);
@@ -6540,9 +6453,8 @@ class OffloadingActionBuilder final {
6540
6453
6541
6454
WrapDeviceOnlyBinary =
6542
6455
Args.hasArg (options::OPT_fsycl_link_EQ) && !SYCLfpgaTriple;
6543
- // Device only compilation for -fsycl-link (no FPGA) and
6544
- // -fsycl-link-targets
6545
- CompileDeviceOnly = (SYCLLinkTargets || WrapDeviceOnlyBinary);
6456
+ // Device only compilation for -fsycl-link (no FPGA)
6457
+ CompileDeviceOnly = WrapDeviceOnlyBinary;
6546
6458
6547
6459
// Set the FPGA output type based on command line (-fsycl-link).
6548
6460
if (auto *A = C.getInputArgs ().getLastArg (options::OPT_fsycl_link_EQ)) {
@@ -7599,12 +7511,9 @@ void Driver::BuildActions(Compilation &C, DerivedArgList &Args,
7599
7511
}
7600
7512
7601
7513
// Add a link action if necessary.
7602
- // When offloading with -fsycl-link-targets, no link action is processed
7603
- // as we stop at the spirv-translation step.
7604
7514
Arg *FinalPhaseArg;
7605
7515
if (!UseNewOffloadingDriver &&
7606
- getFinalPhase (Args, &FinalPhaseArg) == phases::Link &&
7607
- !Args.hasArg (options::OPT_fsycl_link_targets_EQ)) {
7516
+ getFinalPhase (Args, &FinalPhaseArg) == phases::Link) {
7608
7517
if (Args.hasArg (options::OPT_fsycl_link_EQ) &&
7609
7518
!Args.hasArg (options::OPT_fintelfpga)) {
7610
7519
ActionList LAList;
@@ -9296,12 +9205,10 @@ InputInfoList Driver::BuildJobsForActionNoCache(
9296
9205
Result = {InputInfo (A, BaseInput)};
9297
9206
else {
9298
9207
std::string OffloadingPrefix;
9299
- // When generating binaries with -fsycl-link-target or -fsycl-link, the
9300
- // output file prefix is the triple arch only. Do not add the arch when
9301
- // compiling for host.
9208
+ // When generating binaries with -fsycl-link, the output file prefix is the
9209
+ // triple arch only. Do not add the arch when compiling for host.
9302
9210
if (!A->getOffloadingHostActiveKinds () &&
9303
- (Args.getLastArg (options::OPT_fsycl_link_targets_EQ) ||
9304
- Args.hasArg (options::OPT_fsycl_link_EQ))) {
9211
+ Args.hasArg (options::OPT_fsycl_link_EQ)) {
9305
9212
OffloadingPrefix = " -" ;
9306
9213
OffloadingPrefix += TC->getTriple ().getArchName ();
9307
9214
} else {
0 commit comments