@@ -1232,8 +1232,7 @@ void Clang::AddPreprocessingOptions(Compilation &C, const JobAction &JA,
12321232 if (JA.isOffloading (Action::OFK_HIP))
12331233 getToolChain ().AddHIPIncludeArgs (Args, CmdArgs);
12341234
1235- if (JA.isOffloading (Action::OFK_SYCL) ||
1236- Args.hasArg (options::OPT_fsycl_device_only))
1235+ if (JA.isOffloading (Action::OFK_SYCL))
12371236 toolchains::SYCLToolChain::AddSYCLIncludeArgs (D, Args, CmdArgs);
12381237
12391238 // If we are offloading to a target via OpenMP we need to include the
@@ -4029,24 +4028,14 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
40294028 const ArgList &Args, const char *LinkingOutput) const {
40304029 const auto &TC = getToolChain ();
40314030 const llvm::Triple &RawTriple = TC.getTriple ();
4032- llvm::Triple Triple = TC.getEffectiveTriple ();
4031+ const llvm::Triple &Triple = TC.getEffectiveTriple ();
4032+ const std::string &TripleStr = Triple.getTriple ();
40334033
40344034 bool KernelOrKext =
40354035 Args.hasArg (options::OPT_mkernel, options::OPT_fapple_kext);
40364036 const Driver &D = TC.getDriver ();
40374037 ArgStringList CmdArgs;
40384038
4039- // -fsycl-device-only implies a SPIRV arch triple. Do not set if current
4040- // effective triple is SYCLDevice
4041- if (Args.hasArg (options::OPT_fsycl_device_only) &&
4042- Triple.getEnvironment () != llvm::Triple::SYCLDevice) {
4043- const char *SYCLTargetArch = " spir64" ;
4044- if (C.getDefaultToolChain ().getTriple ().getArch () == llvm::Triple::x86)
4045- SYCLTargetArch = " spir" ;
4046- Triple = C.getDriver ().MakeSYCLDeviceTriple (SYCLTargetArch);
4047- }
4048- const std::string &TripleStr = Triple.getTriple ();
4049-
40504039 // Check number of inputs for sanity. We need at least one input.
40514040 assert (Inputs.size () >= 1 && " Must have at least one input." );
40524041 // CUDA/HIP compilation may have multiple inputs (source file + results of
@@ -4061,8 +4050,7 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
40614050 bool IsHIP = JA.isOffloading (Action::OFK_HIP);
40624051 bool IsOpenMPDevice = JA.isDeviceOffloading (Action::OFK_OpenMP);
40634052 bool IsSYCLOffloadDevice = JA.isDeviceOffloading (Action::OFK_SYCL);
4064- bool IsSYCL = JA.isOffloading (Action::OFK_SYCL) ||
4065- Args.hasArg (options::OPT_fsycl_device_only);
4053+ bool IsSYCL = JA.isOffloading (Action::OFK_SYCL);
40664054 bool IsHeaderModulePrecompile = isa<HeaderModulePrecompileJobAction>(JA);
40674055 assert ((IsCuda || IsHIP || (IsOpenMPDevice && Inputs.size () == 2 ) || IsSYCL ||
40684056 IsHeaderModulePrecompile || Inputs.size () == 1 ) &&
@@ -4118,9 +4106,7 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
41184106 // step, and being part of the SYCL tool chain causes the incorrect target.
41194107 // FIXME - Is it possible to retain host environment when on a target
41204108 // device toolchain.
4121- bool UseSYCLTriple =
4122- IsSYCLDevice && (!IsSYCL || IsSYCLOffloadDevice ||
4123- Args.hasArg (options::OPT_fsycl_device_only));
4109+ bool UseSYCLTriple = IsSYCLDevice && (!IsSYCL || IsSYCLOffloadDevice);
41244110
41254111 // Adjust IsWindowsXYZ for CUDA/HIP/SYCL compilations. Even when compiling in
41264112 // device mode (i.e., getToolchain().getTriple() is NVPTX/AMDGCN, not
@@ -4222,9 +4208,6 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
42224208
42234209 // Pass the triple of host when doing SYCL
42244210 llvm::Triple AuxT = C.getDefaultToolChain ().getTriple ();
4225- if (Args.hasArg (options::OPT_fsycl_device_only) &&
4226- RawTriple.getEnvironment () == llvm::Triple::SYCLDevice)
4227- AuxT = llvm::Triple (llvm::sys::getProcessTriple ());
42284211 std::string NormalizedTriple = AuxT.normalize ();
42294212 CmdArgs.push_back (" -aux-triple" );
42304213 CmdArgs.push_back (Args.MakeArgString (NormalizedTriple));
@@ -6365,8 +6348,6 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
63656348 // SYCL library is guaranteed to work correctly only with dynamic
63666349 // MSVC runtime.
63676350 llvm::Triple AuxT = C.getDefaultToolChain ().getTriple ();
6368- if (Args.hasFlag (options::OPT_fsycl_device_only, OptSpecifier (), false ))
6369- AuxT = llvm::Triple (llvm::sys::getProcessTriple ());
63706351 if (AuxT.isWindowsMSVCEnvironment ()) {
63716352 CmdArgs.push_back (" -D_MT" );
63726353 CmdArgs.push_back (" -D_DLL" );
@@ -6891,7 +6872,6 @@ void Clang::AddClangCLArgs(const ArgList &Args, types::ID InputType,
68916872 unsigned RTOptionID = options::OPT__SLASH_MT;
68926873 bool isNVPTX = getToolChain ().getTriple ().isNVPTX ();
68936874 bool isSYCLDevice =
6894- Args.hasArg (options::OPT_fsycl_device_only) ||
68956875 getToolChain ().getTriple ().getEnvironment () == llvm::Triple::SYCLDevice;
68966876 bool isSYCL = Args.hasArg (options::OPT_fsycl) || isSYCLDevice;
68976877 // For SYCL Windows, /MD is the default.
@@ -7906,8 +7886,7 @@ void SPIRVTranslator::ConstructJob(Compilation &C, const JobAction &JA,
79067886
79077887 TranslatorArgs.push_back (" -o" );
79087888 TranslatorArgs.push_back (Output.getFilename ());
7909- if (getToolChain ().getTriple ().isSYCLDeviceEnvironment () ||
7910- TCArgs.hasArg (options::OPT_fsycl_device_only)) {
7889+ if (getToolChain ().getTriple ().isSYCLDeviceEnvironment ()) {
79117890 TranslatorArgs.push_back (" -spirv-max-version=1.1" );
79127891 TranslatorArgs.push_back (" -spirv-debug-info-version=legacy" );
79137892 // Prevent crash in the translator if input IR contains DIExpression
0 commit comments