@@ -901,35 +901,6 @@ Driver::OpenMPRuntimeKind Driver::getOpenMPRuntime(const ArgList &Args) const {
901901 return RT;
902902}
903903
904- static llvm::Triple getSYCLDeviceTriple (StringRef TargetArch) {
905- SmallVector<StringRef, 5 > SYCLAlias = {" spir" , " spir64" , " spirv" , " spirv32" ,
906- " spirv64" };
907- if (llvm::is_contained (SYCLAlias, TargetArch)) {
908- llvm::Triple TargetTriple;
909- TargetTriple.setArchName (TargetArch);
910- TargetTriple.setVendor (llvm::Triple::UnknownVendor);
911- TargetTriple.setOS (llvm::Triple::UnknownOS);
912- return TargetTriple;
913- }
914- return llvm::Triple (TargetArch);
915- }
916-
917- static bool addSYCLDefaultTriple (Compilation &C,
918- SmallVectorImpl<llvm::Triple> &SYCLTriples) {
919- // Check current set of triples to see if the default has already been set.
920- for (const auto &SYCLTriple : SYCLTriples) {
921- if (SYCLTriple.getSubArch () == llvm::Triple::NoSubArch &&
922- SYCLTriple.isSPIROrSPIRV ())
923- return false ;
924- }
925- // Add the default triple as it was not found.
926- llvm::Triple DefaultTriple = getSYCLDeviceTriple (
927- C.getDefaultToolChain ().getTriple ().isArch32Bit () ? " spirv32"
928- : " spirv64" );
929- SYCLTriples.insert (SYCLTriples.begin (), DefaultTriple);
930- return true ;
931- }
932-
933904// Handles `native` offload architectures by using the 'offload-arch' utility.
934905static llvm::SmallVector<std::string>
935906getSystemOffloadArchs (Compilation &C, Action::OffloadKind Kind) {
@@ -951,7 +922,8 @@ getSystemOffloadArchs(Compilation &C, Action::OffloadKind Kind) {
951922 << Action::GetOffloadKindName (Kind) << StdoutOrErr.takeError ()
952923 << " --offload-arch" ;
953924 return GPUArchs;
954- } else if ((*StdoutOrErr)->getBuffer ().empty ()) {
925+ }
926+ if ((*StdoutOrErr)->getBuffer ().empty ()) {
955927 C.getDriver ().Diag (diag::err_drv_undetermined_gpu_arch)
956928 << Action::GetOffloadKindName (Kind) << " No GPU detected in the system"
957929 << " --offload-arch" ;
@@ -1087,8 +1059,8 @@ void Driver::CreateOffloadingDeviceToolChains(Compilation &C,
10871059 (C.getInputArgs ().hasFlag (options::OPT_fopenmp, options::OPT_fopenmp_EQ,
10881060 options::OPT_fno_openmp, false ) &&
10891061 (C.getInputArgs ().hasArg (options::OPT_offload_targets_EQ) ||
1090- (C.getInputArgs ().hasArg (options::OPT_offload_arch_EQ)) &&
1091- !(IsCuda || IsHIP)));
1062+ (C.getInputArgs ().hasArg (options::OPT_offload_arch_EQ) &&
1063+ !(IsCuda || IsHIP) )));
10921064
10931065 llvm::DenseSet<Action::OffloadKind> Kinds;
10941066 const std::pair<bool , Action::OffloadKind> ActiveKinds[] = {
@@ -4880,7 +4852,7 @@ Action *Driver::BuildOffloadingActions(Compilation &C,
48804852 if (Kind == Action::OFK_SYCL && Phase == phases::Assemble)
48814853 continue ;
48824854
4883- auto TCAndArch = TCAndArchs.begin ();
4855+ auto * TCAndArch = TCAndArchs.begin ();
48844856 for (Action *&A : DeviceActions) {
48854857 if (A->getType () == types::TY_Nothing)
48864858 continue ;
@@ -4920,7 +4892,7 @@ Action *Driver::BuildOffloadingActions(Compilation &C,
49204892 A = C.MakeAction <LinkJobAction>(LinkerInput, types::TY_Image);
49214893 }
49224894
4923- auto TCAndArch = TCAndArchs.begin ();
4895+ auto * TCAndArch = TCAndArchs.begin ();
49244896 for (Action *A : DeviceActions) {
49254897 DDeps.add (*A, *TCAndArch->first , TCAndArch->second .data (), Kind);
49264898 OffloadAction::DeviceDependences DDep;
0 commit comments