@@ -1238,8 +1238,7 @@ void Clang::AddPreprocessingOptions(Compilation &C, const JobAction &JA,
1238
1238
if (JA.isOffloading (Action::OFK_HIP))
1239
1239
getToolChain ().AddHIPIncludeArgs (Args, CmdArgs);
1240
1240
1241
- if (JA.isOffloading (Action::OFK_SYCL) ||
1242
- Args.hasArg (options::OPT_fsycl_device_only))
1241
+ if (JA.isOffloading (Action::OFK_SYCL))
1243
1242
toolchains::SYCLToolChain::AddSYCLIncludeArgs (D, Args, CmdArgs);
1244
1243
1245
1244
// If we are offloading to a target via OpenMP we need to include the
@@ -4035,24 +4034,14 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
4035
4034
const ArgList &Args, const char *LinkingOutput) const {
4036
4035
const auto &TC = getToolChain ();
4037
4036
const llvm::Triple &RawTriple = TC.getTriple ();
4038
- llvm::Triple Triple = TC.getEffectiveTriple ();
4037
+ const llvm::Triple &Triple = TC.getEffectiveTriple ();
4038
+ const std::string &TripleStr = Triple.getTriple ();
4039
4039
4040
4040
bool KernelOrKext =
4041
4041
Args.hasArg (options::OPT_mkernel, options::OPT_fapple_kext);
4042
4042
const Driver &D = TC.getDriver ();
4043
4043
ArgStringList CmdArgs;
4044
4044
4045
- // -fsycl-device-only implies a SPIRV arch triple. Do not set if current
4046
- // effective triple is SYCLDevice
4047
- if (Args.hasArg (options::OPT_fsycl_device_only) &&
4048
- Triple.getEnvironment () != llvm::Triple::SYCLDevice) {
4049
- const char *SYCLTargetArch = " spir64" ;
4050
- if (C.getDefaultToolChain ().getTriple ().getArch () == llvm::Triple::x86)
4051
- SYCLTargetArch = " spir" ;
4052
- Triple = C.getDriver ().MakeSYCLDeviceTriple (SYCLTargetArch);
4053
- }
4054
- const std::string &TripleStr = Triple.getTriple ();
4055
-
4056
4045
// Check number of inputs for sanity. We need at least one input.
4057
4046
assert (Inputs.size () >= 1 && " Must have at least one input." );
4058
4047
// CUDA/HIP compilation may have multiple inputs (source file + results of
@@ -4067,8 +4056,7 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
4067
4056
bool IsHIP = JA.isOffloading (Action::OFK_HIP);
4068
4057
bool IsOpenMPDevice = JA.isDeviceOffloading (Action::OFK_OpenMP);
4069
4058
bool IsSYCLOffloadDevice = JA.isDeviceOffloading (Action::OFK_SYCL);
4070
- bool IsSYCL = JA.isOffloading (Action::OFK_SYCL) ||
4071
- Args.hasArg (options::OPT_fsycl_device_only);
4059
+ bool IsSYCL = JA.isOffloading (Action::OFK_SYCL);
4072
4060
bool IsHeaderModulePrecompile = isa<HeaderModulePrecompileJobAction>(JA);
4073
4061
assert ((IsCuda || IsHIP || (IsOpenMPDevice && Inputs.size () == 2 ) || IsSYCL ||
4074
4062
IsHeaderModulePrecompile || Inputs.size () == 1 ) &&
@@ -4124,9 +4112,7 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
4124
4112
// step, and being part of the SYCL tool chain causes the incorrect target.
4125
4113
// FIXME - Is it possible to retain host environment when on a target
4126
4114
// device toolchain.
4127
- bool UseSYCLTriple =
4128
- IsSYCLDevice && (!IsSYCL || IsSYCLOffloadDevice ||
4129
- Args.hasArg (options::OPT_fsycl_device_only));
4115
+ bool UseSYCLTriple = IsSYCLDevice && (!IsSYCL || IsSYCLOffloadDevice);
4130
4116
4131
4117
// Adjust IsWindowsXYZ for CUDA/HIP/SYCL compilations. Even when compiling in
4132
4118
// device mode (i.e., getToolchain().getTriple() is NVPTX/AMDGCN, not
@@ -4228,9 +4214,6 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
4228
4214
4229
4215
// Pass the triple of host when doing SYCL
4230
4216
llvm::Triple AuxT = C.getDefaultToolChain ().getTriple ();
4231
- if (Args.hasArg (options::OPT_fsycl_device_only) &&
4232
- RawTriple.getEnvironment () == llvm::Triple::SYCLDevice)
4233
- AuxT = llvm::Triple (llvm::sys::getProcessTriple ());
4234
4217
std::string NormalizedTriple = AuxT.normalize ();
4235
4218
CmdArgs.push_back (" -aux-triple" );
4236
4219
CmdArgs.push_back (Args.MakeArgString (NormalizedTriple));
@@ -6371,8 +6354,6 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
6371
6354
// SYCL library is guaranteed to work correctly only with dynamic
6372
6355
// MSVC runtime.
6373
6356
llvm::Triple AuxT = C.getDefaultToolChain ().getTriple ();
6374
- if (Args.hasFlag (options::OPT_fsycl_device_only, OptSpecifier (), false ))
6375
- AuxT = llvm::Triple (llvm::sys::getProcessTriple ());
6376
6357
if (AuxT.isWindowsMSVCEnvironment ()) {
6377
6358
CmdArgs.push_back (" -D_MT" );
6378
6359
CmdArgs.push_back (" -D_DLL" );
@@ -6897,7 +6878,6 @@ void Clang::AddClangCLArgs(const ArgList &Args, types::ID InputType,
6897
6878
unsigned RTOptionID = options::OPT__SLASH_MT;
6898
6879
bool isNVPTX = getToolChain ().getTriple ().isNVPTX ();
6899
6880
bool isSYCLDevice =
6900
- Args.hasArg (options::OPT_fsycl_device_only) ||
6901
6881
getToolChain ().getTriple ().getEnvironment () == llvm::Triple::SYCLDevice;
6902
6882
bool isSYCL = Args.hasArg (options::OPT_fsycl) || isSYCLDevice;
6903
6883
// For SYCL Windows, /MD is the default.
@@ -7912,8 +7892,7 @@ void SPIRVTranslator::ConstructJob(Compilation &C, const JobAction &JA,
7912
7892
7913
7893
TranslatorArgs.push_back (" -o" );
7914
7894
TranslatorArgs.push_back (Output.getFilename ());
7915
- if (getToolChain ().getTriple ().isSYCLDeviceEnvironment () ||
7916
- TCArgs.hasArg (options::OPT_fsycl_device_only)) {
7895
+ if (getToolChain ().getTriple ().isSYCLDeviceEnvironment ()) {
7917
7896
TranslatorArgs.push_back (" -spirv-max-version=1.1" );
7918
7897
TranslatorArgs.push_back (" -spirv-debug-info-version=legacy" );
7919
7898
// Prevent crash in the translator if input IR contains DIExpression
0 commit comments