@@ -1238,8 +1238,7 @@ void Clang::AddPreprocessingOptions(Compilation &C, const JobAction &JA,
12381238 if (JA.isOffloading (Action::OFK_HIP))
12391239 getToolChain ().AddHIPIncludeArgs (Args, CmdArgs);
12401240
1241- if (JA.isOffloading (Action::OFK_SYCL) ||
1242- Args.hasArg (options::OPT_fsycl_device_only))
1241+ if (JA.isOffloading (Action::OFK_SYCL))
12431242 toolchains::SYCLToolChain::AddSYCLIncludeArgs (D, Args, CmdArgs);
12441243
12451244 // 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,
40354034 const ArgList &Args, const char *LinkingOutput) const {
40364035 const auto &TC = getToolChain ();
40374036 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 ();
40394039
40404040 bool KernelOrKext =
40414041 Args.hasArg (options::OPT_mkernel, options::OPT_fapple_kext);
40424042 const Driver &D = TC.getDriver ();
40434043 ArgStringList CmdArgs;
40444044
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-
40564045 // Check number of inputs for sanity. We need at least one input.
40574046 assert (Inputs.size () >= 1 && " Must have at least one input." );
40584047 // CUDA/HIP compilation may have multiple inputs (source file + results of
@@ -4067,8 +4056,7 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
40674056 bool IsHIP = JA.isOffloading (Action::OFK_HIP);
40684057 bool IsOpenMPDevice = JA.isDeviceOffloading (Action::OFK_OpenMP);
40694058 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);
40724060 bool IsHeaderModulePrecompile = isa<HeaderModulePrecompileJobAction>(JA);
40734061 assert ((IsCuda || IsHIP || (IsOpenMPDevice && Inputs.size () == 2 ) || IsSYCL ||
40744062 IsHeaderModulePrecompile || Inputs.size () == 1 ) &&
@@ -4124,9 +4112,7 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
41244112 // step, and being part of the SYCL tool chain causes the incorrect target.
41254113 // FIXME - Is it possible to retain host environment when on a target
41264114 // device toolchain.
4127- bool UseSYCLTriple =
4128- IsSYCLDevice && (!IsSYCL || IsSYCLOffloadDevice ||
4129- Args.hasArg (options::OPT_fsycl_device_only));
4115+ bool UseSYCLTriple = IsSYCLDevice && (!IsSYCL || IsSYCLOffloadDevice);
41304116
41314117 // Adjust IsWindowsXYZ for CUDA/HIP/SYCL compilations. Even when compiling in
41324118 // device mode (i.e., getToolchain().getTriple() is NVPTX/AMDGCN, not
@@ -4228,9 +4214,6 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
42284214
42294215 // Pass the triple of host when doing SYCL
42304216 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 ());
42344217 std::string NormalizedTriple = AuxT.normalize ();
42354218 CmdArgs.push_back (" -aux-triple" );
42364219 CmdArgs.push_back (Args.MakeArgString (NormalizedTriple));
@@ -6371,8 +6354,6 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
63716354 // SYCL library is guaranteed to work correctly only with dynamic
63726355 // MSVC runtime.
63736356 llvm::Triple AuxT = C.getDefaultToolChain ().getTriple ();
6374- if (Args.hasFlag (options::OPT_fsycl_device_only, OptSpecifier (), false ))
6375- AuxT = llvm::Triple (llvm::sys::getProcessTriple ());
63766357 if (AuxT.isWindowsMSVCEnvironment ()) {
63776358 CmdArgs.push_back (" -D_MT" );
63786359 CmdArgs.push_back (" -D_DLL" );
@@ -6897,7 +6878,6 @@ void Clang::AddClangCLArgs(const ArgList &Args, types::ID InputType,
68976878 unsigned RTOptionID = options::OPT__SLASH_MT;
68986879 bool isNVPTX = getToolChain ().getTriple ().isNVPTX ();
68996880 bool isSYCLDevice =
6900- Args.hasArg (options::OPT_fsycl_device_only) ||
69016881 getToolChain ().getTriple ().getEnvironment () == llvm::Triple::SYCLDevice;
69026882 bool isSYCL = Args.hasArg (options::OPT_fsycl) || isSYCLDevice;
69036883 // For SYCL Windows, /MD is the default.
@@ -7912,8 +7892,7 @@ void SPIRVTranslator::ConstructJob(Compilation &C, const JobAction &JA,
79127892
79137893 TranslatorArgs.push_back (" -o" );
79147894 TranslatorArgs.push_back (Output.getFilename ());
7915- if (getToolChain ().getTriple ().isSYCLDeviceEnvironment () ||
7916- TCArgs.hasArg (options::OPT_fsycl_device_only)) {
7895+ if (getToolChain ().getTriple ().isSYCLDeviceEnvironment ()) {
79177896 TranslatorArgs.push_back (" -spirv-max-version=1.1" );
79187897 TranslatorArgs.push_back (" -spirv-debug-info-version=legacy" );
79197898 // Prevent crash in the translator if input IR contains DIExpression
0 commit comments