@@ -4720,6 +4720,9 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
47204720
47214721 bool IsUsingLTO = D.isUsingLTO (IsDeviceOffloadAction);
47224722 auto LTOMode = D.getLTOMode (IsDeviceOffloadAction);
4723+ bool IsFPGASYCLOffloadDevice =
4724+ IsSYCLOffloadDevice &&
4725+ Triple.getSubArch () == llvm::Triple::SPIRSubArch_fpga;
47234726
47244727 // Perform the SYCL host compilation using an external compiler if the user
47254728 // requested.
@@ -4871,7 +4874,7 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
48714874 // Default value for FPGA is false, for all other targets is true.
48724875 if (!Args.hasFlag (options::OPT_fsycl_early_optimizations,
48734876 options::OPT_fno_sycl_early_optimizations,
4874- Triple. getSubArch () != llvm::Triple::SPIRSubArch_fpga ))
4877+ !IsFPGASYCLOffloadDevice ))
48754878 CmdArgs.push_back (" -fno-sycl-early-optimizations" );
48764879 else if (RawTriple.isSPIR ()) {
48774880 // Set `sycl-opt` option to configure LLVM passes for SPIR target
@@ -5355,7 +5358,8 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
53555358
53565359 // Discard value names in assert builds unless otherwise specified.
53575360 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)) {
53595363 if (Args.hasArg (options::OPT_fdiscard_value_names) &&
53605364 llvm::any_of (Inputs, [](const clang::driver::InputInfo &II) {
53615365 return types::isLLVMIR (II.getType ());
0 commit comments