@@ -9905,26 +9905,6 @@ void OffloadBundler::ConstructJob(Compilation &C, const JobAction &JA,
9905
9905
const ToolChain *CurTC = &getToolChain ();
9906
9906
const Action *CurDep = JA.getInputs ()[I];
9907
9907
9908
- // Special handling for FPGA AOC[RX] binaries that are bundled prior to
9909
- // being added to the generated archive.
9910
- llvm::Triple Triple = CurTC->getTriple ();
9911
- bool IsFPGA = Triple.isSPIR () &&
9912
- Triple.getSubArch () == llvm::Triple::SPIRSubArch_fpga;
9913
- Arg *A = TCArgs.getLastArg (options::OPT_fsycl_link_EQ);
9914
- if (A && IsFPGA) {
9915
- bool IsFPGAImage = false ;
9916
- IsFPGAImage = A->getValue () == StringRef (" image" );
9917
- if (Inputs.size () == 1 ) {
9918
- Triples += Action::GetOffloadKindName (CurKind);
9919
- Triples += " -fpga_" ;
9920
- Triples += IsFPGAImage ? " aocx" : " aocr" ;
9921
- if (!IsFPGAImage && !C.getDriver ().IsFPGAHWMode ())
9922
- Triples += " _emu" ;
9923
- Triples += " -intel-unknown" ;
9924
- continue ;
9925
- }
9926
- }
9927
-
9928
9908
if (const auto *OA = dyn_cast<OffloadAction>(CurDep)) {
9929
9909
CurTC = nullptr ;
9930
9910
OA->doOnEachDependence ([&](Action *A, const ToolChain *TC, const char *) {
@@ -10073,112 +10053,43 @@ void OffloadBundler::ConstructJobMultipleOutputs(
10073
10053
const char *InputFileName = Input.getFilename ();
10074
10054
types::ID InputType (Input.getType ());
10075
10055
bool IsFPGADepUnbundle = JA.getType () == types::TY_FPGA_Dependencies;
10076
- bool IsFPGADepLibUnbundle = JA.getType () == types::TY_FPGA_Dependencies_List;
10077
10056
InputInfoList ForeachInputs;
10078
10057
if (InputType == types::TY_Tempfilelist)
10079
10058
ForeachInputs.push_back (Input);
10080
-
10081
- if (InputType == types::TY_FPGA_AOCX || InputType == types::TY_FPGA_AOCR ||
10082
- InputType == types::TY_FPGA_AOCR_EMU) {
10083
- // Override type with AOCX/AOCR which will unbundle to a list containing
10084
- // binaries with the appropriate extension (.aocx/.aocr)
10085
- // TODO - representation of the output file from the unbundle for these
10086
- // types (aocx/aocr) are always list files. We should represent this
10087
- // better in the output extension and type for improved understanding
10088
- // of file contents and debuggability.
10089
- TypeArg = (InputType == types::TY_FPGA_AOCX) ? " aocx" : " aocr" ;
10090
- // When the output is a Tempfilelist, we know we are unbundling
10091
- // the .bc files from the archive.
10092
- if (!getToolChain ().getTriple ().isSPIROrSPIRV () ||
10093
- JA.getType () == types::TY_Tempfilelist)
10094
- TypeArg = " aoo" ;
10095
- }
10096
- if (InputType == types::TY_FPGA_AOCO || IsFPGADepLibUnbundle)
10097
- TypeArg = " aoo" ;
10098
10059
if (IsFPGADepUnbundle)
10099
10060
TypeArg = " o" ;
10100
10061
10101
10062
bool HasSPIRTarget = false ;
10102
- bool HasFPGATarget = false ;
10103
10063
auto SYCLTCRange = C.getOffloadToolChains <Action::OFK_SYCL>();
10104
10064
for (auto TI = SYCLTCRange.first , TE = SYCLTCRange.second ; TI != TE; ++TI) {
10105
10065
llvm::Triple TT (TI->second ->getTriple ());
10106
- if (TT.isSPIROrSPIRV ()) {
10066
+ if (TT.isSPIROrSPIRV ())
10107
10067
HasSPIRTarget = true ;
10108
- if (TT.getSubArch () == llvm::Triple::SPIRSubArch_fpga)
10109
- HasFPGATarget = true ;
10110
- }
10111
10068
}
10112
10069
if (InputType == types::TY_Archive && HasSPIRTarget)
10113
10070
TypeArg = " aoo" ;
10114
10071
10115
10072
// Get the type.
10116
10073
CmdArgs.push_back (TCArgs.MakeArgString (Twine (" -type=" ) + TypeArg));
10117
10074
10118
- // For FPGA Archives that contain AOCO in them, we only want to unbundle
10119
- // the objects from the archive that do not have AOCO associated in that
10120
- // specific object. Only do this when in hardware mode.
10121
- if (InputType == types::TY_Archive && HasFPGATarget && !IsFPGADepUnbundle &&
10122
- !IsFPGADepLibUnbundle && C.getDriver ().IsFPGAHWMode ()) {
10123
- llvm::Triple TT;
10124
- TT.setArchName (types::getTypeName (types::TY_FPGA_AOCO));
10125
- TT.setVendorName (" intel" );
10126
- TT.setOS (getToolChain ().getTriple ().getOS ());
10127
- SmallString<128 > ExcludedTargets (" -excluded-targets=" );
10128
- ExcludedTargets += " sycl-" ;
10129
- ExcludedTargets += TT.normalize ();
10130
- CmdArgs.push_back (TCArgs.MakeArgString (ExcludedTargets));
10131
- }
10132
-
10133
10075
// Get the targets.
10134
10076
SmallString<128 > Triples;
10135
10077
Triples += " -targets=" ;
10136
10078
auto DepInfo = UA.getDependentActionsInfo ();
10137
10079
for (unsigned I = 0 , J = 0 ; I < DepInfo.size (); ++I) {
10138
10080
auto &Dep = DepInfo[I];
10139
- // FPGA device triples are 'transformed' for the bundler when creating
10140
- // aocx or aocr type bundles. Also, we only do a specific target
10141
- // unbundling, skipping the host side or device side.
10142
- if (types::isFPGA (InputType) || InputType == types::TY_Tempfilelist) {
10081
+ // We only do a specific target unbundling, skipping the host side or
10082
+ // device side.
10083
+ if (InputType == types::TY_Tempfilelist) {
10143
10084
if (getToolChain ().getTriple ().isSPIROrSPIRV ()) {
10144
- if (Dep.DependentToolChain ->getTriple ().getSubArch () ==
10145
- llvm::Triple::SPIRSubArch_fpga) {
10146
- StringRef TypeName (types::getTypeName (InputType));
10147
- types::ID Type = UA.getDependentType ();
10148
- if (InputType == types::TY_Tempfilelist && Type != types::TY_Nothing)
10149
- TypeName = types::getTypeName (Type);
10150
- if (J++)
10151
- Triples += ' ,' ;
10152
- llvm::Triple TT;
10153
- TT.setArchName (TypeName);
10154
- TT.setVendorName (" intel" );
10155
- TT.setOS (getToolChain ().getTriple ().getOS ());
10156
- if ((InputType == types::TY_FPGA_AOCX ||
10157
- InputType == types::TY_FPGA_AOCR ||
10158
- InputType == types::TY_FPGA_AOCR_EMU) &&
10159
- JA.getType () == types::TY_Tempfilelist)
10160
- // AOCX device and AOCR bc info is bundled in the host kind
10161
- Triples += " host-" ;
10162
- else
10163
- // AOCR device is bundled in the sycl kind
10164
- Triples += " sycl-" ;
10165
- Triples += TT.normalize ();
10166
- continue ;
10167
- } else if (Dep.DependentOffloadKind == Action::OFK_Host) {
10168
- // No host unbundle for FPGA binaries.
10085
+ if (Dep.DependentOffloadKind == Action::OFK_Host)
10169
10086
continue ;
10170
- }
10171
10087
} else if (Dep.DependentOffloadKind == Action::OFK_SYCL)
10172
10088
continue ;
10173
- } else if (InputType == types::TY_Archive ||
10174
- (getToolChain ().getTriple ().getSubArch () ==
10175
- llvm::Triple::SPIRSubArch_fpga &&
10176
- TCArgs.hasArg (options::OPT_fsycl_link_EQ))) {
10089
+ } else if (InputType == types::TY_Archive) {
10177
10090
// Do not extract host part if we are unbundling archive on Windows
10178
10091
// because it is not needed. Static offload libraries are added to the
10179
- // host link command just as normal libraries. Do not extract the host
10180
- // part from FPGA -fsycl-link unbundles either, as the full obj
10181
- // is used in the final link
10092
+ // host link command just as normal libraries.
10182
10093
if (Dep.DependentOffloadKind == Action::OFK_Host)
10183
10094
continue ;
10184
10095
}
@@ -10231,7 +10142,7 @@ void OffloadBundler::ConstructJobMultipleOutputs(
10231
10142
Triples += GPUArchName.str ();
10232
10143
}
10233
10144
}
10234
- if (IsFPGADepUnbundle || IsFPGADepLibUnbundle ) {
10145
+ if (IsFPGADepUnbundle) {
10235
10146
// TODO - We are currently using the target triple inputs to slot a location
10236
10147
// of the dependency information into the bundle. It would be good to
10237
10148
// separate this out to an explicit option in the bundler for the dependency
@@ -10259,7 +10170,7 @@ void OffloadBundler::ConstructJobMultipleOutputs(
10259
10170
// When dealing with -fintelfpga, there is an additional unbundle step
10260
10171
// that occurs for the dependency file. In that case, do not use the
10261
10172
// dependent information, but just the output file.
10262
- if (IsFPGADepUnbundle || IsFPGADepLibUnbundle ) {
10173
+ if (IsFPGADepUnbundle) {
10263
10174
SmallString<128 > UB;
10264
10175
UB += " -output=" ;
10265
10176
UB += Outputs[0 ].getFilename ();
@@ -10382,8 +10293,6 @@ void OffloadWrapper::ConstructJob(Compilation &C, const JobAction &JA,
10382
10293
10383
10294
llvm::Triple TT = getToolChain ().getTriple ();
10384
10295
SmallString<128 > TargetTripleOpt = TT.getArchName ();
10385
- bool WrapFPGADevice = false ;
10386
- bool FPGAEarly = false ;
10387
10296
10388
10297
// Validate and propogate CLI options related to device image compression.
10389
10298
// -offload-compress
@@ -10397,32 +10306,9 @@ void OffloadWrapper::ConstructJob(Compilation &C, const JobAction &JA,
10397
10306
Twine (" -offload-compression-level=" ) + A->getValue ()));
10398
10307
}
10399
10308
10400
- if (Arg *A = C.getInputArgs ().getLastArg (options::OPT_fsycl_link_EQ)) {
10401
- WrapFPGADevice = true ;
10402
- FPGAEarly = (A->getValue () == StringRef (" early" ));
10403
- // When wrapping an FPGA aocx binary to archive, do not emit registration
10404
- // functions
10405
- if (A->getValue () == StringRef (" image" ))
10406
- WrapperArgs.push_back (C.getArgs ().MakeArgString (" --emit-reg-funcs=0" ));
10407
- }
10408
10309
addRunTimeWrapperOpts (C, OffloadingKind, TCArgs, WrapperArgs,
10409
10310
getToolChain (), JA);
10410
10311
10411
- // When wrapping an FPGA device binary, we need to be sure to apply the
10412
- // appropriate triple that corresponds (fpga_aocr-intel-<os>)
10413
- // to the target triple setting.
10414
- if (TT.getSubArch () == llvm::Triple::SPIRSubArch_fpga && WrapFPGADevice) {
10415
- SmallString<16 > FPGAArch (" fpga_" );
10416
- if (FPGAEarly) {
10417
- FPGAArch += " aocr" ;
10418
- if (C.getDriver ().IsFPGAEmulationMode ())
10419
- FPGAArch += " _emu" ;
10420
- } else
10421
- FPGAArch += " aocx" ;
10422
- TT.setArchName (FPGAArch);
10423
- TT.setVendorName (" intel" );
10424
- TargetTripleOpt = TT.str ();
10425
- }
10426
10312
const toolchains::SYCLToolChain &TC =
10427
10313
static_cast <const toolchains::SYCLToolChain &>(getToolChain ());
10428
10314
bool IsEmbeddedIR = cast<OffloadWrapperJobAction>(JA).isEmbeddedIR ();
@@ -10449,18 +10335,6 @@ void OffloadWrapper::ConstructJob(Compilation &C, const JobAction &JA,
10449
10335
WrapperArgs.push_back (
10450
10336
C.getArgs ().MakeArgString (Twine (" -kind=" ) + Twine (Kind)));
10451
10337
10452
- // For FPGA toolchains, we can provide previously wrapped bc input files to
10453
- // the wrapper step. This is done for AOCR based files that will need the
10454
- // Symbols and Properties from a previous compilation step.
10455
- if (TC.getTriple ().isSPIR () && Inputs.size () == 2 &&
10456
- TC.getTriple ().getSubArch () == llvm::Triple::SPIRSubArch_fpga) {
10457
- // If there is an additional input argument passed in, that is considered
10458
- // the .bc file to include in this wrapping job.
10459
- const InputInfo &I = Inputs[1 ];
10460
- WrapperArgs.push_back (C.getArgs ().MakeArgString (
10461
- Twine (" --sym-prop-bc-files=" ) + I.getFilename ()));
10462
- }
10463
-
10464
10338
assert ((Inputs.size () > 0 ) && " no inputs for clang-offload-wrapper" );
10465
10339
assert (((Inputs[0 ].getType () != types::TY_Tempfiletable) ||
10466
10340
(Inputs.size () == 1 )) &&
0 commit comments