@@ -901,35 +901,6 @@ Driver::OpenMPRuntimeKind Driver::getOpenMPRuntime(const ArgList &Args) const {
901
901
return RT;
902
902
}
903
903
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
-
933
904
// Handles `native` offload architectures by using the 'offload-arch' utility.
934
905
static llvm::SmallVector<std::string>
935
906
getSystemOffloadArchs (Compilation &C, Action::OffloadKind Kind) {
@@ -951,7 +922,8 @@ getSystemOffloadArchs(Compilation &C, Action::OffloadKind Kind) {
951
922
<< Action::GetOffloadKindName (Kind) << StdoutOrErr.takeError ()
952
923
<< " --offload-arch" ;
953
924
return GPUArchs;
954
- } else if ((*StdoutOrErr)->getBuffer ().empty ()) {
925
+ }
926
+ if ((*StdoutOrErr)->getBuffer ().empty ()) {
955
927
C.getDriver ().Diag (diag::err_drv_undetermined_gpu_arch)
956
928
<< Action::GetOffloadKindName (Kind) << " No GPU detected in the system"
957
929
<< " --offload-arch" ;
@@ -1087,8 +1059,8 @@ void Driver::CreateOffloadingDeviceToolChains(Compilation &C,
1087
1059
(C.getInputArgs ().hasFlag (options::OPT_fopenmp, options::OPT_fopenmp_EQ,
1088
1060
options::OPT_fno_openmp, false ) &&
1089
1061
(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) )));
1092
1064
1093
1065
llvm::DenseSet<Action::OffloadKind> Kinds;
1094
1066
const std::pair<bool , Action::OffloadKind> ActiveKinds[] = {
@@ -4880,7 +4852,7 @@ Action *Driver::BuildOffloadingActions(Compilation &C,
4880
4852
if (Kind == Action::OFK_SYCL && Phase == phases::Assemble)
4881
4853
continue ;
4882
4854
4883
- auto TCAndArch = TCAndArchs.begin ();
4855
+ auto * TCAndArch = TCAndArchs.begin ();
4884
4856
for (Action *&A : DeviceActions) {
4885
4857
if (A->getType () == types::TY_Nothing)
4886
4858
continue ;
@@ -4920,7 +4892,7 @@ Action *Driver::BuildOffloadingActions(Compilation &C,
4920
4892
A = C.MakeAction <LinkJobAction>(LinkerInput, types::TY_Image);
4921
4893
}
4922
4894
4923
- auto TCAndArch = TCAndArchs.begin ();
4895
+ auto * TCAndArch = TCAndArchs.begin ();
4924
4896
for (Action *A : DeviceActions) {
4925
4897
DDeps.add (*A, *TCAndArch->first , TCAndArch->second .data (), Kind);
4926
4898
OffloadAction::DeviceDependences DDep;
0 commit comments