Skip to content

Commit 1c53aaa

Browse files
committed
remove --offload-arch changes
Signed-off-by: Sarnie, Nick <[email protected]>
1 parent a5b980b commit 1c53aaa

File tree

2 files changed

+7
-16
lines changed

2 files changed

+7
-16
lines changed

clang/lib/Driver/Driver.cpp

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -903,10 +903,9 @@ void Driver::CreateOffloadingDeviceToolChains(Compilation &C,
903903
auto AMDTriple = getHIPOffloadTargetTriple(*this, C.getInputArgs());
904904
auto NVPTXTriple = getNVIDIAOffloadTargetTriple(*this, C.getInputArgs(),
905905
HostTC->getTriple());
906-
auto SPIRVTriple = getSPIRVOffloadTargetTriple(*this, C.getInputArgs());
907906

908907
// Attempt to deduce the offloading triple from the set of architectures.
909-
// We can only correctly deduce NVPTX / AMDGPU / SPIR-V triples currently.
908+
// We can only correctly deduce NVPTX / AMDGPU triples currently.
910909
// We need to temporarily create these toolchains so that we can access
911910
// tools for inferring architectures.
912911
llvm::DenseSet<StringRef> Archs;
@@ -925,15 +924,7 @@ void Driver::CreateOffloadingDeviceToolChains(Compilation &C,
925924
Archs.insert(Arch);
926925
}
927926

928-
if (SPIRVTriple) {
929-
auto TempTC = std::make_unique<toolchains::SPIRVOpenMPToolChain>(
930-
*this, *SPIRVTriple, *HostTC, C.getInputArgs());
931-
for (StringRef Arch : getOffloadArchs(
932-
C, C.getArgs(), Action::OFK_OpenMP, &*TempTC, true))
933-
Archs.insert(Arch);
934-
}
935-
936-
if (!AMDTriple && !NVPTXTriple && !SPIRVTriple) {
927+
if (!AMDTriple && !NVPTXTriple) {
937928
for (StringRef Arch :
938929
getOffloadArchs(C, C.getArgs(), Action::OFK_OpenMP, nullptr, true))
939930
Archs.insert(Arch);
@@ -947,8 +938,6 @@ void Driver::CreateOffloadingDeviceToolChains(Compilation &C,
947938
IsAMDOffloadArch(StringToOffloadArch(
948939
getProcessorFromTargetID(*AMDTriple, Arch)))) {
949940
DerivedArchs[AMDTriple->getTriple()].insert(Arch);
950-
} else if (SPIRVTriple && Arch == (*SPIRVTriple).str()) {
951-
DerivedArchs[Arch].insert(Arch);
952941
} else {
953942
Diag(clang::diag::err_drv_failed_to_deduce_target_from_arch) << Arch;
954943
return;

clang/test/Driver/spirv-openmp-toolchain.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
// RUN: %clang -### --target=x86_64-unknown-linux-gnu -fopenmp -fopenmp-targets=spirv64-intel \
22
// RUN: --libomptarget-spirv-bc-path=%t/ -nogpulib %s 2>&1 \
33
// RUN: | FileCheck %s
4-
// RUN: %clang -### --target=x86_64-unknown-linux-gnu -fopenmp --offload-arch=spirv64-intel \
5-
// RUN: --libomptarget-spirv-bc-path=%t/ -nogpulib %s 2>&1 \
6-
// RUN: | FileCheck %s
74

85
// verify the tools invocations
96
// CHECK: "-cc1" "-triple" "x86_64-unknown-linux-gnu"{{.*}}"-emit-llvm-bc"{{.*}}"-x" "c"
@@ -69,3 +66,8 @@
6966

7067
// RUN: not %clang -target x86_64-pc-linux-gnu -fopenmp --offload-arch=spirv64-intel -nogpulib --offload=spir64 %s 2>&1 | FileCheck %s --check-prefix=CHECK-TARGET-ID-ERROR-3
7168
// CHECK-TARGET-ID-ERROR-3: error: invalid or unsupported offload target: 'spir64'
69+
70+
// RUN: not %clang -### --target=x86_64-unknown-linux-gnu -fopenmp --offload-arch=spirv64-intel \
71+
// RUN: --libomptarget-spirv-bc-path=%t/ -nogpulib %s 2>&1 \
72+
// RUN: | FileCheck %s --check-prefix=CHECK-OFFLOAD-ARCH-ERROR
73+
// CHECK-OFFLOAD-ARCH-ERROR: error: failed to deduce triple for target architecture 'spirv64-intel'; specify the triple using '-fopenmp-targets' and '-Xopenmp-target' instead

0 commit comments

Comments
 (0)