@@ -5048,7 +5048,7 @@ class OffloadingActionBuilder final {
5048
5048
SYCLDeviceActions.clear ();
5049
5049
5050
5050
if (WrapDeviceOnlyBinary)
5051
- return ABRT_Success ;
5051
+ return ABRT_Ignore_Host ;
5052
5052
auto *Link =
5053
5053
C.MakeAction <LinkJobAction>(SYCLLinkBinaryList, types::TY_Image);
5054
5054
SYCLLinkBinary =
@@ -6747,9 +6747,8 @@ class OffloadingActionBuilder final {
6747
6747
return false ;
6748
6748
if (HasFPGATarget && !updateInputForFPGA (A, InputArg, Args))
6749
6749
return false ;
6750
- // FIXME - unbundling action is being split into two different actions
6751
- // when unbundling objects. One action for the host, the other for the
6752
- // device.
6750
+ // FIXME - unbundling action with -fsycl-link is unbundling for both host
6751
+ // and device, where only the device is needed.
6753
6752
auto UnbundlingHostAction = C.MakeAction <OffloadUnbundlingJobAction>(
6754
6753
A, (HasSPIRTarget && HostAction->getType () == types::TY_Archive)
6755
6754
? types::TY_Tempfilelist
@@ -7323,7 +7322,6 @@ void Driver::BuildActions(Compilation &C, DerivedArgList &Args,
7323
7322
ExtractAPIJobAction *ExtractAPIAction = nullptr ;
7324
7323
ActionList LinkerInputs;
7325
7324
ActionList MergerInputs;
7326
- ActionList DeviceAOTLinkerInputs;
7327
7325
ActionList HostActions;
7328
7326
llvm::SmallVector<const Arg *, 6 > LinkerInputArgs;
7329
7327
llvm::SmallVector<phases::ID, phases::MaxNumberOfPhases> PL;
@@ -7360,17 +7358,6 @@ void Driver::BuildActions(Compilation &C, DerivedArgList &Args,
7360
7358
if (Phase == phases::Link) {
7361
7359
assert (Phase == PL.back () && " linking must be final compilation step." );
7362
7360
7363
- // When performing -fsycl-link the current inputs are not expected to
7364
- // be passed to the final host link step. Instead, take these inputs
7365
- // and redirect them to the associated wrapping step to create the
7366
- // final object.
7367
- if (C.getInputArgs ().hasArg (options::OPT_fsycl_link_EQ) &&
7368
- !Args.hasArg (options::OPT_fintelfpga)) {
7369
- DeviceAOTLinkerInputs.push_back (Current);
7370
- Current = nullptr ;
7371
- break ;
7372
- }
7373
-
7374
7361
// We don't need to generate additional link commands if emitting AMD
7375
7362
// bitcode or compiling only for the offload device
7376
7363
if (!(C.getInputArgs ().hasArg (options::OPT_hip_link) &&
@@ -7516,11 +7503,7 @@ void Driver::BuildActions(Compilation &C, DerivedArgList &Args,
7516
7503
if (!UseNewOffloadingDriver &&
7517
7504
getFinalPhase (Args, &FinalPhaseArg) == phases::Link &&
7518
7505
!Args.hasArg (options::OPT_fsycl_link_targets_EQ)) {
7519
- if (LinkerInputs.empty () && DeviceAOTLinkerInputs.empty ())
7520
- OffloadBuilder->appendDeviceLinkActions (Actions);
7521
-
7522
- if (!DeviceAOTLinkerInputs.empty () &&
7523
- Args.hasArg (options::OPT_fsycl_link_EQ) &&
7506
+ if (Args.hasArg (options::OPT_fsycl_link_EQ) &&
7524
7507
!Args.hasArg (options::OPT_fintelfpga)) {
7525
7508
ActionList LAList;
7526
7509
OffloadBuilder->makeHostLinkDeviceOnlyAction (LAList);
@@ -7529,7 +7512,8 @@ void Driver::BuildActions(Compilation &C, DerivedArgList &Args,
7529
7512
LA = OffloadBuilder->processHostLinkAction (LA);
7530
7513
Actions.push_back (LA);
7531
7514
}
7532
- }
7515
+ } else if (LinkerInputs.empty ())
7516
+ OffloadBuilder->appendDeviceLinkActions (Actions);
7533
7517
}
7534
7518
7535
7519
if (!LinkerInputs.empty ()) {
@@ -9017,6 +9001,7 @@ InputInfoList Driver::BuildJobsForActionNoCache(
9017
9001
InputInfo CurI;
9018
9002
bool IsFPGAObjLink =
9019
9003
(JA->getType () == types::TY_Object &&
9004
+ EffectiveTriple.getSubArch () == llvm::Triple::SPIRSubArch_fpga &&
9020
9005
C.getInputArgs ().hasArg (options::OPT_fsycl_link_EQ));
9021
9006
if (C.getDriver ().getOffloadStaticLibSeen () &&
9022
9007
(JA->getType () == types::TY_Archive ||
0 commit comments