Skip to content

Commit 740e6ae

Browse files
committed
Revert "[AMDGPU] Use the AMDGPUToolChain when targeting C/C++ directly (#99687)"
Breaks some downstream AMD stuff apparently. This reverts commit 6ff86f2.
1 parent eeefa72 commit 740e6ae

File tree

2 files changed

+2
-17
lines changed

2 files changed

+2
-17
lines changed

clang/lib/Driver/Driver.cpp

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6669,21 +6669,9 @@ const ToolChain &Driver::getToolChain(const ArgList &Args,
66696669
case llvm::Triple::CUDA:
66706670
TC = std::make_unique<toolchains::NVPTXToolChain>(*this, Target, Args);
66716671
break;
6672-
case llvm::Triple::AMDHSA: {
6673-
bool CL = llvm::any_of(Args, [&](Arg *A) {
6674-
return (A->getOption().matches(options::OPT_x) &&
6675-
types::isOpenCL(
6676-
types::lookupTypeForExtension(A->getValue()))) ||
6677-
(A->getOption().getKind() == Option::InputClass &&
6678-
StringRef(A->getValue()).rfind('.') != StringRef::npos &&
6679-
types::isOpenCL(types::lookupTypeForExtension(
6680-
&A->getValue()[StringRef(A->getValue()).rfind('.') + 1])));
6681-
});
6682-
TC = CL ? std::make_unique<toolchains::ROCMToolChain>(*this, Target, Args)
6683-
: std::make_unique<toolchains::AMDGPUToolChain>(*this, Target,
6684-
Args);
6672+
case llvm::Triple::AMDHSA:
6673+
TC = std::make_unique<toolchains::ROCMToolChain>(*this, Target, Args);
66856674
break;
6686-
}
66876675
case llvm::Triple::AMDPAL:
66886676
case llvm::Triple::Mesa3D:
66896677
TC = std::make_unique<toolchains::AMDGPUToolChain>(*this, Target, Args);

clang/test/Driver/amdgpu-toolchain.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,3 @@
3636
// RUN: %clang -target amdgcn-amd-amdhsa -march=gfx90a -stdlib -startfiles \
3737
// RUN: -nogpulib -nogpuinc -### %s 2>&1 | FileCheck -check-prefix=STARTUP %s
3838
// STARTUP: ld.lld{{.*}}"-lc" "-lm" "{{.*}}crt1.o"
39-
//
40-
// RUN: %clang -### --target=amdgcn-amd-amdhsa -mcpu=gfx906 %s 2>&1 | FileCheck -check-prefix=ROCM %s
41-
// ROCM-NOT: -mlink-builtin-bitcode

0 commit comments

Comments
 (0)