Skip to content

Commit 50ea466

Browse files
committed
Merge from 'sycl' to 'sycl-web' (#1)
CONFLICT (content): Merge conflict in clang/lib/Driver/Driver.cpp
2 parents cceb459 + f58e2eb commit 50ea466

File tree

8 files changed

+41
-36
lines changed

8 files changed

+41
-36
lines changed

clang/lib/Driver/Driver.cpp

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3340,9 +3340,9 @@ class OffloadingActionBuilder final {
33403340
if (I->getType() == types::TY_Object) {
33413341
// FIXME - Checker does not work well inline with the tool
33423342
// chain, but it needs to be here for real time checking
3343-
//auto *DeviceCheckAction =
3344-
//C.MakeAction<SPIRCheckJobAction>(I, types::TY_Object);
3345-
//DeviceObjects.push_back(DeviceCheckAction);
3343+
// auto *DeviceCheckAction =
3344+
// C.MakeAction<SPIRCheckJobAction>(I, types::TY_Object);
3345+
// DeviceObjects.push_back(DeviceCheckAction);
33463346
DeviceObjects.push_back(I);
33473347
} else {
33483348
// Do not perform a device link and only pass the aocr
@@ -3351,7 +3351,7 @@ class OffloadingActionBuilder final {
33513351
Action * DeviceWrappingAction;
33523352
if (I->getType() == types::TY_FPGA_AOCR) {
33533353
auto *DeviceBECompileAction =
3354-
C.MakeAction<BackendCompileJobAction>(I, FPGAOutType);
3354+
C.MakeAction<BackendCompileJobAction>(I, FPGAOutType);
33553355
DeviceWrappingAction =
33563356
C.MakeAction<OffloadWrappingJobAction>(
33573357
DeviceBECompileAction, types::TY_Object);
@@ -3366,7 +3366,7 @@ class OffloadingActionBuilder final {
33663366
// link and wrap the device binary, but do not perform the
33673367
// backend compile.
33683368
auto *DeviceLinkAction =
3369-
C.MakeAction<LinkJobAction>(DeviceObjects, types::TY_SPIRV);
3369+
C.MakeAction<LinkJobAction>(DeviceObjects, types::TY_SPIRV);
33703370
auto *DeviceWrappingAction =
33713371
C.MakeAction<OffloadWrappingJobAction>(DeviceLinkAction,
33723372
types::TY_Object);
@@ -3446,8 +3446,9 @@ class OffloadingActionBuilder final {
34463446
WrapDeviceOnlyBinary = Args.hasArg(options::OPT_fsycl_link_EQ);
34473447
// Device only compilation for -fsycl-link (no FPGA) and
34483448
// -fsycl-link-targets
3449-
CompileDeviceOnly = (SYCLLinkTargets || (WrapDeviceOnlyBinary &&
3450-
!Args.hasArg(options::OPT_fintelfpga)));
3449+
CompileDeviceOnly =
3450+
(SYCLLinkTargets ||
3451+
(WrapDeviceOnlyBinary && !Args.hasArg(options::OPT_fintelfpga)));
34513452
Arg *SYCLAddTargets = Args.getLastArg(
34523453
options::OPT_fsycl_add_targets_EQ);
34533454
if (SYCLAddTargets) {
@@ -3657,8 +3658,8 @@ class OffloadingActionBuilder final {
36573658

36583659
// Checking uses -check-section option with the input file, no output
36593660
// file and the target triple being looked for.
3660-
const char *Targets = C.getArgs().MakeArgString(Twine("-targets=sycl-") +
3661-
TT.str());
3661+
const char *Targets =
3662+
C.getArgs().MakeArgString(Twine("-targets=sycl-") + TT.str());
36623663
const char *Inputs = C.getArgs().MakeArgString(Twine("-inputs=") +
36633664
Object);
36643665
// Always use -type=ao for aocx/aocr bundle checking. The 'bundles' are
@@ -3733,16 +3734,16 @@ class OffloadingActionBuilder final {
37333734
types::TY_Object &&
37343735
Args.hasArg(options::OPT_foffload_static_lib_EQ))) {
37353736
ActionList HostActionList;
3736-
Action * A(HostAction);
3737+
Action *A(HostAction);
37373738
// Only check for FPGA device information when using fpga SubArch.
37383739
if (Args.hasArg(options::OPT_fintelfpga) &&
37393740
HostAction->getType() != types::TY_FPGA_AOCR &&
37403741
HostAction->getType() != types::TY_FPGA_AOCX &&
37413742
!(HostAction->getType() == types::TY_Object &&
37423743
llvm::sys::path::has_extension(InputName) &&
37433744
types::lookupTypeForExtension(
3744-
llvm::sys::path::extension(InputName).drop_front()) ==
3745-
types::TY_Object)) {
3745+
llvm::sys::path::extension(InputName).drop_front()) ==
3746+
types::TY_Object)) {
37463747
if (HasFPGADeviceBinary(C, InputArg->getAsString(Args), true))
37473748
A = C.MakeAction<InputAction>(*InputArg, types::TY_FPGA_AOCX);
37483749
else if (HasFPGADeviceBinary(C, InputArg->getAsString(Args)))
@@ -4245,8 +4246,8 @@ void Driver::BuildActions(Compilation &C, DerivedArgList &Args,
42454246
Arg *InputArg = MakeInputArg(Args, *Opts, FileName);
42464247
OffloadBuilder.addHostDependenceToDeviceActions(UnbundlerInput,
42474248
InputArg, Args);
4248-
OffloadBuilder.addDeviceDependencesToHostAction(UnbundlerInput,
4249-
InputArg, phases::Link, PL.back(), PL);
4249+
OffloadBuilder.addDeviceDependencesToHostAction(
4250+
UnbundlerInput, InputArg, phases::Link, PL.back(), PL);
42504251
}
42514252
}
42524253
}
@@ -5040,7 +5041,7 @@ InputInfo Driver::BuildJobsForActionNoCache(
50405041
continue;
50415042
}
50425043
} else if (EffectiveTriple.getSubArch() !=
5043-
llvm::Triple::SPIRSubArch_fpga) {
5044+
llvm::Triple::SPIRSubArch_fpga) {
50445045
if (UI.DependentOffloadKind == Action::OFK_SYCL) {
50455046
// Do not add the current info for device with FPGA device. The
50465047
// device side isn't used
@@ -5049,8 +5050,8 @@ InputInfo Driver::BuildJobsForActionNoCache(
50495050
TI = types::TY_Tempfilelist;
50505051
Ext = "txt";
50515052
}
5052-
std::string TmpFileName =
5053-
C.getDriver().GetTemporaryPath(llvm::sys::path::stem(BaseInput), Ext);
5053+
std::string TmpFileName = C.getDriver().GetTemporaryPath(
5054+
llvm::sys::path::stem(BaseInput), Ext);
50545055
const char *TmpFile =
50555056
C.addTempFile(C.getArgs().MakeArgString(TmpFileName));
50565057
CurI = InputInfo(TI, TmpFile, TmpFile);

clang/lib/Driver/ToolChains/Clang.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6600,7 +6600,7 @@ void OffloadBundler::ConstructJobMultipleOutputs(
66006600
Input.getType() == types::TY_FPGA_AOCR) {
66016601
// Override type with archive object
66026602
if (getToolChain().getTriple().getSubArch() ==
6603-
llvm::Triple::SPIRSubArch_fpga)
6603+
llvm::Triple::SPIRSubArch_fpga)
66046604
TypeArg = "ao";
66056605
else
66066606
TypeArg = "aoo";
@@ -6624,7 +6624,7 @@ void OffloadBundler::ConstructJobMultipleOutputs(
66246624
if (Input.getType() == types::TY_FPGA_AOCX ||
66256625
Input.getType() == types::TY_FPGA_AOCR) {
66266626
if (getToolChain().getTriple().getSubArch() ==
6627-
llvm::Triple::SPIRSubArch_fpga &&
6627+
llvm::Triple::SPIRSubArch_fpga &&
66286628
Dep.DependentOffloadKind == Action::OFK_SYCL) {
66296629
llvm::Triple TT;
66306630
TT.setArchName(Input.getType() == types::TY_FPGA_AOCX ? "fpga_aocx"
@@ -6635,7 +6635,7 @@ void OffloadBundler::ConstructJobMultipleOutputs(
66356635
Triples += "sycl-";
66366636
Triples += TT.normalize();
66376637
} else if (getToolChain().getTriple().getSubArch() !=
6638-
llvm::Triple::SPIRSubArch_fpga &&
6638+
llvm::Triple::SPIRSubArch_fpga &&
66396639
Dep.DependentOffloadKind == Action::OFK_Host) {
66406640
Triples += Action::GetOffloadKindName(Dep.DependentOffloadKind);
66416641
Triples += '-';
@@ -6713,7 +6713,7 @@ void OffloadWrapper::ConstructJob(Compilation &C, const JobAction &JA,
67136713
// appropriate triple that corresponds (fpga_aoc[xr]-intel-<os>-sycldevice)
67146714
// to the target triple setting.
67156715
if (getToolChain().getTriple().getSubArch() ==
6716-
llvm::Triple::SPIRSubArch_fpga &&
6716+
llvm::Triple::SPIRSubArch_fpga &&
67176717
TCArgs.hasArg(options::OPT_fsycl_link_EQ)) {
67186718
llvm::Triple TT;
67196719
auto *A = C.getInputArgs().getLastArg(options::OPT_fsycl_link_EQ);

clang/lib/Driver/ToolChains/CommonArgs.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ void tools::AddLinkerInputs(const ToolChain &TC, const InputInfoList &Inputs,
168168
if (II.getType() == types::TY_Tempfilelist) {
169169
// Take the list file and pass it in with '@'.
170170
std::string FileName(II.getFilename());
171-
const char * ArgFile = Args.MakeArgString("@" + FileName);
171+
const char *ArgFile = Args.MakeArgString("@" + FileName);
172172
CmdArgs.push_back(ArgFile);
173173
continue;
174174
}

clang/lib/Driver/ToolChains/Gnu.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -343,17 +343,17 @@ static bool getStatic(const ArgList &Args) {
343343

344344
// Create an archive with llvm-ar. This is used to create an archive that
345345
// contains host objects and the wrapped FPGA device binary
346-
void tools::gnutools::Linker::constructLLVMARCommand(Compilation &C,
347-
const JobAction &JA, const InputInfo &Output, const InputInfoList &Input,
348-
const ArgList &Args) const {
346+
void tools::gnutools::Linker::constructLLVMARCommand(
347+
Compilation &C, const JobAction &JA, const InputInfo &Output,
348+
const InputInfoList &Input, const ArgList &Args) const {
349349
ArgStringList CmdArgs;
350350
CmdArgs.push_back("cr");
351351
CmdArgs.push_back(Output.getFilename());
352352
for (const auto &II : Input) {
353353
if (II.getType() == types::TY_Tempfilelist) {
354354
// Take the list file and pass it in with '@'.
355355
std::string FileName(II.getFilename());
356-
const char * ArgFile = Args.MakeArgString("@" + FileName);
356+
const char *ArgFile = Args.MakeArgString("@" + FileName);
357357
CmdArgs.push_back(ArgFile);
358358
continue;
359359
}

clang/lib/Driver/ToolChains/Gnu.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,12 @@ class LLVM_LIBRARY_VISIBILITY Linker : public GnuTool {
7070
const InputInfo &Output, const InputInfoList &Inputs,
7171
const llvm::opt::ArgList &TCArgs,
7272
const char *LinkingOutput) const override;
73+
7374
private:
7475
void constructLLVMARCommand(Compilation &C, const JobAction &JA,
7576
const InputInfo &Output,
7677
const InputInfoList &InputFiles,
7778
const llvm::opt::ArgList &Args) const;
78-
7979
};
8080
} // end namespace gnutools
8181

clang/lib/Driver/ToolChains/MSVC.cpp

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -306,21 +306,23 @@ static std::string FindVisualStudioExecutable(const ToolChain &TC,
306306
// Add a call to lib.exe to create an archive. This is used to embed host
307307
// objects into the bundled fat FPGA device binary.
308308
void visualstudio::Linker::constructMSVCLibCommand(Compilation &C,
309-
const JobAction &JA, const InputInfo &Output, const InputInfoList &Input,
310-
const ArgList &Args) const {
309+
const JobAction &JA,
310+
const InputInfo &Output,
311+
const InputInfoList &Input,
312+
const ArgList &Args) const {
311313
ArgStringList CmdArgs;
312314
for (const auto &II : Input) {
313315
if (II.getType() == types::TY_Tempfilelist) {
314316
// Take the list file and pass it in with '@'.
315317
std::string FileName(II.getFilename());
316-
const char * ArgFile = Args.MakeArgString("@" + FileName);
318+
const char *ArgFile = Args.MakeArgString("@" + FileName);
317319
CmdArgs.push_back(ArgFile);
318320
continue;
319321
}
320322
CmdArgs.push_back(II.getFilename());
321323
}
322-
CmdArgs.push_back(C.getArgs().MakeArgString(Twine("-OUT:") +
323-
Output.getFilename()));
324+
CmdArgs.push_back(
325+
C.getArgs().MakeArgString(Twine("-OUT:") + Output.getFilename()));
324326

325327
SmallString<128> ExecPath(getToolChain().GetProgramPath("lib"));
326328
const char *Exec = C.getArgs().MakeArgString(ExecPath);
@@ -488,7 +490,7 @@ void visualstudio::Linker::ConstructJob(Compilation &C, const JobAction &JA,
488490
if (Input.getType() == types::TY_Tempfilelist) {
489491
// Take the list file and pass it in with '@'.
490492
std::string FileName(Input.getFilename());
491-
const char * ArgFile = Args.MakeArgString("@" + FileName);
493+
const char *ArgFile = Args.MakeArgString("@" + FileName);
492494
CmdArgs.push_back(ArgFile);
493495
continue;
494496
}

clang/lib/Driver/ToolChains/MSVC.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ class LLVM_LIBRARY_VISIBILITY Linker : public Tool {
3434
const InputInfo &Output, const InputInfoList &Inputs,
3535
const llvm::opt::ArgList &TCArgs,
3636
const char *LinkingOutput) const override;
37+
3738
private:
3839
void constructMSVCLibCommand(Compilation &C, const JobAction &JA,
3940
const InputInfo &Output,

clang/lib/Driver/ToolChains/SYCL.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,8 @@ void SYCL::fpga::BackendCompiler::ConstructJob(Compilation &C,
270270
getToolChain().getTriple().getArch() == llvm::Triple::spir64) &&
271271
"Unsupported target");
272272
assert((JA.getType() == types::TY_FPGA_AOCX ||
273-
JA.getType() == types::TY_FPGA_AOCR) && "aoc type required");
273+
JA.getType() == types::TY_FPGA_AOCR) &&
274+
"aoc type required");
274275

275276
ArgStringList CmdArgs{"-o", Output.getFilename()};
276277
for (const auto &II : Inputs) {
@@ -337,8 +338,8 @@ void SYCL::fpga::BackendCompiler::ConstructJob(Compilation &C,
337338
}
338339
}
339340
if (!ReportOptArg.empty())
340-
CmdArgs.push_back(C.getArgs().MakeArgString(Twine("-output-report-folder=")
341-
+ ReportOptArg));
341+
CmdArgs.push_back(C.getArgs().MakeArgString(
342+
Twine("-output-report-folder=") + ReportOptArg));
342343
TranslateSYCLTargetArgs(C, Args, getToolChain(), CmdArgs);
343344
// Look for -reuse-exe=XX option
344345
if (Arg *A = Args.getLastArg(options::OPT_reuse_exe_EQ)) {

0 commit comments

Comments
 (0)