@@ -4720,6 +4720,9 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
4720
4720
4721
4721
bool IsUsingLTO = D.isUsingLTO (IsDeviceOffloadAction);
4722
4722
auto LTOMode = D.getLTOMode (IsDeviceOffloadAction);
4723
+ bool IsFPGASYCLOffloadDevice =
4724
+ IsSYCLOffloadDevice &&
4725
+ Triple.getSubArch () == llvm::Triple::SPIRSubArch_fpga;
4723
4726
4724
4727
// Perform the SYCL host compilation using an external compiler if the user
4725
4728
// requested.
@@ -4871,7 +4874,7 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
4871
4874
// Default value for FPGA is false, for all other targets is true.
4872
4875
if (!Args.hasFlag (options::OPT_fsycl_early_optimizations,
4873
4876
options::OPT_fno_sycl_early_optimizations,
4874
- Triple. getSubArch () != llvm::Triple::SPIRSubArch_fpga ))
4877
+ !IsFPGASYCLOffloadDevice ))
4875
4878
CmdArgs.push_back (" -fno-sycl-early-optimizations" );
4876
4879
else if (RawTriple.isSPIR ()) {
4877
4880
// Set `sycl-opt` option to configure LLVM passes for SPIR target
@@ -5355,7 +5358,8 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
5355
5358
5356
5359
// Discard value names in assert builds unless otherwise specified.
5357
5360
if (Args.hasFlag (options::OPT_fdiscard_value_names,
5358
- options::OPT_fno_discard_value_names, !IsAssertBuild)) {
5361
+ options::OPT_fno_discard_value_names,
5362
+ !IsAssertBuild && !IsFPGASYCLOffloadDevice)) {
5359
5363
if (Args.hasArg (options::OPT_fdiscard_value_names) &&
5360
5364
llvm::any_of (Inputs, [](const clang::driver::InputInfo &II) {
5361
5365
return types::isLLVMIR (II.getType ());
0 commit comments