[clang] [libc] [openmp] [Clang] Remove the old LLVM offloading driver entirely (PR #211924)
Joseph Huber via cfe-commits
cfe-commits at lists.llvm.org
Fri Jul 24 13:51:39 PDT 2026
https://github.com/jhuber6 created https://github.com/llvm/llvm-project/pull/211924
Summary:
The 'new' offloading driver is the unified set of steps to produce
merged host and device output. OpenMP offloading has used it by default
since Clang 13, CUDA since Clang 21, and HIP / SYCL since Clang 23. The
support has matured in the 23 release and should now cover the remaining
use-cases.
This PR completely removes the support so we stop needing to support
both when making updates to the driver.
>From f0d577c291ea90ba5fc38cc3ac19414865d1c660 Mon Sep 17 00:00:00 2001
From: Joseph Huber <huberjn at outlook.com>
Date: Fri, 24 Jul 2026 15:38:01 -0500
Subject: [PATCH] [Clang] Remove the old LLVM offloading driver entirely
Summary:
The 'new' offloading driver is the unified set of steps to produce
merged host and device output. OpenMP offloading has used it by default
since Clang 13, CUDA since Clang 21, and HIP / SYCL since Clang 23. The
support has matured in the 23 release and should now cover the remaining
use-cases.
This PR completely removes the support so we stop needing to support
both when making updates to the driver.
---
clang/docs/UsersManual.md | 4 +-
clang/include/clang/Basic/LangOptions.def | 1 -
clang/include/clang/Options/Options.td | 11 +-
clang/lib/CodeGen/CGCUDANV.cpp | 3 +-
clang/lib/Driver/Driver.cpp | 1071 +----------------
clang/lib/Driver/ToolChains/Clang.cpp | 17 +-
clang/lib/Driver/ToolChains/Cuda.cpp | 4 +-
clang/lib/Driver/ToolChains/HIPSPV.cpp | 10 -
clang/lib/Driver/ToolChains/HIPSPV.h | 3 -
clang/test/CodeGenCUDA/anon-ns.cu | 13 +-
clang/test/CodeGenCUDA/device-stub.cu | 49 -
clang/test/CodeGenCUDA/device-var-linkage.cu | 27 +-
clang/test/CodeGenCUDA/managed-var.cu | 18 +-
clang/test/CodeGenCUDA/offloading-entries.cu | 10 +-
.../test/CodeGenCUDA/static-device-var-rdc.cu | 25 +-
.../test/CodeGenHIP/offload-pgo-sections.hip | 2 +-
clang/test/Driver/amdgpu-hip-system-arch.c | 6 -
clang/test/Driver/cuda-bad-arch.cu | 8 -
clang/test/Driver/cuda-bindings.cu | 39 +-
clang/test/Driver/cuda-external-tools.cu | 29 -
clang/test/Driver/cuda-openmp-driver.cu | 8 +-
clang/test/Driver/cuda-phases.cu | 221 +---
clang/test/Driver/ftime-trace-offload.cpp | 5 -
clang/test/Driver/gpu-libc.c | 2 +-
clang/test/Driver/hip-binding.hip | 55 +-
clang/test/Driver/hip-code-object-version.hip | 8 -
clang/test/Driver/hip-cuid-hash.hip | 38 -
clang/test/Driver/hip-cuid.hip | 107 +-
clang/test/Driver/hip-dependent-options.hip | 16 +-
clang/test/Driver/hip-device-compile.hip | 144 ---
clang/test/Driver/hip-link-bc-to-bc.hip | 33 -
clang/test/Driver/hip-link-bundle-archive.hip | 86 --
clang/test/Driver/hip-link-save-temps.hip | 49 -
clang/test/Driver/hip-link-shared-library.hip | 15 -
clang/test/Driver/hip-link-static-library.hip | 34 -
.../test/Driver/hip-offload-compress-zlib.hip | 44 -
.../test/Driver/hip-offload-compress-zstd.hip | 45 +-
clang/test/Driver/hip-options.hip | 14 +-
clang/test/Driver/hip-output-file-name.hip | 82 --
clang/test/Driver/hip-partial-link.hip | 97 --
clang/test/Driver/hip-phases.hip | 607 +---------
clang/test/Driver/hip-rdc-device-only.hip | 184 ---
clang/test/Driver/hip-save-temps.hip | 66 -
.../test/Driver/hip-spirv-backend-bindings.c | 12 +-
clang/test/Driver/hip-spirv-backend-opt.c | 16 +-
clang/test/Driver/hip-spirv-backend-phases.c | 12 +-
.../Driver/hip-spirv-translator-new-driver.c | 4 +-
clang/test/Driver/hip-target-id.hip | 66 -
clang/test/Driver/hip-temps-linux.hip | 18 -
clang/test/Driver/hip-temps-windows.hip | 18 -
clang/test/Driver/hip-toolchain-features.hip | 73 --
clang/test/Driver/hip-toolchain-no-rdc.hip | 70 +-
.../hip-toolchain-rdc-flto-partitions.hip | 35 -
.../Driver/hip-toolchain-rdc-separate.hip | 157 ---
.../Driver/hip-toolchain-rdc-static-lib.hip | 98 --
clang/test/Driver/hip-toolchain-rdc.hip | 189 +--
clang/test/Driver/hip-unbundle-preproc.hipi | 27 -
.../Driver/hipspv-link-static-library.hip | 27 +-
clang/test/Driver/hipspv-pass-plugin.hip | 18 -
.../Driver/hipspv-toolchain-rdc-separate.hip | 4 +-
clang/test/Driver/hipspv-toolchain-rdc.hip | 61 +-
clang/test/Driver/hipspv-toolchain.hip | 28 +-
clang/test/Driver/lto.cu | 71 --
clang/test/Driver/nvptx-cuda-system-arch.c | 6 -
.../Driver/offload-new-driver-deprecated.c | 21 +
clang/test/Driver/sycl-offload-jit.cpp | 2 +-
clang/test/Driver/thinlto.cu | 25 -
.../OpenMP/openmp_offload_weak_vtables.cpp | 2 +-
clang/unittests/Tooling/ToolingTest.cpp | 6 +-
libc/docs/gpu/using.rst | 8 +-
openmp/docs/CommandLineArgumentReference.rst | 4 +-
openmp/docs/SupportAndFAQ.rst | 8 +-
72 files changed, 200 insertions(+), 4196 deletions(-)
delete mode 100644 clang/test/Driver/hip-cuid-hash.hip
delete mode 100644 clang/test/Driver/hip-device-compile.hip
delete mode 100644 clang/test/Driver/hip-link-bc-to-bc.hip
delete mode 100644 clang/test/Driver/hip-link-bundle-archive.hip
delete mode 100644 clang/test/Driver/hip-link-save-temps.hip
delete mode 100644 clang/test/Driver/hip-link-shared-library.hip
delete mode 100644 clang/test/Driver/hip-link-static-library.hip
delete mode 100644 clang/test/Driver/hip-offload-compress-zlib.hip
delete mode 100644 clang/test/Driver/hip-output-file-name.hip
delete mode 100644 clang/test/Driver/hip-partial-link.hip
delete mode 100644 clang/test/Driver/hip-rdc-device-only.hip
delete mode 100644 clang/test/Driver/hip-target-id.hip
delete mode 100644 clang/test/Driver/hip-temps-linux.hip
delete mode 100644 clang/test/Driver/hip-temps-windows.hip
delete mode 100644 clang/test/Driver/hip-toolchain-features.hip
delete mode 100644 clang/test/Driver/hip-toolchain-rdc-flto-partitions.hip
delete mode 100644 clang/test/Driver/hip-toolchain-rdc-separate.hip
delete mode 100644 clang/test/Driver/hip-toolchain-rdc-static-lib.hip
delete mode 100644 clang/test/Driver/hip-unbundle-preproc.hipi
delete mode 100644 clang/test/Driver/lto.cu
create mode 100644 clang/test/Driver/offload-new-driver-deprecated.c
delete mode 100644 clang/test/Driver/thinlto.cu
diff --git a/clang/docs/UsersManual.md b/clang/docs/UsersManual.md
index 54891619f1924..f6e7c67b3ee63 100644
--- a/clang/docs/UsersManual.md
+++ b/clang/docs/UsersManual.md
@@ -6164,7 +6164,7 @@ Execute `clang-cl /?` to see a list of supported options:
> -no-hip-rt Do not link against HIP runtime libraries
> --no-offload-arch=<value>
> Remove CUDA/HIP offloading device architecture (e.g. sm_35, gfx906) from the list of devices to compile for. 'all' resets the list to its default value.
-> --no-offload-new-driver Don't Use the new driver for offloading compilation.
+> --no-offload-new-driver Deprecated; the legacy offloading driver has been removed.
> --no-offloadlib Do not link device library for CUDA/HIP/SYCL device compilation
> --no-wasm-opt Disable the wasm-opt optimizer
> -nobuiltininc Disable builtin #include directories only
@@ -6179,7 +6179,7 @@ Execute `clang-cl /?` to see a list of supported options:
> --offload-host-device Compile for both the offloading host and device (default).
> --offload-host-only Only compile for the offloading host.
> --offload-jobs=<value> Specify the number of threads to use for device offloading tasks during compilation. Can be a positive integer or the string 'jobserver' to use the make-style jobserver from the environment.
-> --offload-new-driver Use the new driver for offloading compilation.
+> --offload-new-driver Deprecated; the new driver is always used for offloading compilation.
> --offload-targets=<value>
> Specify a list of target architectures to use for offloading.
> --offloadlib Link device libraries for GPU device compilation
diff --git a/clang/include/clang/Basic/LangOptions.def b/clang/include/clang/Basic/LangOptions.def
index 3d63b9677e4df..002667e5c6c5c 100644
--- a/clang/include/clang/Basic/LangOptions.def
+++ b/clang/include/clang/Basic/LangOptions.def
@@ -261,7 +261,6 @@ LANGOPT(GPUAllowDeviceInit, 1, 0, NotCompatible, "allowing device side global in
LANGOPT(GPUMaxThreadsPerBlock, 32, 1024, NotCompatible, "default max threads per block for kernel launch bounds for HIP")
LANGOPT(GPUDeferDiag, 1, 0, NotCompatible, "defer host/device related diagnostic messages for CUDA/HIP")
LANGOPT(GPUExcludeWrongSideOverloads, 1, 0, NotCompatible, "always exclude wrong side overloads in overloading resolution for CUDA/HIP")
-LANGOPT(OffloadingNewDriver, 1, 0, NotCompatible, "use the new driver for generating offloading code.")
LANGOPT(OffloadViaLLVM, 1, 0, NotCompatible, "target LLVM/Offload as portable offloading runtime.")
LANGOPT(SYCLIsDevice , 1, 0, NotCompatible, "Generate code for SYCL device")
diff --git a/clang/include/clang/Options/Options.td b/clang/include/clang/Options/Options.td
index 669b6e64725c9..bd3540c9098c0 100644
--- a/clang/include/clang/Options/Options.td
+++ b/clang/include/clang/Options/Options.td
@@ -1268,10 +1268,10 @@ def no_offload_arch_EQ : CommaJoined<["--"], "no-offload-arch=">,
def offload_new_driver : Flag<["--"], "offload-new-driver">,
Visibility<[ClangOption, CC1Option]>, Group<f_Group>,
- MarshallingInfoFlag<LangOpts<"OffloadingNewDriver">>, HelpText<"Use the new driver for offloading compilation.">;
+ HelpText<"Deprecated; the new driver is always used for offloading compilation.">;
def no_offload_new_driver : Flag<["--"], "no-offload-new-driver">,
Visibility<[ClangOption, CC1Option]>, Group<f_Group>,
- HelpText<"Don't Use the new driver for offloading compilation.">;
+ HelpText<"Deprecated; the legacy offloading driver has been removed.">;
def offload_device_only : Flag<["--"], "offload-device-only">,
Visibility<[ClangOption, FlangOption]>,
@@ -4308,11 +4308,10 @@ defm openmp_optimistic_collapse : BoolFOption<"openmp-optimistic-collapse",
NegFlag<SetFalse>, BothFlags<[NoArgumentUnused, HelpHidden], []>>;
def static_openmp: Flag<["-"], "static-openmp">,
HelpText<"Use the static host OpenMP runtime while linking.">;
-def fopenmp_new_driver : Flag<["-"], "fopenmp-new-driver">, Flags<[HelpHidden]>,
- HelpText<"Use the new driver for OpenMP offloading.">;
+def fopenmp_new_driver : Flag<["-"], "fopenmp-new-driver">,
+ Flags<[HelpHidden]>, Alias<offload_new_driver>;
def fno_openmp_new_driver : Flag<["-"], "fno-openmp-new-driver">,
- Flags<[HelpHidden]>,
- HelpText<"Don't use the new driver for OpenMP offloading.">;
+ Flags<[HelpHidden]>, Alias<no_offload_new_driver>;
def fno_optimize_sibling_calls : Flag<["-"], "fno-optimize-sibling-calls">, Group<f_Group>,
Visibility<[ClangOption, CC1Option]>,
HelpText<"Disable tail call optimization, keeping the call stack accurate">,
diff --git a/clang/lib/CodeGen/CGCUDANV.cpp b/clang/lib/CodeGen/CGCUDANV.cpp
index 416ed935c1b30..89135e7d84a4d 100644
--- a/clang/lib/CodeGen/CGCUDANV.cpp
+++ b/clang/lib/CodeGen/CGCUDANV.cpp
@@ -1479,8 +1479,7 @@ llvm::Function *CGNVCUDARuntime::finalizeModule() {
}
return nullptr;
}
- if (CGM.getLangOpts().OffloadViaLLVM ||
- (CGM.getLangOpts().OffloadingNewDriver && RelocatableDeviceCode))
+ if (CGM.getLangOpts().OffloadViaLLVM || RelocatableDeviceCode)
createOffloadingEntries();
else
return makeModuleCtorFunction();
diff --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp
index e606cdc4c1cf8..0408d6dd60c40 100644
--- a/clang/lib/Driver/Driver.cpp
+++ b/clang/lib/Driver/Driver.cpp
@@ -3306,990 +3306,6 @@ void Driver::BuildInputs(const ToolChain &TC, DerivedArgList &Args,
}
}
-namespace {
-/// Provides a convenient interface for different programming models to generate
-/// the required device actions.
-class OffloadingActionBuilder final {
- /// Flag used to trace errors in the builder.
- bool IsValid = false;
-
- /// The compilation that is using this builder.
- Compilation &C;
-
- /// Map between an input argument and the offload kinds used to process it.
- std::map<const Arg *, unsigned> InputArgToOffloadKindMap;
-
- /// Map between a host action and its originating input argument.
- std::map<Action *, const Arg *> HostActionToInputArgMap;
-
- /// Builder interface. It doesn't build anything or keep any state.
- class DeviceActionBuilder {
- public:
- typedef const llvm::SmallVectorImpl<phases::ID> PhasesTy;
-
- enum ActionBuilderReturnCode {
- // The builder acted successfully on the current action.
- ABRT_Success,
- // The builder didn't have to act on the current action.
- ABRT_Inactive,
- // The builder was successful and requested the host action to not be
- // generated.
- ABRT_Ignore_Host,
- };
-
- protected:
- /// Compilation associated with this builder.
- Compilation &C;
-
- /// Tool chains associated with this builder. The same programming
- /// model may have associated one or more tool chains.
- /// There should be one entry for each TargetID.
- SmallVector<const ToolChain *, 2> ToolChains;
- const ToolChain *FatBinaryToolChain = nullptr;
-
- /// The derived arguments associated with this builder.
- DerivedArgList &Args;
-
- /// The inputs associated with this builder.
- const InputList &Inputs;
-
- /// The associated offload kind.
- Action::OffloadKind AssociatedOffloadKind = Action::OFK_None;
-
- public:
- DeviceActionBuilder(Compilation &C, DerivedArgList &Args,
- const InputList &Inputs,
- Action::OffloadKind AssociatedOffloadKind)
- : C(C), Args(Args), Inputs(Inputs),
- AssociatedOffloadKind(AssociatedOffloadKind) {}
- virtual ~DeviceActionBuilder() {}
-
- /// Fill up the array \a DA with all the device dependences that should be
- /// added to the provided host action \a HostAction. By default it is
- /// inactive.
- virtual ActionBuilderReturnCode
- getDeviceDependences(OffloadAction::DeviceDependences &DA,
- phases::ID CurPhase, phases::ID FinalPhase,
- PhasesTy &Phases) {
- return ABRT_Inactive;
- }
-
- /// Update the state to include the provided host action \a HostAction as a
- /// dependency of the current device action. By default it is inactive.
- virtual ActionBuilderReturnCode addDeviceDependences(Action *HostAction) {
- return ABRT_Inactive;
- }
-
- /// Append top level actions generated by the builder.
- virtual void appendTopLevelActions(ActionList &AL) {}
-
- /// Append linker device actions generated by the builder.
- virtual void appendLinkDeviceActions(ActionList &AL) {}
-
- /// Append linker host action generated by the builder.
- virtual Action* appendLinkHostActions(ActionList &AL) { return nullptr; }
-
- /// Append linker actions generated by the builder.
- virtual void appendLinkDependences(OffloadAction::DeviceDependences &DA) {}
-
- /// Initialize the builder. Return true if any initialization errors are
- /// found.
- virtual bool initialize() { return false; }
-
- /// Return true if the builder can use bundling/unbundling.
- virtual bool canUseBundlerUnbundler() const { return false; }
-
- /// Return true if this builder is valid. We have a valid builder if we have
- /// associated device tool chains.
- bool isValid() { return !ToolChains.empty(); }
-
- /// Return the associated offload kind.
- Action::OffloadKind getAssociatedOffloadKind() {
- return AssociatedOffloadKind;
- }
- };
-
- /// Base class for CUDA/HIP action builder. It injects device code in
- /// the host backend action.
- class CudaActionBuilderBase : public DeviceActionBuilder {
- protected:
- /// Flags to signal if the user requested host-only or device-only
- /// compilation.
- bool CompileHostOnly = false;
- bool CompileDeviceOnly = false;
- bool EmitLLVM = false;
- bool EmitAsm = false;
-
- /// List of GPU architectures to use in this compilation.
- SmallVector<BoundArch, 4> GpuArchList;
-
- /// The CUDA actions for the current input.
- ActionList CudaDeviceActions;
-
- /// The CUDA fat binary if it was generated for the current input.
- Action *CudaFatBinary = nullptr;
-
- /// Flag that is set to true if this builder acted on the current input.
- bool IsActive = false;
-
- /// Flag for -fgpu-rdc.
- bool Relocatable = false;
-
- /// Default GPU architecture if there's no one specified.
- OffloadArch DefaultOffloadArch = OffloadArch::Unknown;
-
- /// Compilation unit ID specified by option '-fuse-cuid=' or'-cuid='.
- const CUIDOptions &CUIDOpts;
-
- public:
- CudaActionBuilderBase(Compilation &C, DerivedArgList &Args,
- const InputList &Inputs, Action::OffloadKind OFKind)
- : DeviceActionBuilder(C, Args, Inputs, OFKind),
- CUIDOpts(C.getDriver().getCUIDOpts()) {
-
- CompileDeviceOnly = C.getDriver().offloadDeviceOnly();
- Relocatable = Args.hasFlag(options::OPT_fgpu_rdc,
- options::OPT_fno_gpu_rdc, /*Default=*/false);
- }
-
- ActionBuilderReturnCode addDeviceDependences(Action *HostAction) override {
- // While generating code for CUDA, we only depend on the host input action
- // to trigger the creation of all the CUDA device actions.
-
- // If we are dealing with an input action, replicate it for each GPU
- // architecture. If we are in host-only mode we return 'success' so that
- // the host uses the CUDA offload kind.
- if (auto *IA = dyn_cast<InputAction>(HostAction)) {
- // If the host input is not CUDA or HIP, we don't need to bother about
- // this input.
- if (!(IA->getType() == types::TY_CUDA ||
- IA->getType() == types::TY_HIP ||
- IA->getType() == types::TY_PP_HIP)) {
- // The builder will ignore this input.
- IsActive = false;
- return ABRT_Inactive;
- }
-
- // Set the flag to true, so that the builder acts on the current input.
- IsActive = true;
-
- if (CUIDOpts.isEnabled())
- IA->setId(CUIDOpts.getCUID(IA->getInputArg().getValue(), Args));
-
- if (CompileHostOnly)
- return ABRT_Success;
-
- // Replicate inputs for each GPU architecture.
- auto Ty = IA->getType() == types::TY_HIP ? types::TY_HIP_DEVICE
- : types::TY_CUDA_DEVICE;
- for (unsigned I = 0, E = GpuArchList.size(); I != E; ++I) {
- CudaDeviceActions.push_back(
- C.MakeAction<InputAction>(IA->getInputArg(), Ty, IA->getId()));
- }
-
- return ABRT_Success;
- }
-
- // If this is an unbundling action use it as is for each CUDA toolchain.
- if (auto *UA = dyn_cast<OffloadUnbundlingJobAction>(HostAction)) {
-
- // If -fgpu-rdc is disabled, should not unbundle since there is no
- // device code to link.
- if (UA->getType() == types::TY_Object && !Relocatable)
- return ABRT_Inactive;
-
- CudaDeviceActions.clear();
- auto *IA = cast<InputAction>(UA->getInputs().back());
- std::string FileName = IA->getInputArg().getAsString(Args);
- // Check if the type of the file is the same as the action. Do not
- // unbundle it if it is not. Do not unbundle .so files, for example,
- // which are not object files. Files with extension ".lib" is classified
- // as TY_Object but they are actually archives, therefore should not be
- // unbundled here as objects. They will be handled at other places.
- const StringRef LibFileExt = ".lib";
- if (IA->getType() == types::TY_Object &&
- (!llvm::sys::path::has_extension(FileName) ||
- types::lookupTypeForExtension(
- llvm::sys::path::extension(FileName).drop_front()) !=
- types::TY_Object ||
- llvm::sys::path::extension(FileName) == LibFileExt))
- return ABRT_Inactive;
-
- for (auto [Arch, ToolChain] : llvm::zip(GpuArchList, ToolChains)) {
- CudaDeviceActions.push_back(UA);
- UA->registerDependentActionInfo(ToolChain, Arch,
- AssociatedOffloadKind);
- }
- IsActive = true;
- return ABRT_Success;
- }
-
- return IsActive ? ABRT_Success : ABRT_Inactive;
- }
-
- void appendTopLevelActions(ActionList &AL) override {
- // Utility to append actions to the top level list.
- auto AddTopLevel = [&](Action *A, BoundArch BA, const ToolChain *TC) {
- OffloadAction::DeviceDependences Dep;
- Dep.add(*A, *TC, BA, AssociatedOffloadKind);
- AL.push_back(C.MakeAction<OffloadAction>(Dep, A->getType()));
- };
-
- // If we have a fat binary, add it to the list.
- if (CudaFatBinary) {
- AddTopLevel(CudaFatBinary, {}, FatBinaryToolChain);
- CudaDeviceActions.clear();
- CudaFatBinary = nullptr;
- return;
- }
-
- if (CudaDeviceActions.empty())
- return;
-
- // If we have CUDA actions at this point, that's because we have a have
- // partial compilation, so we should have an action for each GPU
- // architecture.
- assert(CudaDeviceActions.size() == GpuArchList.size() &&
- "Expecting one action per GPU architecture.");
- assert(ToolChains.size() == GpuArchList.size() &&
- "Expecting to have a toolchain per GPU architecture");
- for (unsigned I = 0, E = GpuArchList.size(); I != E; ++I)
- AddTopLevel(CudaDeviceActions[I], GpuArchList[I], ToolChains[I]);
-
- CudaDeviceActions.clear();
- }
-
- bool initialize() override {
- assert(AssociatedOffloadKind == Action::OFK_Cuda ||
- AssociatedOffloadKind == Action::OFK_HIP);
-
- // We don't need to support CUDA.
- if (AssociatedOffloadKind == Action::OFK_Cuda &&
- !C.hasOffloadToolChain<Action::OFK_Cuda>())
- return false;
-
- // We don't need to support HIP.
- if (AssociatedOffloadKind == Action::OFK_HIP &&
- !C.hasOffloadToolChain<Action::OFK_HIP>())
- return false;
-
- const ToolChain *HostTC = C.getSingleOffloadToolChain<Action::OFK_Host>();
- assert(HostTC && "No toolchain for host compilation.");
- if (HostTC->getTriple().isNVPTX() || HostTC->getTriple().isAMDGCN()) {
- // We do not support targeting NVPTX/AMDGCN for host compilation. Throw
- // an error and abort pipeline construction early so we don't trip
- // asserts that assume device-side compilation.
- C.getDriver().Diag(diag::err_drv_cuda_host_arch)
- << HostTC->getTriple().getArchName();
- return true;
- }
-
- std::set<std::pair<BoundArch, const ToolChain *>> GpuArchs;
- for (Action::OffloadKind Kind : {Action::OFK_Cuda, Action::OFK_HIP}) {
- for (auto &I : llvm::make_range(C.getOffloadToolChains(Kind))) {
- for (auto Arch :
- C.getDriver().getOffloadArchs(C, C.getArgs(), Kind, *I.second))
- GpuArchs.insert({Arch, I.second});
- }
- }
-
- for (auto [Arch, TC] : GpuArchs) {
- GpuArchList.push_back(Arch);
- ToolChains.push_back(TC);
- }
-
- FatBinaryToolChain = ToolChains.front();
- CompileHostOnly = C.getDriver().offloadHostOnly();
- EmitLLVM = Args.getLastArg(options::OPT_emit_llvm);
- EmitAsm = Args.getLastArg(options::OPT_S);
-
- return false;
- }
- };
-
- /// \brief CUDA action builder. It injects device code in the host backend
- /// action.
- class CudaActionBuilder final : public CudaActionBuilderBase {
- public:
- CudaActionBuilder(Compilation &C, DerivedArgList &Args,
- const InputList &Inputs)
- : CudaActionBuilderBase(C, Args, Inputs, Action::OFK_Cuda) {
- DefaultOffloadArch = OffloadArch::CudaDefault;
- }
-
- ActionBuilderReturnCode
- getDeviceDependences(OffloadAction::DeviceDependences &DA,
- phases::ID CurPhase, phases::ID FinalPhase,
- PhasesTy &Phases) override {
- if (!IsActive)
- return ABRT_Inactive;
-
- // If we don't have more CUDA actions, we don't have any dependences to
- // create for the host.
- if (CudaDeviceActions.empty())
- return ABRT_Success;
-
- assert(CudaDeviceActions.size() == GpuArchList.size() &&
- "Expecting one action per GPU architecture.");
- assert(!CompileHostOnly &&
- "Not expecting CUDA actions in host-only compilation.");
-
- // If we are generating code for the device or we are in a backend phase,
- // we attempt to generate the fat binary. We compile each arch to ptx and
- // assemble to cubin, then feed the cubin *and* the ptx into a device
- // "link" action, which uses fatbinary to combine these cubins into one
- // fatbin. The fatbin is then an input to the host action if not in
- // device-only mode.
- if (CompileDeviceOnly || CurPhase == phases::Backend) {
- ActionList DeviceActions;
- for (unsigned I = 0, E = GpuArchList.size(); I != E; ++I) {
- // Produce the device action from the current phase up to the assemble
- // phase.
- for (auto Ph : Phases) {
- // Skip the phases that were already dealt with.
- if (Ph < CurPhase)
- continue;
- // We have to be consistent with the host final phase.
- if (Ph > FinalPhase)
- break;
-
- CudaDeviceActions[I] = C.getDriver().ConstructPhaseAction(
- C, Args, Ph, CudaDeviceActions[I], Action::OFK_Cuda,
- ToolChains[I]->getLTOMode(Args, Action::OFK_Cuda));
-
- if (Ph == phases::Assemble)
- break;
- }
-
- // If we didn't reach the assemble phase, we can't generate the fat
- // binary. We don't need to generate the fat binary if we are not in
- // device-only mode.
- if (!isa<AssembleJobAction>(CudaDeviceActions[I]) ||
- CompileDeviceOnly)
- continue;
-
- Action *AssembleAction = CudaDeviceActions[I];
- assert(AssembleAction->getType() == types::TY_Object);
- assert(AssembleAction->getInputs().size() == 1);
-
- Action *BackendAction = AssembleAction->getInputs()[0];
- assert(BackendAction->getType() == types::TY_PP_Asm);
-
- for (auto &A : {AssembleAction, BackendAction}) {
- OffloadAction::DeviceDependences DDep;
- DDep.add(*A, *ToolChains[I], GpuArchList[I], Action::OFK_Cuda);
- DeviceActions.push_back(
- C.MakeAction<OffloadAction>(DDep, A->getType()));
- }
- }
-
- // We generate the fat binary if we have device input actions.
- if (!DeviceActions.empty()) {
- CudaFatBinary =
- C.MakeAction<LinkJobAction>(DeviceActions, types::TY_CUDA_FATBIN);
-
- if (!CompileDeviceOnly) {
- DA.add(*CudaFatBinary, *FatBinaryToolChain, /*BA=*/{},
- Action::OFK_Cuda);
- // Clear the fat binary, it is already a dependence to an host
- // action.
- CudaFatBinary = nullptr;
- }
-
- // Remove the CUDA actions as they are already connected to an host
- // action or fat binary.
- CudaDeviceActions.clear();
- }
-
- // We avoid creating host action in device-only mode.
- return CompileDeviceOnly ? ABRT_Ignore_Host : ABRT_Success;
- } else if (CurPhase > phases::Backend) {
- // If we are past the backend phase and still have a device action, we
- // don't have to do anything as this action is already a device
- // top-level action.
- return ABRT_Success;
- }
-
- assert(CurPhase < phases::Backend && "Generating single CUDA "
- "instructions should only occur "
- "before the backend phase!");
-
- // By default, we produce an action for each device arch.
- for (Action *&A : CudaDeviceActions)
- A = C.getDriver().ConstructPhaseAction(C, Args, CurPhase, A);
-
- return ABRT_Success;
- }
- };
- /// \brief HIP action builder. It injects device code in the host backend
- /// action.
- class HIPActionBuilder final : public CudaActionBuilderBase {
- /// The linker inputs obtained for each device arch.
- SmallVector<ActionList, 8> DeviceLinkerInputs;
- // The default bundling behavior depends on the type of output, therefore
- // BundleOutput needs to be tri-value: None, true, or false.
- // Bundle code objects except --no-gpu-output is specified for device
- // only compilation. Bundle other type of output files only if
- // --gpu-bundle-output is specified for device only compilation.
- std::optional<bool> BundleOutput;
- std::optional<bool> EmitReloc;
-
- public:
- HIPActionBuilder(Compilation &C, DerivedArgList &Args,
- const InputList &Inputs)
- : CudaActionBuilderBase(C, Args, Inputs, Action::OFK_HIP) {
-
- DefaultOffloadArch = OffloadArch::HIPDefault;
-
- if (Args.hasArg(options::OPT_fhip_emit_relocatable,
- options::OPT_fno_hip_emit_relocatable)) {
- EmitReloc = Args.hasFlag(options::OPT_fhip_emit_relocatable,
- options::OPT_fno_hip_emit_relocatable, false);
-
- if (*EmitReloc) {
- if (Relocatable) {
- C.getDriver().Diag(diag::err_opt_not_valid_with_opt)
- << "-fhip-emit-relocatable"
- << "-fgpu-rdc";
- }
-
- if (!CompileDeviceOnly) {
- C.getDriver().Diag(diag::err_opt_not_valid_without_opt)
- << "-fhip-emit-relocatable"
- << "--offload-device-only";
- }
- }
- }
-
- if (Args.hasArg(options::OPT_gpu_bundle_output,
- options::OPT_no_gpu_bundle_output))
- BundleOutput = Args.hasFlag(options::OPT_gpu_bundle_output,
- options::OPT_no_gpu_bundle_output, true) &&
- (!EmitReloc || !*EmitReloc);
- }
-
- bool canUseBundlerUnbundler() const override { return true; }
-
- ActionBuilderReturnCode
- getDeviceDependences(OffloadAction::DeviceDependences &DA,
- phases::ID CurPhase, phases::ID FinalPhase,
- PhasesTy &Phases) override {
- if (!IsActive)
- return ABRT_Inactive;
-
- // amdgcn does not support linking of object files, therefore we skip
- // backend and assemble phases to output LLVM IR. Except for generating
- // non-relocatable device code, where we generate fat binary for device
- // code and pass to host in Backend phase.
- if (CudaDeviceActions.empty())
- return ABRT_Success;
-
- assert(((CurPhase == phases::Link && Relocatable) ||
- CudaDeviceActions.size() == GpuArchList.size()) &&
- "Expecting one action per GPU architecture.");
- assert(!CompileHostOnly &&
- "Not expecting HIP actions in host-only compilation.");
-
- bool ShouldLink = !EmitReloc || !*EmitReloc;
-
- if (!Relocatable && CurPhase == phases::Backend && !EmitLLVM &&
- !EmitAsm && ShouldLink) {
- // If we are in backend phase, we attempt to generate the fat binary.
- // We compile each arch to IR and use a link action to generate code
- // object containing ISA. Then we use a special "link" action to create
- // a fat binary containing all the code objects for different GPU's.
- // The fat binary is then an input to the host action.
- bool ExplicitOffloadLTO = Args.hasArg(options::OPT_foffload_lto,
- options::OPT_foffload_lto_EQ);
- for (unsigned I = 0, E = GpuArchList.size(); I != E; ++I) {
- if (ExplicitOffloadLTO &&
- ToolChains[I]->isUsingLTO(Args, AssociatedOffloadKind)) {
- // When LTO is enabled, skip the backend and assemble phases and
- // use lld to link the bitcode.
- ActionList AL;
- AL.push_back(CudaDeviceActions[I]);
- // Create a link action to link device IR with device library
- // and generate ISA.
- CudaDeviceActions[I] =
- C.MakeAction<LinkJobAction>(AL, types::TY_Image);
- } else {
- // When LTO is not enabled, we follow the conventional
- // compiler phases, including backend and assemble phases.
- ActionList AL;
- Action *BackendAction = nullptr;
- if (ToolChains[I]->getTriple().isSPIRV() ||
- (ToolChains[I]->getTriple().isAMDGCN() &&
- GpuArchList[I].ArchName == StringRef("amdgcnspirv"))) {
- // Emit LLVM bitcode for SPIR-V targets. SPIR-V device tool chain
- // (HIPSPVToolChain or HIPAMDToolChain) runs post-link LLVM IR
- // passes.
- types::ID Output = Args.hasArg(options::OPT_S)
- ? types::TY_LLVM_IR
- : types::TY_LLVM_BC;
- BackendAction =
- C.MakeAction<BackendJobAction>(CudaDeviceActions[I], Output);
- } else {
- BackendAction = C.getDriver().ConstructPhaseAction(
- C, Args, phases::Backend, CudaDeviceActions[I],
- AssociatedOffloadKind, LTOK_None);
- }
- auto AssembleAction = C.getDriver().ConstructPhaseAction(
- C, Args, phases::Assemble, BackendAction,
- AssociatedOffloadKind);
- AL.push_back(AssembleAction);
- // Create a link action to link device IR with device library
- // and generate ISA.
- CudaDeviceActions[I] =
- C.MakeAction<LinkJobAction>(AL, types::TY_Image);
- }
-
- // OffloadingActionBuilder propagates device arch until an offload
- // action. Since the next action for creating fatbin does
- // not have device arch, whereas the above link action and its input
- // have device arch, an offload action is needed to stop the null
- // device arch of the next action being propagated to the above link
- // action.
- OffloadAction::DeviceDependences DDep;
- DDep.add(*CudaDeviceActions[I], *ToolChains[I], GpuArchList[I],
- AssociatedOffloadKind);
- CudaDeviceActions[I] = C.MakeAction<OffloadAction>(
- DDep, CudaDeviceActions[I]->getType());
- }
-
- if (!CompileDeviceOnly || !BundleOutput || *BundleOutput) {
- // Create HIP fat binary with a special "link" action.
- CudaFatBinary = C.MakeAction<LinkJobAction>(CudaDeviceActions,
- types::TY_HIP_FATBIN);
-
- if (!CompileDeviceOnly) {
- DA.add(*CudaFatBinary, *FatBinaryToolChain, /*BA=*/{},
- AssociatedOffloadKind);
- // Clear the fat binary, it is already a dependence to an host
- // action.
- CudaFatBinary = nullptr;
- }
-
- // Remove the CUDA actions as they are already connected to an host
- // action or fat binary.
- CudaDeviceActions.clear();
- }
-
- return CompileDeviceOnly ? ABRT_Ignore_Host : ABRT_Success;
- } else if (CurPhase == phases::Link) {
- if (!ShouldLink)
- return ABRT_Success;
- // Save CudaDeviceActions to DeviceLinkerInputs for each GPU subarch.
- // This happens to each device action originated from each input file.
- // Later on, device actions in DeviceLinkerInputs are used to create
- // device link actions in appendLinkDependences and the created device
- // link actions are passed to the offload action as device dependence.
- DeviceLinkerInputs.resize(CudaDeviceActions.size());
- auto LI = DeviceLinkerInputs.begin();
- for (auto *A : CudaDeviceActions) {
- LI->push_back(A);
- ++LI;
- }
-
- // We will pass the device action as a host dependence, so we don't
- // need to do anything else with them.
- CudaDeviceActions.clear();
- return CompileDeviceOnly ? ABRT_Ignore_Host : ABRT_Success;
- }
-
- // By default, we produce an action for each device arch.
- for (unsigned I = 0, E = CudaDeviceActions.size(); I != E; ++I)
- CudaDeviceActions[I] = C.getDriver().ConstructPhaseAction(
- C, Args, CurPhase, CudaDeviceActions[I], AssociatedOffloadKind,
- ToolChains[I]->getLTOMode(Args, AssociatedOffloadKind));
-
- if (CompileDeviceOnly && CurPhase == FinalPhase && BundleOutput &&
- *BundleOutput) {
- for (unsigned I = 0, E = GpuArchList.size(); I != E; ++I) {
- OffloadAction::DeviceDependences DDep;
- DDep.add(*CudaDeviceActions[I], *ToolChains[I], GpuArchList[I],
- AssociatedOffloadKind);
- CudaDeviceActions[I] = C.MakeAction<OffloadAction>(
- DDep, CudaDeviceActions[I]->getType());
- }
- CudaFatBinary =
- C.MakeAction<OffloadBundlingJobAction>(CudaDeviceActions);
- CudaDeviceActions.clear();
- }
-
- return (CompileDeviceOnly &&
- (CurPhase == FinalPhase ||
- (!ShouldLink && CurPhase == phases::Assemble)))
- ? ABRT_Ignore_Host
- : ABRT_Success;
- }
-
- void appendLinkDeviceActions(ActionList &AL) override {
- if (DeviceLinkerInputs.size() == 0)
- return;
-
- assert(DeviceLinkerInputs.size() == GpuArchList.size() &&
- "Linker inputs and GPU arch list sizes do not match.");
-
- ActionList Actions;
- unsigned I = 0;
- // Append a new link action for each device.
- // Each entry in DeviceLinkerInputs corresponds to a GPU arch.
- for (auto &LI : DeviceLinkerInputs) {
-
- types::ID Output = Args.hasArg(options::OPT_emit_llvm)
- ? types::TY_LLVM_BC
- : types::TY_Image;
-
- auto *DeviceLinkAction = C.MakeAction<LinkJobAction>(LI, Output);
- // Linking all inputs for the current GPU arch.
- // LI contains all the inputs for the linker.
- OffloadAction::DeviceDependences DeviceLinkDeps;
- DeviceLinkDeps.add(*DeviceLinkAction, *ToolChains[I], GpuArchList[I],
- AssociatedOffloadKind);
- Actions.push_back(C.MakeAction<OffloadAction>(
- DeviceLinkDeps, DeviceLinkAction->getType()));
- ++I;
- }
- DeviceLinkerInputs.clear();
-
- // If emitting LLVM, do not generate final host/device compilation action
- if (Args.hasArg(options::OPT_emit_llvm)) {
- AL.append(Actions);
- return;
- }
-
- // Create a host object from all the device images by embedding them
- // in a fat binary for mixed host-device compilation. For device-only
- // compilation, creates a fat binary.
- OffloadAction::DeviceDependences DDeps;
- if (!CompileDeviceOnly || !BundleOutput || *BundleOutput) {
- auto *TopDeviceLinkAction = C.MakeAction<LinkJobAction>(
- Actions,
- CompileDeviceOnly ? types::TY_HIP_FATBIN : types::TY_Object);
- DDeps.add(*TopDeviceLinkAction, *FatBinaryToolChain, /*BA=*/{},
- AssociatedOffloadKind);
- // Offload the host object to the host linker.
- AL.push_back(
- C.MakeAction<OffloadAction>(DDeps, TopDeviceLinkAction->getType()));
- } else {
- AL.append(Actions);
- }
- }
-
- Action* appendLinkHostActions(ActionList &AL) override { return AL.back(); }
-
- void appendLinkDependences(OffloadAction::DeviceDependences &DA) override {}
- };
-
- ///
- /// TODO: Add the implementation for other specialized builders here.
- ///
-
- /// Specialized builders being used by this offloading action builder.
- SmallVector<DeviceActionBuilder *, 4> SpecializedBuilders;
-
- /// Flag set to true if all valid builders allow file bundling/unbundling.
- bool CanUseBundler;
-
- /// Flag set to false if an argument turns off bundling.
- bool ShouldUseBundler;
-
-public:
- OffloadingActionBuilder(Compilation &C, DerivedArgList &Args,
- const InputList &Inputs)
- : C(C) {
- // Create a specialized builder for each device toolchain.
-
- IsValid = true;
-
- // Create a specialized builder for CUDA.
- SpecializedBuilders.push_back(new CudaActionBuilder(C, Args, Inputs));
-
- // Create a specialized builder for HIP.
- SpecializedBuilders.push_back(new HIPActionBuilder(C, Args, Inputs));
-
- //
- // TODO: Build other specialized builders here.
- //
-
- // Initialize all the builders, keeping track of errors. If all valid
- // builders agree that we can use bundling, set the flag to true.
- unsigned ValidBuilders = 0u;
- unsigned ValidBuildersSupportingBundling = 0u;
- for (auto *SB : SpecializedBuilders) {
- IsValid = IsValid && !SB->initialize();
-
- // Update the counters if the builder is valid.
- if (SB->isValid()) {
- ++ValidBuilders;
- if (SB->canUseBundlerUnbundler())
- ++ValidBuildersSupportingBundling;
- }
- }
- CanUseBundler =
- ValidBuilders && ValidBuilders == ValidBuildersSupportingBundling;
-
- ShouldUseBundler = Args.hasFlag(options::OPT_gpu_bundle_output,
- options::OPT_no_gpu_bundle_output, true);
- }
-
- ~OffloadingActionBuilder() {
- for (auto *SB : SpecializedBuilders)
- delete SB;
- }
-
- /// Record a host action and its originating input argument.
- void recordHostAction(Action *HostAction, const Arg *InputArg) {
- assert(HostAction && "Invalid host action");
- assert(InputArg && "Invalid input argument");
- auto Loc = HostActionToInputArgMap.try_emplace(HostAction, InputArg).first;
- assert(Loc->second == InputArg &&
- "host action mapped to multiple input arguments");
- (void)Loc;
- }
-
- /// Generate an action that adds device dependences (if any) to a host action.
- /// If no device dependence actions exist, just return the host action \a
- /// HostAction. If an error is found or if no builder requires the host action
- /// to be generated, return nullptr.
- Action *
- addDeviceDependencesToHostAction(Action *HostAction, const Arg *InputArg,
- phases::ID CurPhase, phases::ID FinalPhase,
- DeviceActionBuilder::PhasesTy &Phases) {
- if (!IsValid)
- return nullptr;
-
- if (SpecializedBuilders.empty())
- return HostAction;
-
- assert(HostAction && "Invalid host action!");
- recordHostAction(HostAction, InputArg);
-
- OffloadAction::DeviceDependences DDeps;
- // Check if all the programming models agree we should not emit the host
- // action. Also, keep track of the offloading kinds employed.
- auto &OffloadKind = InputArgToOffloadKindMap[InputArg];
- unsigned InactiveBuilders = 0u;
- unsigned IgnoringBuilders = 0u;
- for (auto *SB : SpecializedBuilders) {
- if (!SB->isValid()) {
- ++InactiveBuilders;
- continue;
- }
- auto RetCode =
- SB->getDeviceDependences(DDeps, CurPhase, FinalPhase, Phases);
-
- // If the builder explicitly says the host action should be ignored,
- // we need to increment the variable that tracks the builders that request
- // the host object to be ignored.
- if (RetCode == DeviceActionBuilder::ABRT_Ignore_Host)
- ++IgnoringBuilders;
-
- // Unless the builder was inactive for this action, we have to record the
- // offload kind because the host will have to use it.
- if (RetCode != DeviceActionBuilder::ABRT_Inactive)
- OffloadKind |= SB->getAssociatedOffloadKind();
- }
-
- // If all builders agree that the host object should be ignored, just return
- // nullptr.
- if (IgnoringBuilders &&
- SpecializedBuilders.size() == (InactiveBuilders + IgnoringBuilders))
- return nullptr;
-
- if (DDeps.getActions().empty())
- return HostAction;
-
- // We have dependences we need to bundle together. We use an offload action
- // for that.
- OffloadAction::HostDependence HDep(
- *HostAction, *C.getSingleOffloadToolChain<Action::OFK_Host>(),
- /*BA=*/{}, DDeps);
- return C.MakeAction<OffloadAction>(HDep, DDeps);
- }
-
- /// Generate an action that adds a host dependence to a device action. The
- /// results will be kept in this action builder. Return true if an error was
- /// found.
- bool addHostDependenceToDeviceActions(Action *&HostAction,
- const Arg *InputArg) {
- if (!IsValid)
- return true;
-
- recordHostAction(HostAction, InputArg);
-
- // If we are supporting bundling/unbundling and the current action is an
- // input action of non-source file, we replace the host action by the
- // unbundling action. The bundler tool has the logic to detect if an input
- // is a bundle or not and if the input is not a bundle it assumes it is a
- // host file. Therefore it is safe to create an unbundling action even if
- // the input is not a bundle.
- if (CanUseBundler && isa<InputAction>(HostAction) &&
- InputArg->getOption().getKind() == llvm::opt::Option::InputClass &&
- (!types::isSrcFile(HostAction->getType()) ||
- HostAction->getType() == types::TY_PP_HIP)) {
- auto UnbundlingHostAction =
- C.MakeAction<OffloadUnbundlingJobAction>(HostAction);
- UnbundlingHostAction->registerDependentActionInfo(
- C.getSingleOffloadToolChain<Action::OFK_Host>(),
- /*BA=*/{}, Action::OFK_Host);
- HostAction = UnbundlingHostAction;
- recordHostAction(HostAction, InputArg);
- }
-
- assert(HostAction && "Invalid host action!");
-
- // Register the offload kinds that are used.
- auto &OffloadKind = InputArgToOffloadKindMap[InputArg];
- for (auto *SB : SpecializedBuilders) {
- if (!SB->isValid())
- continue;
-
- auto RetCode = SB->addDeviceDependences(HostAction);
-
- // Host dependences for device actions are not compatible with that same
- // action being ignored.
- assert(RetCode != DeviceActionBuilder::ABRT_Ignore_Host &&
- "Host dependence not expected to be ignored.!");
-
- // Unless the builder was inactive for this action, we have to record the
- // offload kind because the host will have to use it.
- if (RetCode != DeviceActionBuilder::ABRT_Inactive)
- OffloadKind |= SB->getAssociatedOffloadKind();
- }
-
- // Do not use unbundler if the Host does not depend on device action.
- if (OffloadKind == Action::OFK_None && CanUseBundler)
- if (auto *UA = dyn_cast<OffloadUnbundlingJobAction>(HostAction))
- HostAction = UA->getInputs().back();
-
- return false;
- }
-
- /// Add the offloading top level actions to the provided action list. This
- /// function can replace the host action by a bundling action if the
- /// programming models allow it.
- bool appendTopLevelActions(ActionList &AL, Action *HostAction,
- const Arg *InputArg) {
- if (HostAction)
- recordHostAction(HostAction, InputArg);
-
- // Get the device actions to be appended.
- ActionList OffloadAL;
- for (auto *SB : SpecializedBuilders) {
- if (!SB->isValid())
- continue;
- SB->appendTopLevelActions(OffloadAL);
- }
-
- // If we can and should use the bundler, replace the host action by the
- // bundling one in the resulting list. Otherwise, just append the device
- // actions. For device only compilation, HostAction is a null pointer,
- // therefore only do this when HostAction is not a null pointer.
- if (CanUseBundler && ShouldUseBundler && HostAction &&
- HostAction->getType() != types::TY_Nothing && !OffloadAL.empty()) {
- // Add the host action to the list in order to create the bundling action.
- OffloadAL.push_back(HostAction);
-
- // We expect that the host action was just appended to the action list
- // before this method was called.
- assert(HostAction == AL.back() && "Host action not in the list??");
- HostAction = C.MakeAction<OffloadBundlingJobAction>(OffloadAL);
- recordHostAction(HostAction, InputArg);
- AL.back() = HostAction;
- } else
- AL.append(OffloadAL.begin(), OffloadAL.end());
-
- // Propagate to the current host action (if any) the offload information
- // associated with the current input.
- if (HostAction)
- HostAction->propagateHostOffloadInfo(InputArgToOffloadKindMap[InputArg],
- /*BA=*/{});
- return false;
- }
-
- void appendDeviceLinkActions(ActionList &AL) {
- for (DeviceActionBuilder *SB : SpecializedBuilders) {
- if (!SB->isValid())
- continue;
- SB->appendLinkDeviceActions(AL);
- }
- }
-
- Action *makeHostLinkAction() {
- // Build a list of device linking actions.
- ActionList DeviceAL;
- appendDeviceLinkActions(DeviceAL);
- if (DeviceAL.empty())
- return nullptr;
-
- // Let builders add host linking actions.
- Action* HA = nullptr;
- for (DeviceActionBuilder *SB : SpecializedBuilders) {
- if (!SB->isValid())
- continue;
- HA = SB->appendLinkHostActions(DeviceAL);
- // This created host action has no originating input argument, therefore
- // needs to set its offloading kind directly.
- if (HA)
- HA->propagateHostOffloadInfo(SB->getAssociatedOffloadKind(),
- /*BA=*/{});
- }
- return HA;
- }
-
- /// Processes the host linker action. This currently consists of replacing it
- /// with an offload action if there are device link objects and propagate to
- /// the host action all the offload kinds used in the current compilation. The
- /// resulting action is returned.
- Action *processHostLinkAction(Action *HostAction) {
- // Add all the dependences from the device linking actions.
- OffloadAction::DeviceDependences DDeps;
- for (auto *SB : SpecializedBuilders) {
- if (!SB->isValid())
- continue;
-
- SB->appendLinkDependences(DDeps);
- }
-
- // Calculate all the offload kinds used in the current compilation.
- unsigned ActiveOffloadKinds = 0u;
- for (auto &I : InputArgToOffloadKindMap)
- ActiveOffloadKinds |= I.second;
-
- // If we don't have device dependencies, we don't have to create an offload
- // action.
- if (DDeps.getActions().empty()) {
- // Set all the active offloading kinds to the link action. Given that it
- // is a link action it is assumed to depend on all actions generated so
- // far.
- HostAction->setHostOffloadInfo(ActiveOffloadKinds,
- /*BA=*/{});
- // Propagate active offloading kinds for each input to the link action.
- // Each input may have different active offloading kind.
- for (auto *A : HostAction->inputs()) {
- auto ArgLoc = HostActionToInputArgMap.find(A);
- if (ArgLoc == HostActionToInputArgMap.end())
- continue;
- auto OFKLoc = InputArgToOffloadKindMap.find(ArgLoc->second);
- if (OFKLoc == InputArgToOffloadKindMap.end())
- continue;
- A->propagateHostOffloadInfo(OFKLoc->second, /*BA=*/{});
- }
- return HostAction;
- }
-
- // Create the offload action with all dependences. When an offload action
- // is created the kinds are propagated to the host action, so we don't have
- // to do that explicitly here.
- OffloadAction::HostDependence HDep(
- *HostAction, *C.getSingleOffloadToolChain<Action::OFK_Host>(),
- /*BA=*/{}, ActiveOffloadKinds);
- return C.MakeAction<OffloadAction>(HDep, DDeps);
- }
-};
-} // anonymous namespace.
-
void Driver::handleArguments(Compilation &C, DerivedArgList &Args,
const InputList &Inputs,
ActionList &Actions) const {
@@ -4476,10 +3492,9 @@ void Driver::handleArguments(Compilation &C, DerivedArgList &Args,
/// HIP non-RDC \c -S for AMDGCN: emit host and device assembly separately and
/// bundle with \c clang-offload-bundler (new offload driver), instead of
/// \c llvm-offload-binary / \c clang-linker-wrapper fatbin embedding.
-static bool
-shouldBundleHIPAsmWithNewDriver(const Compilation &C,
- const llvm::opt::DerivedArgList &Args,
- const Driver &D) {
+static bool shouldBundleHIPAsm(const Compilation &C,
+ const llvm::opt::DerivedArgList &Args,
+ const Driver &D) {
if (!C.isOffloadingHostKind(Action::OFK_HIP) ||
!Args.hasArg(options::OPT_S) || Args.hasArg(options::OPT_emit_llvm) ||
D.offloadDeviceOnly() ||
@@ -4509,15 +3524,15 @@ void Driver::BuildActions(Compilation &C, DerivedArgList &Args,
handleArguments(C, Args, Inputs, Actions);
- bool UseNewOffloadingDriver = Args.hasFlag(
- options::OPT_offload_new_driver, options::OPT_no_offload_new_driver,
- C.getActiveOffloadKinds() != Action::OFK_None);
-
- // Builder to be used to build offloading actions.
- std::unique_ptr<OffloadingActionBuilder> OffloadBuilder =
- !UseNewOffloadingDriver
- ? std::make_unique<OffloadingActionBuilder>(C, Args, Inputs)
- : nullptr;
+ // The legacy offloading driver has been removed; the new driver is always
+ // used. Accept the old toggles as no-ops, but warn that disabling it no
+ // longer has any effect.
+ if (Arg *A = Args.getLastArg(options::OPT_no_offload_new_driver))
+ Diag(clang::diag::warn_drv_deprecated_custom)
+ << A->getAsString(Args)
+ << "the legacy offloading driver has been removed";
+ Args.ClaimAllArgs(options::OPT_no_offload_new_driver);
+ Args.ClaimAllArgs(options::OPT_offload_new_driver);
// Construct the actions to perform.
ExtractAPIJobAction *ExtractAPIAction = nullptr;
@@ -4545,18 +3560,7 @@ void Driver::BuildActions(Compilation &C, DerivedArgList &Args,
ActionList HIPAsmDeviceActions;
- // Use the current host action in any of the offloading actions, if
- // required.
- if (!UseNewOffloadingDriver)
- if (OffloadBuilder->addHostDependenceToDeviceActions(Current, InputArg))
- break;
-
for (phases::ID Phase : PL) {
-
- // Add any offload action the host action depends on.
- if (!UseNewOffloadingDriver)
- Current = OffloadBuilder->addDeviceDependencesToHostAction(
- Current, InputArg, Phase, PL.back(), FullPL);
if (!Current)
break;
@@ -4609,14 +3613,8 @@ void Driver::BuildActions(Compilation &C, DerivedArgList &Args,
// Try to build the offloading actions and add the result as a dependency
// to the host.
- if (UseNewOffloadingDriver)
- Current = BuildOffloadingActions(C, Args, I, CUID, Current,
- &HIPAsmDeviceActions);
- // Use the current host action in any of the offloading actions, if
- // required.
- else if (OffloadBuilder->addHostDependenceToDeviceActions(Current,
- InputArg))
- break;
+ Current = BuildOffloadingActions(C, Args, I, CUID, Current,
+ &HIPAsmDeviceActions);
if (Current->getType() == types::TY_Nothing)
break;
@@ -4625,7 +3623,6 @@ void Driver::BuildActions(Compilation &C, DerivedArgList &Args,
// HIP non-RDC -S (AMDGCN): bundle host and device assembly like the
// classic driver instead of embedding a fat binary in host asm.
if (Current && !HIPAsmDeviceActions.empty()) {
- assert(UseNewOffloadingDriver && "unexpected HIP asm bundle list");
ActionList BundleInputs;
BundleInputs.append(HIPAsmDeviceActions);
BundleInputs.push_back(Current);
@@ -4633,35 +3630,20 @@ void Driver::BuildActions(Compilation &C, DerivedArgList &Args,
}
// If we ended with something, add to the output list.
- if (Current)
+ if (Current) {
Actions.push_back(Current);
-
- // Add any top level actions generated for offloading.
- if (!UseNewOffloadingDriver)
- OffloadBuilder->appendTopLevelActions(Actions, Current, InputArg);
- else if (Current)
Current->propagateHostOffloadInfo(C.getActiveOffloadKinds(),
/*BA=*/{});
+ }
}
// Add a link action if necessary.
-
- if (LinkerInputs.empty()) {
- Arg *FinalPhaseArg;
- if (getFinalPhase(Args, &FinalPhaseArg) == phases::Link)
- if (!UseNewOffloadingDriver)
- OffloadBuilder->appendDeviceLinkActions(Actions);
- }
-
if (!LinkerInputs.empty()) {
- if (!UseNewOffloadingDriver)
- if (Action *Wrapper = OffloadBuilder->makeHostLinkAction())
- LinkerInputs.push_back(Wrapper);
Action *LA;
// Check if this Linker Job should emit a static library.
if (ShouldEmitStaticLibrary(Args)) {
LA = C.MakeAction<StaticLibJobAction>(LinkerInputs, types::TY_Image);
- } else if (UseNewOffloadingDriver ||
+ } else if (C.getActiveOffloadKinds() != Action::OFK_None ||
Args.hasArg(options::OPT_offload_link)) {
LA = C.MakeAction<LinkerWrapperJobAction>(LinkerInputs, types::TY_Image);
LA->propagateHostOffloadInfo(C.getActiveOffloadKinds(),
@@ -4676,8 +3658,6 @@ void Driver::BuildActions(Compilation &C, DerivedArgList &Args,
: types::TY_Image;
LA = C.MakeAction<LinkJobAction>(LinkerInputs, LT);
}
- if (!UseNewOffloadingDriver)
- LA = OffloadBuilder->processHostLinkAction(LA);
Actions.push_back(LA);
}
@@ -5160,9 +4140,13 @@ Driver::BuildOffloadingActions(Compilation &C, llvm::opt::DerivedArgList &Args,
return A->getType() != types::TY_Image;
}));
- // All kinds exit now in device-only mode except for non-RDC mode HIP.
+ // All kinds exit now in device-only mode except for non-RDC mode HIP. If no
+ // device dependences were produced (e.g. an invalid offload architecture was
+ // diagnosed) fall back to the host action instead of an empty offload action.
if (offloadDeviceOnly() && !ShouldBundleHIP)
- return C.MakeAction<OffloadAction>(DDeps, types::TY_Nothing);
+ return DDeps.getActions().empty()
+ ? HostAction
+ : C.MakeAction<OffloadAction>(DDeps, types::TY_Nothing);
if (OffloadActions.empty())
return HostAction;
@@ -5187,8 +4171,7 @@ Driver::BuildOffloadingActions(Compilation &C, llvm::opt::DerivedArgList &Args,
} else if (HIPNoRDC) {
// Host + device assembly: defer to clang-offload-bundler (see
// BuildActions).
- if (HIPAsmBundleDeviceOut &&
- shouldBundleHIPAsmWithNewDriver(C, Args, C.getDriver())) {
+ if (HIPAsmBundleDeviceOut && shouldBundleHIPAsm(C, Args, C.getDriver())) {
for (Action *OA : OffloadActions)
HIPAsmBundleDeviceOut->push_back(OA);
return HostAction;
@@ -6734,11 +5717,7 @@ const char *Driver::GetNamedOutputPath(Compilation &C, const JobAction &JA,
// (generated in the compile phase.)
const ToolChain *TC = JA.getOffloadingToolChain();
return isa<CompileJobAction>(JA) &&
- ((JA.getOffloadingDeviceKind() == Action::OFK_HIP &&
- (Args.hasFlag(options::OPT_fgpu_rdc, options::OPT_fno_gpu_rdc,
- false) ||
- Args.hasFlag(options::OPT_offload_new_driver,
- options::OPT_no_offload_new_driver, true))) ||
+ (JA.getOffloadingDeviceKind() == Action::OFK_HIP ||
(JA.getOffloadingDeviceKind() == Action::OFK_OpenMP && TC &&
TC->getTriple().isAMDGPU()));
};
diff --git a/clang/lib/Driver/ToolChains/Clang.cpp b/clang/lib/Driver/ToolChains/Clang.cpp
index 1178f625d1172..39b25fda34304 100644
--- a/clang/lib/Driver/ToolChains/Clang.cpp
+++ b/clang/lib/Driver/ToolChains/Clang.cpp
@@ -5195,10 +5195,7 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
bool IsHostOffloadingAction =
JA.isHostOffloading(Action::OFK_OpenMP) ||
JA.isHostOffloading(Action::OFK_SYCL) ||
- (JA.isHostOffloading(C.getActiveOffloadKinds()) &&
- Args.hasFlag(options::OPT_offload_new_driver,
- options::OPT_no_offload_new_driver,
- C.getActiveOffloadKinds() != Action::OFK_None));
+ (JA.isHostOffloading(C.getActiveOffloadKinds()));
bool IsRDCMode =
Args.hasFlag(options::OPT_fgpu_rdc, options::OPT_fno_gpu_rdc, false);
@@ -5561,9 +5558,6 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
const Arg *LTOArg = Args.getLastArg(options::OPT_foffload_lto,
options::OPT_foffload_lto_EQ);
if (IsDeviceOffloadAction && !JA.isDeviceOffloading(Action::OFK_OpenMP) &&
- !Args.hasFlag(options::OPT_offload_new_driver,
- options::OPT_no_offload_new_driver,
- C.getActiveOffloadKinds() != Action::OFK_None) &&
!Triple.isAMDGPU() && !Triple.isSPIRV()) {
D.Diag(diag::err_drv_unsupported_opt_for_target)
<< (LTOArg ? LTOArg->getAsString(Args) : "-foffload-lto")
@@ -7184,13 +7178,8 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
// new driver. Otherwise, check if we should forward the new driver to change
// offloading code generation.
if (Args.hasFlag(options::OPT_foffload_via_llvm,
- options::OPT_fno_offload_via_llvm, false)) {
- CmdArgs.append({"--offload-new-driver", "-foffload-via-llvm"});
- } else if (Args.hasFlag(options::OPT_offload_new_driver,
- options::OPT_no_offload_new_driver,
- C.getActiveOffloadKinds() != Action::OFK_None)) {
- CmdArgs.push_back("--offload-new-driver");
- }
+ options::OPT_fno_offload_via_llvm, false))
+ CmdArgs.push_back("-foffload-via-llvm");
const XRayArgs &XRay = TC.getXRayArgs(Args);
XRay.addArgs(TC, Args, CmdArgs, InputType);
diff --git a/clang/lib/Driver/ToolChains/Cuda.cpp b/clang/lib/Driver/ToolChains/Cuda.cpp
index 9590ff976275c..1f18bd014c46f 100644
--- a/clang/lib/Driver/ToolChains/Cuda.cpp
+++ b/clang/lib/Driver/ToolChains/Cuda.cpp
@@ -513,9 +513,7 @@ void NVPTX::Assembler::ConstructJob(Compilation &C, const JobAction &JA,
}
static bool shouldIncludePTX(const ArgList &Args, StringRef InputArch) {
- // The new driver does not include PTX by default to avoid overhead.
- bool includePTX = !Args.hasFlag(options::OPT_offload_new_driver,
- options::OPT_no_offload_new_driver, true);
+ bool includePTX = true;
for (Arg *A : Args.filtered(options::OPT_cuda_include_ptx_EQ,
options::OPT_no_cuda_include_ptx_EQ)) {
A->claim();
diff --git a/clang/lib/Driver/ToolChains/HIPSPV.cpp b/clang/lib/Driver/ToolChains/HIPSPV.cpp
index d6900c767d1f7..a425aedd74ec2 100644
--- a/clang/lib/Driver/ToolChains/HIPSPV.cpp
+++ b/clang/lib/Driver/ToolChains/HIPSPV.cpp
@@ -338,13 +338,3 @@ void HIPSPVToolChain::adjustDebugInfoKind(
// TODO: Enable debug info when the SPIR-V backend arrives.
DebugInfoKind = llvm::codegenoptions::NoDebugInfo;
}
-
-LTOKind HIPSPVToolChain::getLTOMode(const llvm::opt::ArgList &Args,
- Action::OffloadKind Kind) const {
- // The old offload driver pipeline does not support LTO output types. Only
- // default to LTO with the new driver.
- if (!Args.hasFlag(options::OPT_offload_new_driver,
- options::OPT_no_offload_new_driver, true))
- return LTOK_None;
- return ToolChain::getLTOMode(Args, Kind);
-}
diff --git a/clang/lib/Driver/ToolChains/HIPSPV.h b/clang/lib/Driver/ToolChains/HIPSPV.h
index 337c9c9993876..842b47fb87d7a 100644
--- a/clang/lib/Driver/ToolChains/HIPSPV.h
+++ b/clang/lib/Driver/ToolChains/HIPSPV.h
@@ -97,9 +97,6 @@ class LLVM_LIBRARY_VISIBILITY HIPSPVToolChain final : public ToolChain {
bool SupportsProfiling() const override { return false; }
LTOKind getDefaultLTOMode() const override { return LTOK_Full; }
- LTOKind
- getLTOMode(const llvm::opt::ArgList &Args,
- Action::OffloadKind Kind = Action::OFK_None) const override;
const ToolChain *HostTC = nullptr;
diff --git a/clang/test/CodeGenCUDA/anon-ns.cu b/clang/test/CodeGenCUDA/anon-ns.cu
index d931f31d0207c..868df2a1291f5 100644
--- a/clang/test/CodeGenCUDA/anon-ns.cu
+++ b/clang/test/CodeGenCUDA/anon-ns.cu
@@ -50,12 +50,13 @@
// COMMON-DAG: @[[VCSTR:.*]] = {{.*}} c"[[VC]]\00"
// COMMON-DAG: @[[VTSTR:.*]] = {{.*}} c"[[VT]]\00"
-// COMMON-DAG: call i32 @__{{.*}}RegisterFunction({{.*}}@[[KERNSTR]]
-// COMMON-DAG: call i32 @__{{.*}}RegisterFunction({{.*}}@[[KTXSTR]]
-// COMMON-DAG: call i32 @__{{.*}}RegisterFunction({{.*}}@[[KTLSTR]]
-// HIP-DAG: call void @__{{.*}}RegisterManagedVar({{.*}}@[[VMSTR]]
-// COMMON-DAG: call void @__{{.*}}RegisterVar({{.*}}@[[VCSTR]]
-// COMMON-DAG: call void @__{{.*}}RegisterVar({{.*}}@[[VTSTR]]
+// The host exports symbols via offloading entries referencing the name strings.
+// COMMON-DAG: @.offloading.entry{{.*}} = {{.*}}@[[KERNSTR]]
+// COMMON-DAG: @.offloading.entry{{.*}} = {{.*}}@[[KTXSTR]]
+// COMMON-DAG: @.offloading.entry{{.*}} = {{.*}}@[[KTLSTR]]
+// HIP-DAG: @.offloading.entry{{.*}} = {{.*}}@[[VMSTR]]
+// COMMON-DAG: @.offloading.entry{{.*}} = {{.*}}@[[VCSTR]]
+// COMMON-DAG: @.offloading.entry{{.*}} = {{.*}}@[[VTSTR]]
template <typename T>
__global__ void kt(T x) {}
diff --git a/clang/test/CodeGenCUDA/device-stub.cu b/clang/test/CodeGenCUDA/device-stub.cu
index 307ab190aa5be..f29e882f431e9 100644
--- a/clang/test/CodeGenCUDA/device-stub.cu
+++ b/clang/test/CodeGenCUDA/device-stub.cu
@@ -9,11 +9,6 @@
// RUN: | FileCheck -allow-deprecated-dag-overlap %s \
// RUN: -check-prefixes=NOGLOBALS,CUDANOGLOBALS
// RUN: %clang_cc1 -triple x86_64-linux-gnu -emit-llvm %s \
-// RUN: -target-sdk-version=8.0 -fgpu-rdc -fcuda-include-gpubinary %t \
-// RUN: -o - \
-// RUN: | FileCheck -allow-deprecated-dag-overlap %s \
-// RUN: --check-prefixes=ALL,LNX,RDC,CUDA,CUDARDC,CUDA-OLD
-// RUN: %clang_cc1 -triple x86_64-linux-gnu -emit-llvm %s \
// RUN: -target-sdk-version=8.0 -o - \
// RUN: | FileCheck -allow-deprecated-dag-overlap %s -check-prefix=NOGPUBIN
@@ -25,18 +20,10 @@
// RUN: -target-sdk-version=9.2 -fcuda-include-gpubinary %t -o - -DNOGLOBALS \
// RUN: | FileCheck -allow-deprecated-dag-overlap %s \
// RUN: --check-prefixes=NOGLOBALS,CUDANOGLOBALS
-// RUN: %clang_cc1 -triple x86_64-linux-gnu -emit-llvm %s \
-// RUN: -target-sdk-version=9.2 -fgpu-rdc -fcuda-include-gpubinary %t -o - \
-// RUN: | FileCheck %s -allow-deprecated-dag-overlap \
-// RUN: --check-prefixes=ALL,LNX,RDC,CUDA,CUDARDC,CUDA-NEW
// RUN: %clang_cc1 -triple x86_64-linux-gnu -emit-llvm %s -std=c++17 \
// RUN: -target-sdk-version=9.2 -fcuda-include-gpubinary %t -o - \
// RUN: | FileCheck %s -allow-deprecated-dag-overlap \
// RUN: --check-prefixes=ALL,LNX,NORDC,CUDA,CUDANORDC,CUDA-NEW,LNX_17,NORDC17
-// RUN: %clang_cc1 -triple x86_64-linux-gnu -emit-llvm %s -std=c++17 \
-// RUN: -target-sdk-version=9.2 -fgpu-rdc -fcuda-include-gpubinary %t -o - \
-// RUN: | FileCheck %s -allow-deprecated-dag-overlap \
-// RUN: --check-prefixes=ALL,LNX,RDC,CUDA,CUDARDC,CUDA-NEW,LNX_17,RDC17
// RUN: %clang_cc1 -triple x86_64-linux-gnu -emit-llvm %s \
// RUN: -target-sdk-version=9.2 -o - \
// RUN: | FileCheck -allow-deprecated-dag-overlap %s -check-prefix=NOGPUBIN
@@ -50,9 +37,6 @@
// RUN: %clang_cc1 -triple x86_64-linux-gnu -emit-llvm %s \
// RUN: -fcuda-include-gpubinary %t -o - -DNOGLOBALS -x hip \
// RUN: | FileCheck -allow-deprecated-dag-overlap %s -check-prefixes=NOGLOBALS,HIPNOGLOBALS
-// RUN: %clang_cc1 -triple x86_64-linux-gnu -emit-llvm %s \
-// RUN: -fgpu-rdc -fcuda-include-gpubinary %t -o - -x hip \
-// RUN: | FileCheck -allow-deprecated-dag-overlap %s --check-prefixes=ALL,LNX,RDC,HIP,HIPEF
// RUN: %clang_cc1 -cuid=123 -triple x86_64-linux-gnu -emit-llvm %s -o - -x hip\
// RUN: | FileCheck -allow-deprecated-dag-overlap %s -check-prefixes=ALL,LNX,NORDC,HIP,HIPNEF
@@ -64,34 +48,18 @@
// RUN: -o - -x hip\
// RUN: | FileCheck -allow-deprecated-dag-overlap %s --check-prefixes=ALL,WIN,HIP,HIPNEF
-// Verify that module IDs are distinct when the module source path is distinct.
-// RUN: rm -rf %t_distinct
-// RUN: mkdir -p %t_distinct
-// RUN: cp %s %t_distinct/filename1.cu
-// RUN: cp %s %t_distinct/filename2.cu
-// RUN: %clang_cc1 -triple x86_64-linux-gnu -emit-llvm %t_distinct/filename1.cu -I%S \
-// RUN: -target-sdk-version=8.0 -fgpu-rdc -fcuda-include-gpubinary %t \
-// RUN: -o - | grep __nv_module_id &> %t_module_id_1
-// RUN: %clang_cc1 -triple x86_64-linux-gnu -emit-llvm %t_distinct/filename2.cu -I%S \
-// RUN: -target-sdk-version=8.0 -fgpu-rdc -fcuda-include-gpubinary %t \
-// RUN: -o - | grep __nv_module_id &> %t_module_id_2
-// RUN: not diff %t_module_id_1 %t_module_id_2
-
#include "Inputs/cuda.h"
#ifndef NOGLOBALS
// NORDC-DAG: @device_var = internal global i32
-// RDC-DAG: @device_var = global i32
// WIN-DAG: @"?device_var@@3HA" = internal global i32
__device__ int device_var;
// NORDC-DAG: @constant_var = internal global i32
-// RDC-DAG: @constant_var = global i32
// WIN-DAG: @"?constant_var@@3HA" = internal global i32
__constant__ int constant_var;
// NORDC-DAG: @shared_var = internal global i32
-// RDC-DAG: @shared_var = global i32
// WIN-DAG: @"?shared_var@@3HA" = internal global i32
__shared__ int shared_var;
@@ -115,22 +83,17 @@ extern __constant__ int ext_constant_var;
// external device-side variables with definitions should generate
// definitions for the shadows.
// NORDC-DAG: @ext_device_var_def = internal global i32 undef,
-// RDC-DAG: @ext_device_var_def = global i32 undef,
// WIN-DAG: @"?ext_device_var_def@@3HA" = internal global i32 undef
extern __device__ int ext_device_var_def;
__device__ int ext_device_var_def = 1;
// NORDC-DAG: @ext_device_var_def = internal global i32 undef,
-// RDC-DAG: @ext_device_var_def = global i32 undef,
// WIN-DAG: @"?ext_constant_var_def@@3HA" = internal global i32 undef
__constant__ int ext_constant_var_def = 2;
#if __cplusplus > 201402L
// NORDC17: @inline_var = internal global i32 undef, comdat, align 4{{$}}
-// RDC17: @inline_var = linkonce_odr global i32 undef, comdat, align 4{{$}}
// NORDC17-NOT: @inline_var2 =
-// RDC17-NOT: @inline_var2 =
// NORDC17: @_ZN1C17member_inline_varE = internal constant i32 undef, comdat, align 4{{$}}
-// RDC17: @_ZN1C17member_inline_varE = linkonce_odr constant i32 undef, comdat, align 4{{$}}
// Check inline variable ODR-used by host is emitted on host and registered.
__device__ inline int inline_var = 3;
// Check inline variable not ODR-used by host is not emitted on host or registered.
@@ -177,7 +140,6 @@ __device__ void device_use() {
// HIPEF: @[[FATBIN:.*]] = private constant{{.*}} c"GPU binary would be here.",{{.*}}align 4096
// HIPNEF: @[[FATBIN:__hip_fatbin_[0-9a-f]+]] = external constant i8, section ".hip_fatbin"
// CUDANORDC-SAME: section ".nv_fatbin", align 8
-// CUDARDC-SAME: section "__nv_relfatbin", align 8
// * constant struct that wraps GPU binary
// ALL: @__[[PREFIX:cuda|hip]]_fatbin_wrapper = internal constant
// LNX-SAME: { i32, i32, ptr, ptr }
@@ -193,14 +155,8 @@ __device__ void device_use() {
// * variable to save GPU binary handle after initialization
// CUDANORDC: @__[[PREFIX]]_gpubin_handle = internal global ptr null
// HIPNEF: @__[[PREFIX]]_gpubin_handle_{{[0-9a-f]+}} = internal global ptr null, align 8
-// * constant unnamed string with NVModuleID
-// CUDARDC: [[MODULE_ID_GLOBAL:@.*]] = private constant
-// CUDARDC-SAME: c"[[MODULE_ID:.+]]\00", section "__nv_module_id", align 32
// * Make sure our constructor was added to global ctor list.
// LNX: @llvm.global_ctors = appending global {{.*}}@__[[PREFIX]]_module_ctor
-// * Alias to global symbol containing the NVModuleID.
-// CUDARDC: @__fatbinwrap[[MODULE_ID]] ={{.*}} alias { i32, i32, ptr, ptr }
-// CUDARDC-SAME: ptr @__[[PREFIX]]_fatbin_wrapper
// Test that we build the correct number of calls to cudaSetupArgument followed
// by a call to cudaLaunch.
@@ -275,11 +231,6 @@ void hostfunc(void) { kernelfunc<<<1, 1>>>(1, 1, 1); }
// CUDANORDC-NEXT: call i32 @atexit(ptr @__[[PREFIX]]_module_dtor)
// HIP-NEXT: call i32 @atexit(ptr @__[[PREFIX]]_module_dtor)
-// With relocatable device code we call __[[PREFIX]]RegisterLinkedBinary%NVModuleID%
-// CUDARDC: call{{.*}}__[[PREFIX]]RegisterLinkedBinary[[MODULE_ID]](
-// CUDARDC-SAME: __[[PREFIX]]_register_globals, {{.*}}__[[PREFIX]]_fatbin_wrapper
-// CUDARDC-SAME: [[MODULE_ID_GLOBAL]]
-
// Test that we've created destructor.
// CUDANORDC: define internal void @__[[PREFIX]]_module_dtor
// HIP: define internal void @__[[PREFIX]]_module_dtor
diff --git a/clang/test/CodeGenCUDA/device-var-linkage.cu b/clang/test/CodeGenCUDA/device-var-linkage.cu
index 4c57323d85f9d..ce43ed3095686 100644
--- a/clang/test/CodeGenCUDA/device-var-linkage.cu
+++ b/clang/test/CodeGenCUDA/device-var-linkage.cu
@@ -70,12 +70,21 @@ __device__ __host__ int fun1() {
;
}
-// HOST: hipRegisterVar({{.*}}@v1
-// HOST: hipRegisterVar({{.*}}@v2
-// HOST: hipRegisterManagedVar({{.*}}@v3
-// HOST-NOT: hipRegisterVar({{.*}}@ev1
-// HOST-NOT: hipRegisterVar({{.*}}@ev2
-// HOST-NOT: hipRegisterManagedVar({{.*}}@ev3
-// HOST: hipRegisterVar({{.*}}@_ZL3sv1
-// HOST: hipRegisterVar({{.*}}@_ZL3sv2
-// HOST: hipRegisterManagedVar({{.*}}@_ZL3sv3
+// Without RDC the host registers device variables with the runtime.
+// NORDC-H: hipRegisterVar({{.*}}@v1
+// NORDC-H: hipRegisterVar({{.*}}@v2
+// NORDC-H: hipRegisterManagedVar({{.*}}@v3
+// NORDC-H-NOT: hipRegisterVar({{.*}}@ev1
+// NORDC-H-NOT: hipRegisterVar({{.*}}@ev2
+// NORDC-H-NOT: hipRegisterManagedVar({{.*}}@ev3
+// NORDC-H: hipRegisterVar({{.*}}@_ZL3sv1
+// NORDC-H: hipRegisterVar({{.*}}@_ZL3sv2
+// NORDC-H: hipRegisterManagedVar({{.*}}@_ZL3sv3
+
+// With RDC the host emits offloading entries instead of runtime registration.
+// RDC-H-DAG: @.offloading.entry.v1
+// RDC-H-DAG: @.offloading.entry.v2
+// RDC-H-DAG: @.offloading.entry.v3
+// RDC-H-DAG: @.offloading.entry._ZL3sv1
+// RDC-H-DAG: @.offloading.entry._ZL3sv2
+// RDC-H-DAG: @.offloading.entry._ZL3sv3
diff --git a/clang/test/CodeGenCUDA/managed-var.cu b/clang/test/CodeGenCUDA/managed-var.cu
index 83376ea586a90..81554698d5726 100644
--- a/clang/test/CodeGenCUDA/managed-var.cu
+++ b/clang/test/CodeGenCUDA/managed-var.cu
@@ -31,7 +31,7 @@ struct vec {
// RDC-DAG: @x.managed = global i32 1
// NORDC-DAG: @x = internal externally_initialized global ptr null
// RDC-DAG: @x = externally_initialized global ptr null
-// HOST-DAG: @[[DEVNAMEX:[0-9]+]] = {{.*}}c"x\00"
+// NORDC-DAG: @[[DEVNAMEX:[0-9]+]] = {{.*}}c"x\00"
__managed__ int x = 1;
// DEV-DAG: @v.managed = addrspace(1) externally_initialized global [100 x %struct.vec] zeroinitializer, align 4
@@ -55,12 +55,15 @@ extern __managed__ int ex;
// HOST-DAG: @_ZL2sx.managed = internal global i32 1
// HOST-DAG: @_ZL2sx = internal externally_initialized global ptr null
// NORDC-DAG: @[[DEVNAMESX:[0-9]+]] = {{.*}}c"_ZL2sx\00"
-// RDC-DAG: @[[DEVNAMESX:[0-9]+]] = {{.*}}c"_ZL2sx.static.[[HASH:.*]]\00"
// POSTFIX: @_ZL2sx.static.[[HASH:.*]] = addrspace(1) externally_initialized global ptr addrspace(1) null
-// POSTFIX: @[[DEVNAMESX:[0-9]+]] = {{.*}}c"_ZL2sx.static.[[HASH]]\00"
+// POSTFIX: @.offloading.entry_name{{.*}} = {{.*}}c"_ZL2sx.static.[[HASH]]\00"
static __managed__ int sx = 1;
+// With RDC the host emits offloading entries instead of runtime registration.
+// RDC-DAG: @.offloading.entry.x = {{.*}}ptr @x.managed{{.*}}ptr @x
+// RDC-DAG: @.offloading.entry._ZL2sx.static.{{.*}} = {{.*}}ptr @_ZL2sx.managed{{.*}}ptr @_ZL2sx
+
// DEV-DAG: @llvm.compiler.used
// DEV-SAME-DAG: @x.managed
// DEV-SAME-DAG: @x
@@ -161,7 +164,8 @@ __device__ __host__ int load4() {
return ex;
}
-// HOST-DAG: __hipRegisterManagedVar({{.*}}, ptr @x, ptr @x.managed, ptr @[[DEVNAMEX]], i64 4, i32 4)
-// HOST-DAG: __hipRegisterManagedVar({{.*}}, ptr @_ZL2sx, ptr @_ZL2sx.managed, ptr @[[DEVNAMESX]]
-// HOST-NOT: __hipRegisterManagedVar({{.*}}, ptr @ex, ptr @ex.managed
-// HOST-DAG: declare void @__hipRegisterManagedVar(ptr, ptr, ptr, ptr, i64, i32)
+// Without RDC the host registers managed variables with the runtime.
+// NORDC-DAG: __hipRegisterManagedVar({{.*}}, ptr @x, ptr @x.managed, ptr @[[DEVNAMEX]], i64 4, i32 4)
+// NORDC-DAG: __hipRegisterManagedVar({{.*}}, ptr @_ZL2sx, ptr @_ZL2sx.managed, ptr @[[DEVNAMESX]]
+// NORDC-NOT: __hipRegisterManagedVar({{.*}}, ptr @ex, ptr @ex.managed
+// NORDC-DAG: declare void @__hipRegisterManagedVar(ptr, ptr, ptr, ptr, i64, i32)
diff --git a/clang/test/CodeGenCUDA/offloading-entries.cu b/clang/test/CodeGenCUDA/offloading-entries.cu
index 86ef3bcfa556b..f765ae3355793 100644
--- a/clang/test/CodeGenCUDA/offloading-entries.cu
+++ b/clang/test/CodeGenCUDA/offloading-entries.cu
@@ -1,18 +1,18 @@
// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --check-globals --global-value-regex ".offloading.entry.*" "managed.*"
// RUN: %clang_cc1 -std=c++11 -triple x86_64-unknown-linux-gnu -fgpu-rdc \
-// RUN: --offload-new-driver -emit-llvm -o - -x cuda %s | FileCheck \
+// RUN: -emit-llvm -o - -x cuda %s | FileCheck \
// RUN: --check-prefix=CUDA %s
// RUN: %clang_cc1 -std=c++11 -triple x86_64-unknown-linux-gnu -fgpu-rdc \
-// RUN: --offload-new-driver -emit-llvm -o - -x hip %s | FileCheck \
+// RUN: -emit-llvm -o - -x hip %s | FileCheck \
// RUN: --check-prefix=HIP %s
// RUN: %clang_cc1 -std=c++11 -triple x86_64-unknown-windows-gnu -fgpu-rdc \
-// RUN: --offload-new-driver -emit-llvm -o - -x cuda %s | FileCheck \
+// RUN: -emit-llvm -o - -x cuda %s | FileCheck \
// RUN: --check-prefix=CUDA-COFF %s
// RUN: %clang_cc1 -std=c++11 -triple x86_64-unknown-windows-gnu -fgpu-rdc \
-// RUN: --offload-new-driver -emit-llvm -o - -x hip %s | FileCheck \
+// RUN: -emit-llvm -o - -x hip %s | FileCheck \
// RUN: --check-prefix=HIP-COFF %s
// RUN: %clang_cc1 -std=c++11 -triple x86_64-apple-macosx10.15.0 -fgpu-rdc \
-// RUN: --offload-new-driver -emit-llvm -o - -x hip %s | FileCheck \
+// RUN: -emit-llvm -o - -x hip %s | FileCheck \
// RUN: --check-prefix=HIP-MACHO %s
#include "Inputs/cuda.h"
diff --git a/clang/test/CodeGenCUDA/static-device-var-rdc.cu b/clang/test/CodeGenCUDA/static-device-var-rdc.cu
index 9d2811f9385e1..6e7e25d554064 100644
--- a/clang/test/CodeGenCUDA/static-device-var-rdc.cu
+++ b/clang/test/CodeGenCUDA/static-device-var-rdc.cu
@@ -61,17 +61,17 @@
// Test normal static device variables
// INT-DEV-DAG: @_ZL1x[[FILEID:.*]] = addrspace(1) externally_initialized global i32 0
-// INT-HOST-DAG: @[[DEVNAMEX:[0-9]+]] = {{.*}}c"_ZL1x[[FILEID:.*]]\00"
+// INT-HOST-DAG: @.offloading.entry_name{{.*}} = {{.*}}c"_ZL1x[[FILEID:.*]]\00"
// Test externalized static device variables
// EXT-DEV-DAG: @_ZL1x.static.[[HASH:.*]] = addrspace(1) externally_initialized global i32 0
-// EXT-HOST-DAG: @[[DEVNAMEX:[0-9]+]] = {{.*}}c"_ZL1x.static.[[HASH:.*]]\00"
+// EXT-HOST-DAG: @.offloading.entry_name{{.*}} = {{.*}}c"_ZL1x.static.[[HASH:.*]]\00"
// CUDA-DAG: @_ZL1x__static__[[HASH:.*]] = addrspace(1) externally_initialized global i32 0
// POSTFIX: @_ZL1x.static.[[HASH:.*]] = addrspace(1) externally_initialized global i32 0
-// POSTFIX: @[[DEVNAMEX:[0-9]+]] = {{.*}}c"_ZL1x.static.[[HASH]]\00"
+// POSTFIX: @.offloading.entry_name{{.*}} = {{.*}}c"_ZL1x.static.[[HASH]]\00"
// POSTFIX-ID: @_ZL1x.static.[[FILEID:.*]] = addrspace(1) externally_initialized global i32 0
-// POSTFIX-ID: @[[DEVNAMEX:[0-9]+]] = {{.*}}c"_ZL1x.static.[[FILEID]]\00"
+// POSTFIX-ID: @.offloading.entry_name{{.*}} = {{.*}}c"_ZL1x.static.[[FILEID]]\00"
static __device__ int x;
@@ -82,11 +82,11 @@ static __device__ int x2;
// Test normal static device variables
// INT-DEV-DAG: @_ZL1y[[FILEID:.*]] = addrspace(4) externally_initialized constant i32 0
-// INT-HOST-DAG: @[[DEVNAMEY:[0-9]+]] = {{.*}}c"_ZL1y[[FILEID:.*]]\00"
+// INT-HOST-DAG: @.offloading.entry_name{{.*}} = {{.*}}c"_ZL1y[[FILEID:.*]]\00"
// Test externalized static device variables
// EXT-DEV-DAG: @_ZL1y.static.[[HASH]] = addrspace(4) externally_initialized constant i32 0
-// EXT-HOST-DAG: @[[DEVNAMEY:[0-9]+]] = {{.*}}c"_ZL1y.static.[[HASH]]\00"
+// EXT-HOST-DAG: @.offloading.entry_name{{.*}} = {{.*}}c"_ZL1y.static.[[HASH]]\00"
static __constant__ int y;
@@ -128,9 +128,10 @@ void foo() {
decltype(u) tmp;
}
-// HOST-DAG: __hipRegisterVar({{.*}}@_ZL1x, {{.*}}@[[DEVNAMEX]]
-// HOST-DAG: __hipRegisterVar({{.*}}@_ZL1y, {{.*}}@[[DEVNAMEY]]
-// HOST-NEG-NOT: __hipRegisterVar({{.*}}@_ZL2x2
-// HOST-NEG-NOT: __hipRegisterVar({{.*}}@_ZZ6kernelPiPPKiE1w
-// HOST-NEG-NOT: __hipRegisterVar({{.*}}@_ZZ6devfunPPKiE1p
-// HOST-NEG-NOT: __hipRegisterVar({{.*}}@_ZL1u
+// The host emits offloading entries for externalized static device variables.
+// HOST-DAG: @.offloading.entry._ZL1x.static.{{.*}} = {{.*}}ptr @_ZL1x
+// HOST-DAG: @.offloading.entry._ZL1y.static.{{.*}} = {{.*}}ptr @_ZL1y
+// HOST-NEG-NOT: @.offloading.entry.{{.*}}_ZL2x2
+// HOST-NEG-NOT: @.offloading.entry.{{.*}}_ZZ6kernelPiPPKiE1w
+// HOST-NEG-NOT: @.offloading.entry.{{.*}}_ZZ6devfunPPKiE1p
+// HOST-NEG-NOT: @.offloading.entry.{{.*}}_ZL1u
diff --git a/clang/test/CodeGenHIP/offload-pgo-sections.hip b/clang/test/CodeGenHIP/offload-pgo-sections.hip
index 073807723aded..a2d712c9ced46 100644
--- a/clang/test/CodeGenHIP/offload-pgo-sections.hip
+++ b/clang/test/CodeGenHIP/offload-pgo-sections.hip
@@ -18,7 +18,7 @@
// RUN: -fprofile-instrument=clang -emit-llvm -o - -x hip %s \
// RUN: | FileCheck -check-prefix=HOST %s
//
-// RUN: %clang_cc1 -triple x86_64-linux-gnu -fgpu-rdc --offload-new-driver \
+// RUN: %clang_cc1 -triple x86_64-linux-gnu -fgpu-rdc \
// RUN: -cuid=abc -fprofile-instrument=clang -emit-llvm -o - -x hip %s \
// RUN: | FileCheck -check-prefix=HOST-RDC %s
diff --git a/clang/test/Driver/amdgpu-hip-system-arch.c b/clang/test/Driver/amdgpu-hip-system-arch.c
index 972105143debf..c54881666cd9e 100644
--- a/clang/test/Driver/amdgpu-hip-system-arch.c
+++ b/clang/test/Driver/amdgpu-hip-system-arch.c
@@ -13,22 +13,16 @@
// case when amdgpu-arch returns nothing or fails
// RUN: not %clang -### --target=x86_64-unknown-linux-gnu -nogpulib --offload-arch=native --amdgpu-arch-tool=%t/amdgpu_arch_fail -x hip %s 2>&1 \
// RUN: | FileCheck %s --check-prefix=NO-OUTPUT-ERROR
-// RUN: not %clang -### --target=x86_64-unknown-linux-gnu -nogpulib --offload-new-driver --offload-arch=native --amdgpu-arch-tool=%t/amdgpu_arch_fail -x hip %s 2>&1 \
-// RUN: | FileCheck %s --check-prefix=NO-OUTPUT-ERROR
// NO-OUTPUT-ERROR: error: cannot determine hip architecture{{.*}}; consider passing it via '--offload-arch'
// case when amdgpu-arch does not return anything with successful execution
// RUN: not %clang -### --target=x86_64-unknown-linux-gnu -nogpulib --offload-arch=native --amdgpu-arch-tool=%t/amdgpu_arch_empty -x hip %s 2>&1 \
// RUN: | FileCheck %s --check-prefix=EMPTY-OUTPUT
-// RUN: not %clang -### --target=x86_64-unknown-linux-gnu -nogpulib --offload-new-driver --offload-arch=native --amdgpu-arch-tool=%t/amdgpu_arch_empty -x hip %s 2>&1 \
-// RUN: | FileCheck %s --check-prefix=EMPTY-OUTPUT
// EMPTY-OUTPUT: error: cannot determine hip architecture: No GPU detected in the system; consider passing it via '--offload-arch'
// case when amdgpu-arch returns a gfx906 GPU.
// RUN: %clang -### --target=x86_64-unknown-linux-gnu -nogpuinc -nogpulib --offload-arch=native --amdgpu-arch-tool=%t/amdgpu_arch_gfx906 -x hip %s 2>&1 \
// RUN: | FileCheck %s --check-prefix=ARCH-GFX906
-// RUN: %clang -### --target=x86_64-unknown-linux-gnu -nogpuinc -nogpulib --offload-new-driver --offload-arch=native --amdgpu-arch-tool=%t/amdgpu_arch_gfx906 -x hip %s 2>&1 \
-// RUN: | FileCheck %s --check-prefix=ARCH-GFX906
// ARCH-GFX906: "-cc1" "-triple" "amdgcn-amd-amdhsa"{{.*}}"-target-cpu" "gfx906"
// case when CLANG_TOOLCHAIN_PROGRAM_TIMEOUT is malformed.
diff --git a/clang/test/Driver/cuda-bad-arch.cu b/clang/test/Driver/cuda-bad-arch.cu
index 41eb96f5e3fae..658b8d73cad0b 100644
--- a/clang/test/Driver/cuda-bad-arch.cu
+++ b/clang/test/Driver/cuda-bad-arch.cu
@@ -36,12 +36,4 @@
// RUN: %clang -### -x hip --target=x86_64-linux-gnu -nogpulib -nogpuinc --cuda-gpu-arch=gfx1251 -c %s 2>&1 \
// RUN: | FileCheck -check-prefix OK %s
-// We don't allow using NVPTX/AMDGCN for host compilation.
-// RUN: not %clang -### --no-offload-new-driver --cuda-host-only --target=nvptx-nvidia-cuda -nogpulib -nogpuinc -c %s 2>&1 \
-// RUN: | FileCheck -check-prefix HOST_NVPTX %s
-// RUN: not %clang -### --no-offload-new-driver --cuda-host-only --target=amdgcn-amd-amdhsa -nogpulib -nogpuinc -c %s 2>&1 \
-// RUN: | FileCheck -check-prefix HOST_AMDGCN %s
-
// OK-NOT: error: Unsupported CUDA gpu architecture
-// HOST_NVPTX: error: unsupported architecture 'nvptx' for host compilation
-// HOST_AMDGCN: error: unsupported architecture 'amdgcn' for host compilation
diff --git a/clang/test/Driver/cuda-bindings.cu b/clang/test/Driver/cuda-bindings.cu
index 5b6f944621439..0ad48f2e20a2b 100644
--- a/clang/test/Driver/cuda-bindings.cu
+++ b/clang/test/Driver/cuda-bindings.cu
@@ -140,46 +140,19 @@
// RUN: | FileCheck -check-prefix=DASM %s
// DASM: # "nvptx64-nvidia-cuda" - "clang",{{.*}} output: "cuda-bindings-cuda-nvptx64-nvidia-cuda-sm_30.s"
-//
-// Test two gpu architectures with complete compilation in device-only
-// compilation mode.
-//
-// RUN: %clang -target powerpc64le-ibm-linux-gnu -ccc-print-bindings --no-offload-new-driver \
-// RUN: --cuda-gpu-arch=sm_30 --cuda-gpu-arch=sm_35 %s --cuda-device-only 2>&1 \
-// RUN: | FileCheck -check-prefix=DBIN2 %s
-// DBIN2: # "nvptx64-nvidia-cuda" - "clang",{{.*}} output:
-// DBIN2-NOT: cuda-bindings-device-cuda-nvptx64
-// DBIN2: # "nvptx64-nvidia-cuda" - "NVPTX::Assembler",{{.*}} output: "cuda-bindings-cuda-nvptx64-nvidia-cuda-sm_30.o"
-// DBIN2: # "nvptx64-nvidia-cuda" - "clang",{{.*}} output:
-// DBIN2-NOT: cuda-bindings-device-cuda-nvptx64
-// DBIN2: # "nvptx64-nvidia-cuda" - "NVPTX::Assembler",{{.*}} output: "cuda-bindings-cuda-nvptx64-nvidia-cuda-sm_35.o"
-
-//
-// Test two gpu architectures up to the assemble phase in device-only
-// compilation mode.
-//
-// RUN: %clang -target powerpc64le-ibm-linux-gnu -ccc-print-bindings --no-offload-new-driver \
-// RUN: --cuda-gpu-arch=sm_30 --cuda-gpu-arch=sm_35 %s --cuda-device-only -S 2>&1 \
-// RUN: | FileCheck -check-prefix=DASM2 %s
-// DASM2: # "nvptx64-nvidia-cuda" - "clang",{{.*}} output: "cuda-bindings-cuda-nvptx64-nvidia-cuda-sm_30.s"
-// DASM2: # "nvptx64-nvidia-cuda" - "clang",{{.*}} output: "cuda-bindings-cuda-nvptx64-nvidia-cuda-sm_35.s"
-
//
// Ensure we output the user's specified name in device-only mode.
//
// RUN: %clang -target powerpc64le-ibm-linux-gnu -### \
// RUN: --cuda-gpu-arch=sm_52 --cuda-device-only -c -o foo.o --cuda-path=%S/Inputs/CUDA_80/usr/local/cuda %s 2>&1 \
// RUN: | FileCheck -check-prefix=D_ONLY %s
-// RUN: %clang -target powerpc64le-ibm-linux-gnu -### --offload-new-driver \
-// RUN: --cuda-gpu-arch=sm_52 --cuda-device-only -c -o foo.o --cuda-path=%S/Inputs/CUDA_80/usr/local/cuda %s 2>&1 \
-// RUN: | FileCheck -check-prefix=D_ONLY %s
// D_ONLY: "foo.o"
//
// Check to make sure we can generate multiple outputs for device-only
// compilation and fail with '-o'.
//
-// RUN: %clang -### -target powerpc64le-ibm-linux-gnu --offload-new-driver -ccc-print-bindings \
+// RUN: %clang -### -target powerpc64le-ibm-linux-gnu -ccc-print-bindings \
// RUN: --offload-arch=sm_70 --offload-arch=sm_52 --offload-device-only -c %s 2>&1 \
// RUN: | FileCheck -check-prefix=MULTI-D-ONLY %s
// MULTI-D-ONLY: # "nvptx64-nvidia-cuda" - "clang", inputs: ["[[INPUT:.+]]"], output: "[[PTX_70:.+]]"
@@ -187,7 +160,7 @@
// MULTI-D-ONLY-NEXT: # "nvptx64-nvidia-cuda" - "clang", inputs: ["[[INPUT]]"], output: "[[PTX_52:.+]]"
// MULTI-D-ONLY-NEXT: # "nvptx64-nvidia-cuda" - "NVPTX::Assembler", inputs: ["[[PTX_52]]"], output: "[[CUBIN_52:.+]]"
//
-// RUN: not %clang -### --target=powerpc64le-ibm-linux-gnu --offload-new-driver -ccc-print-bindings \
+// RUN: not %clang -### --target=powerpc64le-ibm-linux-gnu -ccc-print-bindings \
// RUN: --offload-arch=sm_70 --offload-arch=sm_52 --offload-device-only -c -o %t %s 2>&1 \
// RUN: | FileCheck -check-prefix=MULTI-D-ONLY-O %s
// MULTI-D-ONLY-O: error: cannot specify -o when generating multiple output files
@@ -196,7 +169,7 @@
// Check to ensure that we can use '-fsyntax-only' for CUDA output with the new
// driver.
//
-// RUN: %clang -### -target powerpc64le-ibm-linux-gnu --offload-new-driver \
+// RUN: %clang -### -target powerpc64le-ibm-linux-gnu \
// RUN: -fsyntax-only --offload-arch=sm_70 --offload-arch=sm_52 -c --cuda-path=%S/Inputs/CUDA_111/usr/local/cuda %s 2>&1 \
// RUN: | FileCheck -check-prefix=SYNTAX-ONLY %s
// SYNTAX-ONLY: "-cc1" "-triple" "nvptx64-nvidia-cuda"{{.*}}"-fsyntax-only"
@@ -206,7 +179,7 @@
//
// Check to ensure that we can use '-save-temps' when operating in RDC-mode.
//
-// RUN: %clang -### -target powerpc64le-ibm-linux-gnu -save-temps --offload-new-driver \
+// RUN: %clang -### -target powerpc64le-ibm-linux-gnu -save-temps \
// RUN: -fgpu-rdc --offload-arch=sm_70 --offload-arch=sm_52 -c --cuda-path=%S/Inputs/CUDA_111/usr/local/cuda %s 2>&1 \
// RUN: | FileCheck -check-prefix=SAVE-TEMPS %s
// SAVE-TEMPS: "-cc1" "-triple" "nvptx64-nvidia-cuda"{{.*}}"-target-cpu" "sm_52"
@@ -216,7 +189,7 @@
//
// Check to ensure that we cannot use '-foffload' when not operating in RDC-mode.
//
-// RUN: not %clang -### --target=powerpc64le-ibm-linux-gnu -fno-gpu-rdc --offload-new-driver \
+// RUN: not %clang -### --target=powerpc64le-ibm-linux-gnu -fno-gpu-rdc \
// RUN: -foffload-lto --offload-arch=sm_70 --offload-arch=sm_52 -c %s 2>&1 \
// RUN: | FileCheck -check-prefix=LTO-NO-RDC %s
-// LTO-NO-RDC: error: unsupported option '-foffload-lto' for language mode '-fno-gpu-rdc'
+// LTO-NO-RDC: error: unsupported option '-foffload-lto' for target 'nvptx64-nvidia-cuda'
diff --git a/clang/test/Driver/cuda-external-tools.cu b/clang/test/Driver/cuda-external-tools.cu
index 0633c7bceac05..e69501e8d2d68 100644
--- a/clang/test/Driver/cuda-external-tools.cu
+++ b/clang/test/Driver/cuda-external-tools.cu
@@ -20,10 +20,6 @@
// RUN: %clang -### --target=x86_64-linux-gnu -Ofast -c %s 2>&1 \
// RUN: --offload-arch=sm_35 --cuda-path=%S/Inputs/CUDA/usr/local/cuda \
// RUN: | FileCheck -check-prefixes=CHECK,ARCH64,SM35,OPT3 %s
-// Generating relocatable device code
-// RUN: %clang -### --target=x86_64-linux-gnu -fgpu-rdc -c %s 2>&1 \
-// RUN: --no-offload-new-driver --offload-arch=sm_35 --cuda-path=%S/Inputs/CUDA/usr/local/cuda \
-// RUN: | FileCheck -check-prefixes=CHECK,ARCH64,SM35,RDC %s
// With debugging enabled, ptxas should be run with with no ptxas optimizations.
// RUN: %clang -### --target=x86_64-linux-gnu --cuda-noopt-device-debug -O2 -g -c %s 2>&1 \
@@ -54,28 +50,16 @@
// RUN: %clang -### --target=x86_64-linux-gnu --cuda-gpu-arch=sm_35 -c %s 2>&1 \
// RUN: --offload-arch=sm_35 --cuda-path=%S/Inputs/CUDA/usr/local/cuda \
// RUN: | FileCheck -check-prefixes=CHECK,ARCH64,SM35 %s
-// Separate compilation targeting sm_35.
-// RUN: %clang -### --target=x86_64-linux-gnu --cuda-gpu-arch=sm_35 -fgpu-rdc -c %s 2>&1 \
-// RUN: --no-offload-new-driver --offload-arch=sm_35 --cuda-path=%S/Inputs/CUDA/usr/local/cuda \
-// RUN: | FileCheck -check-prefixes=CHECK,ARCH64,SM35,RDC %s
// 32-bit compile.
// RUN: %clang -### --target=i386-linux-gnu -c %s 2>&1 \
// RUN: --offload-arch=sm_35 --cuda-path=%S/Inputs/CUDA/usr/local/cuda \
// RUN: | FileCheck -check-prefixes=CHECK,ARCH32,SM35 %s
-// 32-bit compile when generating relocatable device code.
-// RUN: %clang -### --target=i386-linux-gnu -fgpu-rdc -c %s 2>&1 \
-// RUN: --no-offload-new-driver --offload-arch=sm_35 --cuda-path=%S/Inputs/CUDA/usr/local/cuda \
-// RUN: | FileCheck -check-prefixes=CHECK,ARCH32,SM35,RDC %s
// Compile with -fintegrated-as. This should still cause us to invoke ptxas.
// RUN: %clang -### --target=x86_64-linux-gnu -fintegrated-as -c %s 2>&1 \
// RUN: --offload-arch=sm_35 --cuda-path=%S/Inputs/CUDA/usr/local/cuda \
// RUN: | FileCheck -check-prefixes=CHECK,ARCH64,SM35,OPT0 %s
-// Check that we still pass -c when generating relocatable device code.
-// RUN: %clang -### --target=x86_64-linux-gnu -fintegrated-as -fgpu-rdc -c %s 2>&1 \
-// RUN: --no-offload-new-driver --offload-arch=sm_35 --cuda-path=%S/Inputs/CUDA/usr/local/cuda \
-// RUN: | FileCheck -check-prefixes=CHECK,ARCH64,SM35,RDC %s
// Check -Xcuda-ptxas and -Xcuda-fatbinary
// RUN: %clang -### --target=x86_64-linux-gnu -c -Xcuda-ptxas -foo1 \
@@ -100,17 +84,6 @@
// RUN: --offload-arch=sm_35 --cuda-path=%S/Inputs/CUDA/usr/local/cuda \
// RUN: | FileCheck -check-prefixes=CHECK,ARCH32,SM35 %s
-// Check relocatable device code generation on MacOS.
-// RUN: %clang -### --target=x86_64-apple-macosx -O0 -fgpu-rdc -c %s 2>&1 \
-// RUN: --no-offload-new-driver --offload-arch=sm_35 --cuda-path=%S/Inputs/CUDA/usr/local/cuda \
-// RUN: | FileCheck -check-prefixes=CHECK,ARCH64,SM35,RDC %s
-// RUN: %clang -### --target=x86_64-apple-macosx --cuda-gpu-arch=sm_35 -fgpu-rdc -c %s 2>&1 \
-// RUN: --no-offload-new-driver --offload-arch=sm_35 --cuda-path=%S/Inputs/CUDA/usr/local/cuda \
-// RUN: | FileCheck -check-prefixes=CHECK,ARCH64,SM35,RDC %s
-// RUN: %clang -### --target=i386-apple-macosx -fgpu-rdc -c %s 2>&1 \
-// RUN: --no-offload-new-driver --offload-arch=sm_35 --cuda-path=%S/Inputs/CUDA/usr/local/cuda \
-// RUN: | FileCheck -check-prefixes=CHECK,ARCH32,SM35,RDC %s
-
// Check that CLANG forwards the -v flag to PTXAS.
// RUN: %clang -### -save-temps -v %s 2>&1 \
// RUN: --offload-arch=sm_35 --cuda-path=%S/Inputs/CUDA/usr/local/cuda \
@@ -121,7 +94,6 @@
// ARCH64-SAME: "-triple" "nvptx64-nvidia-cuda"
// ARCH32-SAME: "-triple" "nvptx-nvidia-cuda"
// SM35-SAME: "-target-cpu" "sm_35"
-// RDC-SAME: "-fgpu-rdc"
// CHECK-NOT: "-fgpu-rdc"
// SM35-SAME: "-o" "[[PTXFILE:[^"]*]]"
@@ -145,7 +117,6 @@
// PTXAS-EXTRA-SAME: "-foo2"
// CHECK-NOT: "-foo1"
// CHECK-NOT: "-foo2"
-// RDC-SAME: "-c"
// CHECK-NOT: "-c"
// Match the call to fatbinary (which combines all our PTX and SASS into one
diff --git a/clang/test/Driver/cuda-openmp-driver.cu b/clang/test/Driver/cuda-openmp-driver.cu
index a1ca987eb9d22..f291a17808676 100644
--- a/clang/test/Driver/cuda-openmp-driver.cu
+++ b/clang/test/Driver/cuda-openmp-driver.cu
@@ -1,5 +1,5 @@
// RUN: %clang -### -target x86_64-linux-gnu -nocudalib -ccc-print-bindings -fgpu-rdc \
-// RUN: --offload-new-driver --offload-arch=sm_35 --offload-arch=sm_70 %s 2>&1 \
+// RUN: --offload-arch=sm_35 --offload-arch=sm_70 %s 2>&1 \
// RUN: | FileCheck -check-prefix BINDINGS %s
// BINDINGS: "nvptx64-nvidia-cuda" - "clang", inputs: ["[[INPUT:.+]]"], output: "[[PTX_SM_35:.+]]"
@@ -11,14 +11,14 @@
// BINDINGS-NEXT: "x86_64-unknown-linux-gnu" - "Offload::Linker", inputs: ["[[HOST_OBJ]]"], output: "a.out"
// RUN: %clang -### -target x86_64-linux-gnu -nocudalib -ccc-print-bindings -fgpu-rdc \
-// RUN: --offload-new-driver --offload-arch=sm_35 --offload-arch=sm_70 %s 2>&1 \
+// RUN: --offload-arch=sm_35 --offload-arch=sm_70 %s 2>&1 \
// RUN: | FileCheck -check-prefix BINDINGS-HOST %s
// BINDINGS-HOST: # "x86_64-unknown-linux-gnu" - "clang", inputs: ["[[INPUT:.+]]"], output: "[[OUTPUT:.+]]"
// BINDINGS-HOST: # "x86_64-unknown-linux-gnu" - "Offload::Linker", inputs: ["[[OUTPUT]]"], output: "a.out"
// RUN: %clang -### -target x86_64-linux-gnu -nocudalib -ccc-print-bindings -fgpu-rdc \
-// RUN: --offload-new-driver --offload-arch=sm_35 --offload-arch=sm_70 %s 2>&1 \
+// RUN: --offload-arch=sm_35 --offload-arch=sm_70 %s 2>&1 \
// RUN: | FileCheck -check-prefix BINDINGS-DEVICE %s
// BINDINGS-DEVICE: # "nvptx64-nvidia-cuda" - "clang", inputs: ["[[INPUT:.+]]"], output: "[[PTX:.+]]"
@@ -32,7 +32,7 @@
// DEVICE-LINK: "x86_64-unknown-linux-gnu" - "Offload::Linker", inputs: ["[[INPUT:.+]]"], output: "a.out"
-// RUN: %clang -### -target x86_64-linux-gnu -nocudalib --offload-new-driver \
+// RUN: %clang -### -target x86_64-linux-gnu -nocudalib \
// RUN: --offload-arch=sm_35 --offload-arch=sm_70 --cuda-path=%S/Inputs/CUDA_111/usr/local/cuda %s 2>&1 \
// RUN: | FileCheck -check-prefix GPU-BINARY %s
diff --git a/clang/test/Driver/cuda-phases.cu b/clang/test/Driver/cuda-phases.cu
index db7d29e0c78c3..71686a2c2b9cd 100644
--- a/clang/test/Driver/cuda-phases.cu
+++ b/clang/test/Driver/cuda-phases.cu
@@ -4,221 +4,10 @@
// - Host/device-only compilation;
// - User-requested final phase - binary or assembly.
-// Test single gpu architecture with complete compilation.
-//
-// Test CUDA NVPTX phases.
-// RUN: %clang -target powerpc64le-ibm-linux-gnu -ccc-print-phases \
-// RUN: --no-offload-new-driver --cuda-gpu-arch=sm_30 %s 2>&1 \
-// RUN: | FileCheck -check-prefixes=BIN %s
-//
-// BIN-DAG: [[P0:[0-9]+]]: input, "{{.*}}cuda-phases.cu", [[T:cuda]], (host-[[T]])
-// BIN-DAG: [[P1:[0-9]+]]: preprocessor, {[[P0]]}, [[T]]-cpp-output, (host-[[T]])
-// BIN-DAG: [[P2:[0-9]+]]: compiler, {[[P1]]}, ir, (host-[[T]])
-// BIN-DAG: [[P3:[0-9]+]]: input, "{{.*}}cuda-phases.cu", [[T]], (device-[[T]], [[ARCH:sm_30]])
-// BIN-DAG: [[P4:[0-9]+]]: preprocessor, {[[P3]]}, [[T]]-cpp-output, (device-[[T]], [[ARCH]])
-// BIN-DAG: [[P5:[0-9]+]]: compiler, {[[P4]]}, ir, (device-[[T]], [[ARCH]])
-// BIN-DAG: [[P6:[0-9]+]]: backend, {[[P5]]}, assembler, (device-[[T]], [[ARCH]])
-// BIN-DAG: [[P7:[0-9]+]]: assembler, {[[P6]]}, object, (device-[[T]], [[ARCH]])
-// BIN-DAG: [[P8:[0-9]+]]: offload, "device-[[T]] ([[TRIPLE:nvptx64-nvidia-cuda]]:[[ARCH]])" {[[P7]]}, object
-// BIN-DAG: [[P9:[0-9]+]]: offload, "device-[[T]] ([[TRIPLE]]:[[ARCH]])" {[[P6]]}, assembler
-// BIN-DAG: [[P10:[0-9]+]]: linker, {[[P8]], [[P9]]}, cuda-fatbin, (device-[[T]])
-// BIN-DAG: [[P11:[0-9]+]]: offload, "host-[[T]] (powerpc64le-ibm-linux-gnu)" {[[P2]]}, "device-[[T]] ([[TRIPLE]])" {[[P10]]}, ir
-// BIN-DAG: [[P12:[0-9]+]]: backend, {[[P11]]}, assembler, (host-[[T]])
-// BIN-DAG: [[P13:[0-9]+]]: assembler, {[[P12]]}, object, (host-[[T]])
-// BIN-DAG: [[P14:[0-9]+]]: linker, {[[P13]]}, image, (host-[[T]])
-
-//
-// Test single gpu architecture up to the assemble phase.
-//
-// RUN: %clang -target powerpc64le-ibm-linux-gnu -ccc-print-phases \
-// RUN: --no-offload-new-driver --cuda-gpu-arch=sm_30 %s -S 2>&1 \
-// RUN: | FileCheck -check-prefixes=ASM %s
-// ASM-DAG: [[P0:[0-9]+]]: input, "{{.*}}cuda-phases.cu", [[T:cuda]], (device-[[T]], [[ARCH:sm_30]])
-// ASM-DAG: [[P1:[0-9]+]]: preprocessor, {[[P0]]}, [[T]]-cpp-output, (device-[[T]], [[ARCH]])
-// ASM-DAG: [[P2:[0-9]+]]: compiler, {[[P1]]}, ir, (device-[[T]], [[ARCH]])
-// ASM-DAG: [[P3:[0-9]+]]: backend, {[[P2]]}, assembler, (device-[[T]], [[ARCH]])
-// ASM-DAG: [[P4:[0-9]+]]: offload, "device-[[T]] ([[TRIPLE:nvptx64-nvidia-cuda]]:[[ARCH]])" {[[P3]]}, assembler
-// ASM-DAG: [[P5:[0-9]+]]: input, "{{.*}}cuda-phases.cu", [[T]], (host-[[T]])
-// ASM-DAG: [[P6:[0-9]+]]: preprocessor, {[[P5]]}, [[T]]-cpp-output, (host-[[T]])
-// ASM-DAG: [[P7:[0-9]+]]: compiler, {[[P6]]}, ir, (host-[[T]])
-// ASM-DAG: [[P8:[0-9]+]]: backend, {[[P7]]}, assembler, (host-[[T]])
-
-//
-// Test two gpu architectures with complete compilation.
-//
-// RUN: %clang -target powerpc64le-ibm-linux-gnu -ccc-print-phases \
-// RUN: --no-offload-new-driver --cuda-gpu-arch=sm_30 --cuda-gpu-arch=sm_35 %s 2>&1 \
-// RUN: | FileCheck -check-prefixes=BIN2 %s
-// BIN2-DAG: [[P0:[0-9]+]]: input, "{{.*}}cuda-phases.cu", [[T:cuda]], (host-[[T]])
-// BIN2-DAG: [[P1:[0-9]+]]: preprocessor, {[[P0]]}, [[T]]-cpp-output, (host-[[T]])
-// BIN2-DAG: [[P2:[0-9]+]]: compiler, {[[P1]]}, ir, (host-[[T]])
-// BIN2-DAG: [[P3:[0-9]+]]: input, "{{.*}}cuda-phases.cu", [[T]], (device-[[T]], [[ARCH1:sm_30]])
-// BIN2-DAG: [[P4:[0-9]+]]: preprocessor, {[[P3]]}, [[T]]-cpp-output, (device-[[T]], [[ARCH1]])
-// BIN2-DAG: [[P5:[0-9]+]]: compiler, {[[P4]]}, ir, (device-[[T]], [[ARCH1]])
-// BIN2-DAG: [[P6:[0-9]+]]: backend, {[[P5]]}, assembler, (device-[[T]], [[ARCH1]])
-// BIN2-DAG: [[P7:[0-9]+]]: assembler, {[[P6]]}, object, (device-[[T]], [[ARCH1]])
-// BIN2-DAG: [[P8:[0-9]+]]: offload, "device-[[T]] ([[TRIPLE:nvptx64-nvidia-cuda]]:[[ARCH1]])" {[[P7]]}, object
-// BIN2-DAG: [[P9:[0-9]+]]: offload, "device-[[T]] ([[TRIPLE]]:[[ARCH1]])" {[[P6]]}, assembler
-// BIN2-DAG: [[P10:[0-9]+]]: input, "{{.*}}cuda-phases.cu", [[T]], (device-[[T]], [[ARCH2:sm_35]])
-// BIN2-DAG: [[P11:[0-9]+]]: preprocessor, {[[P10]]}, [[T]]-cpp-output, (device-[[T]], [[ARCH2]])
-// BIN2-DAG: [[P12:[0-9]+]]: compiler, {[[P11]]}, ir, (device-[[T]], [[ARCH2]])
-// BIN2-DAG: [[P13:[0-9]+]]: backend, {[[P12]]}, assembler, (device-[[T]], [[ARCH2]])
-// BIN2-DAG: [[P14:[0-9]+]]: assembler, {[[P13]]}, object, (device-[[T]], [[ARCH2]])
-// BIN2-DAG: [[P15:[0-9]+]]: offload, "device-[[T]] ([[TRIPLE]]:[[ARCH2]])" {[[P14]]}, object
-// BIN2-DAG: [[P16:[0-9]+]]: offload, "device-[[T]] ([[TRIPLE]]:[[ARCH2]])" {[[P13]]}, assembler
-// BIN2-DAG: [[P17:[0-9]+]]: linker, {[[P8]], [[P9]], [[P15]], [[P16]]}, cuda-fatbin, (device-[[T]])
-// BIN2-DAG: [[P18:[0-9]+]]: offload, "host-[[T]] (powerpc64le-ibm-linux-gnu)" {[[P2]]}, "device-[[T]] ([[TRIPLE]])" {[[P17]]}, ir
-// BIN2-DAG: [[P19:[0-9]+]]: backend, {[[P18]]}, assembler, (host-[[T]])
-// BIN2-DAG: [[P20:[0-9]+]]: assembler, {[[P19]]}, object, (host-[[T]])
-// BIN2-DAG: [[P21:[0-9]+]]: linker, {[[P20]]}, image, (host-[[T]])
-
-//
-// Test two gpu architecturess up to the assemble phase.
-//
-// RUN: %clang -target powerpc64le-ibm-linux-gnu -ccc-print-phases \
-// RUN: --no-offload-new-driver --cuda-gpu-arch=sm_30 --cuda-gpu-arch=sm_35 %s -S 2>&1 \
-// RUN: | FileCheck -check-prefixes=ASM2 %s
-// ASM2-DAG: [[P0:[0-9]+]]: input, "{{.*}}cuda-phases.cu", [[T:cuda]], (device-[[T]], [[ARCH1:sm_30]])
-// ASM2-DAG: [[P1:[0-9]+]]: preprocessor, {[[P0]]}, [[T]]-cpp-output, (device-[[T]], [[ARCH1]])
-// ASM2-DAG: [[P2:[0-9]+]]: compiler, {[[P1]]}, ir, (device-[[T]], [[ARCH1]])
-// ASM2-DAG: [[P3:[0-9]+]]: backend, {[[P2]]}, assembler, (device-[[T]], [[ARCH1]])
-// ASM2-DAG: [[P4:[0-9]+]]: offload, "device-[[T]] ([[TRIPLE:nvptx64-nvidia-cuda]]:[[ARCH1]])" {[[P3]]}, assembler
-// ASM2-DAG: [[P5:[0-9]+]]: input, "{{.*}}cuda-phases.cu", [[T]], (device-[[T]], [[ARCH2:sm_35]])
-// ASM2-DAG: [[P6:[0-9]+]]: preprocessor, {[[P5]]}, [[T]]-cpp-output, (device-[[T]], [[ARCH2]])
-// ASM2-DAG: [[P7:[0-9]+]]: compiler, {[[P6]]}, ir, (device-[[T]], [[ARCH2]])
-// ASM2-DAG: [[P8:[0-9]+]]: backend, {[[P7]]}, assembler, (device-[[T]], [[ARCH2]])
-// ASM2-DAG: [[P9:[0-9]+]]: offload, "device-[[T]] ([[TRIPLE]]:[[ARCH2]])" {[[P8]]}, assembler
-// ASM2-DAG: [[P10:[0-9]+]]: input, "{{.*}}cuda-phases.cu", [[T]], (host-[[T]])
-// ASM2-DAG: [[P11:[0-9]+]]: preprocessor, {[[P10]]}, [[T]]-cpp-output, (host-[[T]])
-// ASM2-DAG: [[P12:[0-9]+]]: compiler, {[[P11]]}, ir, (host-[[T]])
-// ASM2-DAG: [[P13:[0-9]+]]: backend, {[[P12]]}, assembler, (host-[[T]])
-
-//
-// Test single gpu architecture with complete compilation in host-only
-// compilation mode.
-//
-// RUN: %clang -target powerpc64le-ibm-linux-gnu -ccc-print-phases \
-// RUN: --no-offload-new-driver --cuda-gpu-arch=sm_30 %s --cuda-host-only 2>&1 \
-// RUN: | FileCheck -check-prefixes=HBIN %s
-// HBIN-DAG: [[P0:[0-9]+]]: input, "{{.*}}cuda-phases.cu", [[T:cuda]], (host-[[T]])
-// HBIN-DAG: [[P1:[0-9]+]]: preprocessor, {[[P0]]}, [[T]]-cpp-output, (host-[[T]])
-// HBIN-DAG: [[P2:[0-9]+]]: compiler, {[[P1]]}, ir, (host-[[T]])
-// HBIN-DAG: [[P3:[0-9]+]]: backend, {[[P2]]}, assembler, (host-[[T]])
-// HBIN-DAG: [[P4:[0-9]+]]: assembler, {[[P3]]}, object, (host-[[T]])
-// HBIN-DAG: [[P5:[0-9]+]]: linker, {[[P4]]}, image, (host-[[T]])
-// HBIN-NOT: device
-//
-// Test single gpu architecture up to the assemble phase in host-only
-// compilation mode.
-//
-// RUN: %clang -target powerpc64le-ibm-linux-gnu -ccc-print-phases \
-// RUN: --no-offload-new-driver --cuda-gpu-arch=sm_30 %s --cuda-host-only -S 2>&1 \
-// RUN: | FileCheck -check-prefixes=HASM %s
-// HASM-DAG: [[P0:[0-9]+]]: input, "{{.*}}cuda-phases.cu", [[T:cuda]], (host-[[T]])
-// HASM-DAG: [[P1:[0-9]+]]: preprocessor, {[[P0]]}, [[T]]-cpp-output, (host-[[T]])
-// HASM-DAG: [[P2:[0-9]+]]: compiler, {[[P1]]}, ir, (host-[[T]])
-// HASM-DAG: [[P3:[0-9]+]]: backend, {[[P2]]}, assembler, (host-[[T]])
-// HASM-NOT: device
-
-//
-// Test two gpu architectures with complete compilation in host-only
-// compilation mode.
-//
-// RUN: %clang -target powerpc64le-ibm-linux-gnu -ccc-print-phases \
-// RUN: --no-offload-new-driver --cuda-gpu-arch=sm_30 --cuda-gpu-arch=sm_35 %s --cuda-host-only 2>&1 \
-// RUN: | FileCheck -check-prefixes=HBIN2 %s
-// HBIN2-DAG: [[P0:[0-9]+]]: input, "{{.*}}cuda-phases.cu", [[T:cuda]], (host-[[T]])
-// HBIN2-DAG: [[P1:[0-9]+]]: preprocessor, {[[P0]]}, [[T]]-cpp-output, (host-[[T]])
-// HBIN2-DAG: [[P2:[0-9]+]]: compiler, {[[P1]]}, ir, (host-[[T]])
-// HBIN2-DAG: [[P3:[0-9]+]]: backend, {[[P2]]}, assembler, (host-[[T]])
-// HBIN2-DAG: [[P4:[0-9]+]]: assembler, {[[P3]]}, object, (host-[[T]])
-// HBIN2-DAG: [[P5:[0-9]+]]: linker, {[[P4]]}, image, (host-[[T]])
-// HBIN2-NOT: device
-
-//
-// Test two gpu architectures up to the assemble phase in host-only
-// compilation mode.
-//
-// RUN: %clang -target powerpc64le-ibm-linux-gnu -ccc-print-phases \
-// RUN: --no-offload-new-driver --cuda-gpu-arch=sm_30 --cuda-gpu-arch=sm_35 %s --cuda-host-only -S \
-// RUN: 2>&1 | FileCheck -check-prefixes=HASM2 %s
-// HASM2-DAG: [[P0:[0-9]+]]: input, "{{.*}}cuda-phases.cu", [[T:cuda]], (host-[[T]])
-// HASM2-DAG: [[P1:[0-9]+]]: preprocessor, {[[P0]]}, [[T]]-cpp-output, (host-[[T]])
-// HASM2-DAG: [[P2:[0-9]+]]: compiler, {[[P1]]}, ir, (host-[[T]])
-// HASM2-DAG: [[P3:[0-9]+]]: backend, {[[P2]]}, assembler, (host-[[T]])
-// HASM2-NOT: device
-
-//
-// Test single gpu architecture with complete compilation in device-only
-// compilation mode.
-//
-// RUN: %clang -target powerpc64le-ibm-linux-gnu -ccc-print-phases \
-// RUN: --no-offload-new-driver --cuda-gpu-arch=sm_30 %s --cuda-device-only 2>&1 \
-// RUN: | FileCheck -check-prefixes=DBIN %s
-// DBIN-DAG: [[P0:[0-9]+]]: input, "{{.*}}cuda-phases.cu", [[T:cuda]], (device-[[T]], [[ARCH:sm_30]])
-// DBIN-DAG: [[P1:[0-9]+]]: preprocessor, {[[P0]]}, [[T]]-cpp-output, (device-[[T]], [[ARCH]])
-// DBIN-DAG: [[P2:[0-9]+]]: compiler, {[[P1]]}, ir, (device-[[T]], [[ARCH]])
-// DBIN-DAG: [[P3:[0-9]+]]: backend, {[[P2]]}, assembler, (device-[[T]], [[ARCH]])
-// DBIN-DAG: [[P4:[0-9]+]]: assembler, {[[P3]]}, object, (device-[[T]], [[ARCH]])
-// DBIN-DAG: [[P5:[0-9]+]]: offload, "device-[[T]] (nvptx64-nvidia-cuda:[[ARCH]])" {[[P4]]}, object
-// DBIN-NOT: host
-//
-// Test single gpu architecture up to the assemble phase in device-only
-// compilation mode.
-//
-// RUN: %clang -target powerpc64le-ibm-linux-gnu -ccc-print-phases \
-// RUN: --no-offload-new-driver --cuda-gpu-arch=sm_30 %s --cuda-device-only -S 2>&1 \
-// RUN: | FileCheck -check-prefixes=DASM %s
-// DASM-DAG: [[P0:[0-9]+]]: input, "{{.*}}cuda-phases.cu", [[T:cuda]], (device-[[T]], [[ARCH:sm_30]])
-// DASM-DAG: [[P1:[0-9]+]]: preprocessor, {[[P0]]}, [[T]]-cpp-output, (device-[[T]], [[ARCH]])
-// DASM-DAG: [[P2:[0-9]+]]: compiler, {[[P1]]}, ir, (device-[[T]], [[ARCH]])
-// DASM-DAG: [[P3:[0-9]+]]: backend, {[[P2]]}, assembler, (device-[[T]], [[ARCH]])
-// DASM-DAG: [[P4:[0-9]+]]: offload, "device-[[T]] ([[TRIPLE:nvptx64-nvidia-cuda]]:[[ARCH]])" {[[P3]]}, assembler
-// DASM-NOT: host
-
-//
-// Test two gpu architectures with complete compilation in device-only
-// compilation mode.
-//
-// RUN: %clang -target powerpc64le-ibm-linux-gnu -ccc-print-phases \
-// RUN: --no-offload-new-driver --cuda-gpu-arch=sm_30 --cuda-gpu-arch=sm_35 %s --cuda-device-only 2>&1 \
-// RUN: | FileCheck -check-prefixes=DBIN2 %s
-// DBIN2-DAG: [[P0:[0-9]+]]: input, "{{.*}}cuda-phases.cu", [[T:cuda]], (device-[[T]], [[ARCH:sm_30]])
-// DBIN2-DAG: [[P1:[0-9]+]]: preprocessor, {[[P0]]}, [[T]]-cpp-output, (device-[[T]], [[ARCH]])
-// DBIN2-DAG: [[P2:[0-9]+]]: compiler, {[[P1]]}, ir, (device-[[T]], [[ARCH]])
-// DBIN2-DAG: [[P3:[0-9]+]]: backend, {[[P2]]}, assembler, (device-[[T]], [[ARCH]])
-// DBIN2-DAG: [[P4:[0-9]+]]: assembler, {[[P3]]}, object, (device-[[T]], [[ARCH]])
-// DBIN2-DAG: [[P5:[0-9]+]]: offload, "device-[[T]] ([[TRIPLE:nvptx64-nvidia-cuda]]:[[ARCH]])" {[[P4]]}, object
-// DBIN2-DAG: [[P6:[0-9]+]]: input, "{{.*}}cuda-phases.cu", [[T]], (device-[[T]], [[ARCH2:sm_35]])
-// DBIN2-DAG: [[P7:[0-9]+]]: preprocessor, {[[P6]]}, [[T]]-cpp-output, (device-[[T]], [[ARCH2]])
-// DBIN2-DAG: [[P8:[0-9]+]]: compiler, {[[P7]]}, ir, (device-[[T]], [[ARCH2]])
-// DBIN2-DAG: [[P9:[0-9]+]]: backend, {[[P8]]}, assembler, (device-[[T]], [[ARCH2]])
-// DBIN2-DAG: [[P10:[0-9]+]]: assembler, {[[P9]]}, object, (device-[[T]], [[ARCH2]])
-// DBIN2-DAG: [[P11:[0-9]+]]: offload, "device-[[T]] ([[TRIPLE]]:[[ARCH2]])" {[[P10]]}, object
-// DBIN2-NOT: host
-//
-// Test two gpu architectures up to the assemble phase in device-only
-// compilation mode.
-//
-// RUN: %clang -target powerpc64le-ibm-linux-gnu -ccc-print-phases \
-// RUN: --no-offload-new-driver --cuda-gpu-arch=sm_30 --cuda-gpu-arch=sm_35 %s --cuda-device-only -S \
-// RUN: 2>&1 | FileCheck -check-prefixes=DASM2 %s
-// DASM2-DAG: [[P0:[0-9]+]]: input, "{{.*}}cuda-phases.cu", [[T:cuda]], (device-[[T]], [[ARCH:sm_30]])
-// DASM2-DAG: [[P1:[0-9]+]]: preprocessor, {[[P0]]}, [[T]]-cpp-output, (device-[[T]], [[ARCH]])
-// DASM2-DAG: [[P2:[0-9]+]]: compiler, {[[P1]]}, ir, (device-[[T]], [[ARCH]])
-// DASM2-DAG: [[P3:[0-9]+]]: backend, {[[P2]]}, assembler, (device-[[T]], [[ARCH]])
-// DASM2-DAG: [[P4:[0-9]+]]: offload, "device-[[T]] ([[TRIPLE:nvptx64-nvidia-cuda]]:[[ARCH]])" {[[P3]]}, assembler
-// DASM2-DAG: [[P5:[0-9]+]]: input, "{{.*}}cuda-phases.cu", [[T]], (device-[[T]], [[ARCH2:sm_35]])
-// DASM2-DAG: [[P6:[0-9]+]]: preprocessor, {[[P5]]}, [[T]]-cpp-output, (device-[[T]], [[ARCH2]])
-// DASM2-DAG: [[P7:[0-9]+]]: compiler, {[[P6]]}, ir, (device-[[T]], [[ARCH2]])
-// DASM2-DAG: [[P8:[0-9]+]]: backend, {[[P7]]}, assembler, (device-[[T]], [[ARCH2]])
-// DASM2-DAG: [[P9:[0-9]+]]: offload, "device-[[T]] ([[TRIPLE]]:[[ARCH2]])" {[[P8]]}, assembler
-// DASM2-NOT: host
-
//
// Test the phases generated when using the new offloading driver.
//
-// RUN: %clang -### --target=powerpc64le-ibm-linux-gnu -ccc-print-phases --offload-new-driver -fgpu-rdc \
+// RUN: %clang -### --target=powerpc64le-ibm-linux-gnu -ccc-print-phases -fgpu-rdc \
// RUN: --offload-arch=sm_52 --offload-arch=sm_70 %s 2>&1 | FileCheck --check-prefix=NEW-DRIVER-RDC %s
// NEW-DRIVER-RDC: 0: input, "[[INPUT:.+]]", cuda
// NEW-DRIVER-RDC-NEXT: 1: preprocessor, {0}, cuda-cpp-output
@@ -241,7 +30,7 @@
// NEW-DRIVER-RDC-NEXT: 18: assembler, {17}, object, (host-cuda)
// NEW-DRIVER-RDC-NEXT: 19: clang-linker-wrapper, {18}, image, (host-cuda)
-// RUN: %clang -### -target powerpc64le-ibm-linux-gnu -ccc-print-phases --offload-new-driver \
+// RUN: %clang -### -target powerpc64le-ibm-linux-gnu -ccc-print-phases \
// RUN: --offload-arch=sm_52 --offload-arch=sm_70 %s 2>&1 | FileCheck --check-prefix=NEW-DRIVER %s
// NEW-DRIVER: 0: input, "[[CUDA:.+]]", cuda, (host-cuda)
// NEW-DRIVER-NEXT: 1: preprocessor, {0}, cuda-cpp-output, (host-cuda)
@@ -264,7 +53,7 @@
// NEW-DRIVER-NEXT: 18: assembler, {17}, object, (host-cuda)
// NEW-DRIVER-NEXT: 19: clang-linker-wrapper, {18}, image, (host-cuda)
-// RUN: %clang -### --target=powerpc64le-ibm-linux-gnu -ccc-print-phases --offload-new-driver \
+// RUN: %clang -### --target=powerpc64le-ibm-linux-gnu -ccc-print-phases \
// RUN: --offload-arch=sm_52 --offload-arch=sm_70 %s %S/Inputs/empty.cpp 2>&1 | FileCheck --check-prefix=NON-CUDA-INPUT %s
// NON-CUDA-INPUT: 0: input, "[[CUDA:.+]]", cuda, (host-cuda)
@@ -296,7 +85,7 @@
//
// Test the phases using the new driver in LTO-mode.
//
-// RUN: %clang -### -target powerpc64le-ibm-linux-gnu --offload-new-driver -ccc-print-phases \
+// RUN: %clang -### -target powerpc64le-ibm-linux-gnu -ccc-print-phases \
// RUN: --offload-arch=sm_70 --offload-arch=sm_52 -foffload-lto -fgpu-rdc -c %s 2>&1 \
// RUN: | FileCheck -check-prefix=LTO %s
// LTO: 0: input, "[[INPUT:.+]]", cuda, (host-cuda)
@@ -320,7 +109,7 @@
//
// Test that the new driver does not create actions for invalid architectures.
//
-// RUN: not %clang -### --target=powerpc64le-ibm-linux-gnu --offload-new-driver \
+// RUN: not %clang -### --target=powerpc64le-ibm-linux-gnu \
// RUN: -ccc-print-phases --offload-arch=sm_999 -fgpu-rdc -c %s 2>&1 \
// RUN: | FileCheck -check-prefix=INVALID-ARCH %s
// INVALID-ARCH: error: unsupported CUDA gpu architecture: sm_999
diff --git a/clang/test/Driver/ftime-trace-offload.cpp b/clang/test/Driver/ftime-trace-offload.cpp
index 2305d7bf4e04d..7cbbd8a012ba9 100644
--- a/clang/test/Driver/ftime-trace-offload.cpp
+++ b/clang/test/Driver/ftime-trace-offload.cpp
@@ -9,11 +9,6 @@
// HIP: -cc1{{.*}} "-triple" "amdgcn-amd-amdhsa"{{.*}} "-ftime-trace=e{{/|\\\\}}a-hip-amdgcn-amd-amdhsa-gfx90a.json"
// HIP: -cc1{{.*}} "-triple" "x86_64{{.*}}"{{.*}} "-ftime-trace=e{{/|\\\\}}a.json"
-/// Test HIP offloading with new driver: same output as above.
-// RUN: %clang -### -ftime-trace -ftime-trace-granularity=0 -x hip d/a.cpp --offload-arch=gfx906 --offload-arch=gfx90a \
-// RUN: -nogpulib -nogpuinc -c -o e/a.o --target=x86_64-linux-gnu --offload-new-driver 2>&1 \
-// RUN: | FileCheck %s --check-prefix=HIP
-
/// Test HIP offloading with -ftime-trace=<dir>: traces go to specified directory.
// RUN: %clang -### -ftime-trace=f -ftime-trace-granularity=0 -x hip d/a.cpp --offload-arch=gfx906 \
// RUN: -nogpulib -nogpuinc -c -o e/a.o --target=x86_64-linux-gnu 2>&1 \
diff --git a/clang/test/Driver/gpu-libc.c b/clang/test/Driver/gpu-libc.c
index 88f346f32e0b8..f8f4baf0bc459 100644
--- a/clang/test/Driver/gpu-libc.c
+++ b/clang/test/Driver/gpu-libc.c
@@ -23,7 +23,7 @@
// RUN: -ccc-install-dir %S/Inputs/basic_gpu_tree/bin %s 2>&1 | FileCheck %s --check-prefix=OPENMP-NVPTX
// OPENMP-NVPTX: clang-linker-wrapper{{.*}}"--device-linker=nvptx64-nvidia-cuda=-lc"
// RUN: %clang -### --target=x86_64-unknown-linux-gnu --offload-arch=gfx908 \
-// RUN: --offload-new-driver --rocm-path=%S/Inputs/rocm --sysroot=%S/Inputs/basic_gpu_tree \
+// RUN: --rocm-path=%S/Inputs/rocm --sysroot=%S/Inputs/basic_gpu_tree \
// RUN: -ccc-install-dir %S/Inputs/basic_gpu_tree/bin -x hip %s 2>&1 | FileCheck %s --check-prefix=HIP
// HIP-NOT: "--device-linker=amdgcn-amd-amdhsa=-lc"
// RUN: %clang -### --target=x86_64-unknown-linux-gnu -fgpu-rdc --offload-arch=sm_52 \
diff --git a/clang/test/Driver/hip-binding.hip b/clang/test/Driver/hip-binding.hip
index b0839021aa1d9..5f9f4d5bc8f82 100644
--- a/clang/test/Driver/hip-binding.hip
+++ b/clang/test/Driver/hip-binding.hip
@@ -1,59 +1,16 @@
-// RUN: %clang -Werror=openmp-target -ccc-print-bindings --target=x86_64-linux-gnu \
-// RUN: --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 %s \
-// RUN: --no-offload-new-driver -c 2>&1 | FileCheck -check-prefix=NRDCS %s
-// RUN: %clang -ccc-print-bindings --target=x86_64-linux-gnu --offload-new-driver \
-// RUN: --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 %s \
-// RUN: --no-offload-new-driver -c 2>&1 | FileCheck -check-prefix=NRDCS %s
-// NRDCS: # "amdgcn-amd-amdhsa" - "clang", inputs: ["[[IN:.*hip-binding.hip]]"], output: "[[OBJ1:.*o]]"
-// NRDCS: # "amdgcn-amd-amdhsa" - "AMDGCN::Linker", inputs: ["[[OBJ1]]"], output: "[[IMG1:.*]]"
-// NRDCS: # "amdgcn-amd-amdhsa" - "clang", inputs: ["[[IN:.*hip-binding.hip]]"], output: "[[OBJ2:.*o]]"
-// NRDCS: # "amdgcn-amd-amdhsa" - "AMDGCN::Linker", inputs: ["[[OBJ2]]"], output: "[[IMG2:.*]]"
-// NRDCS: # "amdgcn-amd-amdhsa" - "AMDGCN::Linker", inputs: ["[[IMG1]]", "[[IMG2]]"], output: "[[FATBIN:.*]]"
-// NRDCS: # "x86_64-unknown-linux-gnu" - "clang", inputs: ["[[IN]]", "[[FATBIN]]"], output: "{{.*}}"
-
// RUN: %clang -ccc-print-bindings --target=x86_64-linux-gnu \
// RUN: --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 %s \
-// RUN: --no-offload-new-driver -c -fgpu-rdc 2>&1 | FileCheck -check-prefix=RDCS %s
-// RDCS: # "amdgcn-amd-amdhsa" - "clang", inputs: ["[[IN:.*hip-binding.hip]]"], output: "[[OBJ1:.*o]]"
-// RDCS: # "amdgcn-amd-amdhsa" - "clang", inputs: ["[[IN:.*hip-binding.hip]]"], output: "[[OBJ2:.*o]]"
-// RDCS: # "x86_64-unknown-linux-gnu" - "clang", inputs: ["[[IN]]"], output: "[[HOSTOBJ:.*o]]"
-// RDCS: # "x86_64-unknown-linux-gnu" - "offload bundler", inputs: ["[[OBJ1]]", "[[OBJ2]]", "[[HOSTOBJ]]"], output: "{{.*}}"
-
-// RUN: %clang -ccc-print-bindings --target=x86_64-linux-gnu --offload-new-driver \
-// RUN: --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 %s \
// RUN: -c -fgpu-rdc 2>&1 | FileCheck -check-prefix=RDCS-NEW %s
// RDCS-NEW: # "amdgcn-amd-amdhsa" - "clang", inputs: ["[[INPUT:.+]]"], output: "[[HIP803:.*o]]"
// RDCS-NEW: # "amdgcn-amd-amdhsa" - "clang", inputs: ["[[INPUT]]"], output: "[[HIP900:.*o]]"
// RDCS-NEW: # "x86_64-unknown-linux-gnu" - "Offload::Packager", inputs: ["[[HIP803]]", "[[HIP900]]"], output: "[[HIPFB:.+]]"
// RDCS-NEW: # "x86_64-unknown-linux-gnu" - "clang", inputs: ["[[INPUT]]", "[[HIPFB]]"], output: "{{.*}}"
-// RUN: touch %t.o
-// RUN: %clang --hip-link -ccc-print-bindings --target=x86_64-linux-gnu \
-// RUN: --no-offload-new-driver --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 -fgpu-rdc %t.o\
-// RUN: 2>&1 | FileCheck %s
-
-// CHECK: # "x86_64-unknown-linux-gnu" - "offload bundler", inputs: ["[[IN:.*o]]"], outputs: ["[[HOSTOBJ:.*o]]", "{{.*o}}", "{{.*o}}"]
-// CHECK: # "amdgcn-amd-amdhsa" - "offload bundler", inputs: ["[[IN]]"], outputs: ["{{.*o}}", "[[DOBJ1:.*o]]", "[[DOBJ2:.*o]]"]
-// CHECK: # "amdgcn-amd-amdhsa" - "AMDGCN::Linker", inputs: ["[[DOBJ1]]"], output: "[[IMG1:.*out]]"
-// CHECK-NOT: offload bundler
-// CHECK: # "amdgcn-amd-amdhsa" - "AMDGCN::Linker", inputs: ["[[DOBJ2]]"], output: "[[IMG2:.*out]]"
-// CHECK-NOT: offload bundler
-// CHECK: # "amdgcn-amd-amdhsa" - "AMDGCN::Linker", inputs: ["[[IMG1]]", "[[IMG2]]"], output: "[[FATBINOBJ:.*o]]"
-// CHECK-NOT: offload bundler
-// CHECK: # "x86_64-unknown-linux-gnu" - "GNU::Linker", inputs: ["[[HOSTOBJ]]", "[[FATBINOBJ]]"], output: "a.out"
-
-// RUN: %clang --hip-link -ccc-print-bindings --target=x86_64-linux-gnu \
-// RUN: --no-offload-new-driver --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 %t.o\
-// RUN: 2>&1 | FileCheck -check-prefix=NORDC %s
-
-// NORDC-NOT: offload bundler
-// NORDC: # "x86_64-unknown-linux-gnu" - "GNU::Linker", inputs: ["{{.*o}}"], output: "a.out"
-
//
// Check to make sure we can generate multiple outputs for device-only
// compilation and fail with '-o'.
//
-// RUN: %clang -### --target=x86_64-linux-gnu --offload-new-driver -ccc-print-bindings -nogpulib -nogpuinc \
+// RUN: %clang -### --target=x86_64-linux-gnu -ccc-print-bindings -nogpulib -nogpuinc \
// RUN: --offload-arch=gfx90a --offload-arch=gfx908 --offload-device-only -c %s 2>&1 \
// RUN: | FileCheck -check-prefix=MULTI-D-ONLY %s
// MULTI-D-ONLY: # "amdgcn-amd-amdhsa" - "clang", inputs: ["[[INPUT:.+]]"], output: "[[GFX908:.+]]"
@@ -62,12 +19,12 @@
// MULTI-D-ONLY-NEXT: # "amdgcn-amd-amdhsa" - "AMDGCN::Linker", inputs: ["[[GFX90a]]"], output: "[[GFX90a_OUT:.+]]"
// MULTI-D-ONLY-NEXT: # "amdgcn-amd-amdhsa" - "AMDGCN::Linker", inputs: ["[[GFX908_OUT]]", "[[GFX90a_OUT]]"], output: "{{.+}}"
//
-// RUN: not %clang -### --target=x86_64-linux-gnu --offload-new-driver -ccc-print-bindings -nogpulib -nogpuinc -emit-llvm \
+// RUN: not %clang -### --target=x86_64-linux-gnu -ccc-print-bindings -nogpulib -nogpuinc -emit-llvm \
// RUN: --no-gpu-bundle-output --offload-arch=gfx90a --offload-arch=gfx908 --offload-device-only -c -o %t %s 2>&1 \
// RUN: | FileCheck -check-prefix=MULTI-D-ONLY-NO-BUNDLE-O %s
// MULTI-D-ONLY-NO-BUNDLE-O: error: cannot specify -o when generating multiple output files
-// RUN: %clang -### --target=x86_64-linux-gnu --offload-new-driver -ccc-print-bindings -nogpulib -nogpuinc \
+// RUN: %clang -### --target=x86_64-linux-gnu -ccc-print-bindings -nogpulib -nogpuinc \
// RUN: --gpu-bundle-output --offload-arch=gfx90a --offload-arch=gfx908 --offload-device-only -c -o a.out %s 2>&1 \
// RUN: | FileCheck -check-prefix=MULTI-D-ONLY-O %s
// MULTI-D-ONLY-O: "amdgcn-amd-amdhsa" - "clang", inputs: ["[[INPUT:.+]]"], output: "[[GFX908_OBJ:.+]]"
@@ -76,7 +33,7 @@
// MULTI-D-ONLY-O-NEXT: "amdgcn-amd-amdhsa" - "AMDGCN::Linker", inputs: ["[[GFX90A_OBJ]]"], output: "[[GFX90A:.+]]"
// MULTI-D-ONLY-O-NEXT: "amdgcn-amd-amdhsa" - "AMDGCN::Linker", inputs: ["[[GFX908]]", "[[GFX90A]]"], output: "a.out"
-// RUN: %clang -### --target=x86_64-linux-gnu --offload-new-driver -ccc-print-bindings -nogpulib -nogpuinc -emit-llvm \
+// RUN: %clang -### --target=x86_64-linux-gnu -ccc-print-bindings -nogpulib -nogpuinc -emit-llvm \
// RUN: --gpu-bundle-output --offload-arch=gfx90a --offload-arch=gfx908 --offload-device-only -c -o a.out %s 2>&1 \
// RUN: | FileCheck -check-prefix=MULTI-D-ONLY-BC %s
// MULTI-D-ONLY-BC: "amdgcn-amd-amdhsa" - "clang", inputs: ["[[INPUT:.+]]"], output: "[[GFX908:.+]]"
@@ -87,7 +44,7 @@
// Check to ensure that we can use '-fsyntax-only' for HIP output with the new
// driver.
//
-// RUN: %clang -### --target=x86_64-unknown-linux-gnu --offload-new-driver -nogpulib -nogpuinc \
+// RUN: %clang -### --target=x86_64-unknown-linux-gnu -nogpulib -nogpuinc \
// RUN: -fsyntax-only --offload-arch=gfx90a --offload-arch=gfx908 -c %s 2>&1 \
// RUN: | FileCheck -check-prefix=SYNTAX-ONLY %s
// SYNTAX-ONLY: "-cc1" "-triple" "amdgcn-amd-amdhsa"{{.*}}"-fsyntax-only"
@@ -97,7 +54,7 @@
//
// Check to ensure that we can use '-foffload' when not operating in RDC-mode.
//
-// RUN: %clang -### --target=x86_64-linux-gnu -fno-gpu-rdc --offload-new-driver -ccc-print-bindings \
+// RUN: %clang -### --target=x86_64-linux-gnu -fno-gpu-rdc -ccc-print-bindings \
// RUN: -nogpulib -nogpuinc -foffload-lto --offload-arch=gfx90a --offload-arch=gfx908 -c %s 2>&1 \
// RUN: | FileCheck -check-prefix=LTO-NO-RDC %s
// LTO-NO-RDC: # "amdgcn-amd-amdhsa" - "clang", inputs: ["[[INPUT:.+]]"], output: "[[LTO_908:.+]]"
diff --git a/clang/test/Driver/hip-code-object-version.hip b/clang/test/Driver/hip-code-object-version.hip
index c57593a4ec478..029c378e88d1e 100644
--- a/clang/test/Driver/hip-code-object-version.hip
+++ b/clang/test/Driver/hip-code-object-version.hip
@@ -28,14 +28,6 @@
// V6: "-mcode-object-version=6"
// V6: "-mllvm" "--amdhsa-code-object-version=6"
-// Check bundle ID for code object version default
-
-// RUN: %clang -### --target=x86_64-linux-gnu --no-offload-new-driver \
-// RUN: --offload-arch=gfx906 -nogpuinc -nogpulib \
-// RUN: %s 2>&1 | FileCheck -check-prefix=VD %s
-
-// VD: "-targets=host-x86_64-unknown-linux-gnu,hipv4-amdgcn-amd-amdhsa--gfx906"
-
// Check invalid code object version option.
// RUN: not %clang -### --target=x86_64-linux-gnu \
diff --git a/clang/test/Driver/hip-cuid-hash.hip b/clang/test/Driver/hip-cuid-hash.hip
deleted file mode 100644
index a4167d664537e..0000000000000
--- a/clang/test/Driver/hip-cuid-hash.hip
+++ /dev/null
@@ -1,38 +0,0 @@
-// Check CUID generated by hash.
-// The same CUID is generated for the same file with the same options.
-
-// This test requires relative paths for input files. Since the test may be
-// done out of source tree, create the local directory structure and copy the
-// input file from the source tree into that directory.
-// RUN: mkdir -p %t/Inputs/hip_multiple_inputs
-// RUN: cp %S/Inputs/hip_multiple_inputs/a.cu %t/Inputs/hip_multiple_inputs/a.cu
-// RUN: cd %t
-
-// RUN: %clang -### -x hip --target=x86_64-unknown-linux-gnu --no-offload-new-driver \
-// RUN: --offload-arch=gfx906 -c -nogpuinc -nogpulib -fuse-cuid=hash \
-// RUN: Inputs/hip_multiple_inputs/a.cu >%t.out 2>&1
-
-// RUN: %clang -### -x hip --target=x86_64-unknown-linux-gnu --no-offload-new-driver \
-// RUN: --offload-arch=gfx906 -c -nogpuinc -nogpulib -fuse-cuid=hash \
-// RUN: Inputs/hip_multiple_inputs/a.cu >>%t.out 2>&1
-
-// RUN: FileCheck %s -check-prefixes=SAME -input-file %t.out
-
-// Check CUID generated by hash.
-// Different CUID's are generated for the same file with different options.
-
-// RUN: %clang -### -x hip --target=x86_64-unknown-linux-gnu -DX=1 --no-offload-new-driver \
-// RUN: --offload-arch=gfx906 -c -nogpuinc -nogpulib -fuse-cuid=hash \
-// RUN: Inputs/hip_multiple_inputs/a.cu >%t.out 2>&1
-
-// RUN: %clang -### -x hip --target=x86_64-unknown-linux-gnu -DX=2 --no-offload-new-driver \
-// RUN: --offload-arch=gfx906 -c -nogpuinc -nogpulib -fuse-cuid=hash \
-// RUN: Inputs/../Inputs/hip_multiple_inputs/a.cu >>%t.out 2>&1
-
-// RUN: FileCheck %s -check-prefixes=DIFF -input-file %t.out
-
-// SAME: "-cc1"{{.*}} "-target-cpu" "gfx906" {{.*}}"-cuid=[[CUID:[0-9a-f]+]]"
-// SAME: "-cc1"{{.*}} "-target-cpu" "gfx906" {{.*}}"-cuid=[[CUID]]"
-
-// DIFF: "-cc1"{{.*}} "-target-cpu" "gfx906" {{.*}}"-cuid=[[CUID:[0-9a-f]+]]"
-// DIFF-NOT: "-target-cpu" "gfx906" {{.*}}"-cuid=[[CUID]]"
diff --git a/clang/test/Driver/hip-cuid.hip b/clang/test/Driver/hip-cuid.hip
index 78c391c966e2a..ba3d572a17588 100644
--- a/clang/test/Driver/hip-cuid.hip
+++ b/clang/test/Driver/hip-cuid.hip
@@ -1,92 +1,9 @@
-// Check invalid -fuse-cuid= option.
-
-// RUN: not %clang -### -x hip \
-// RUN: --target=x86_64-unknown-linux-gnu \
-// RUN: --no-offload-new-driver \
-// RUN: --offload-arch=gfx900 \
-// RUN: --offload-arch=gfx906 \
-// RUN: -c -nogpuinc -nogpulib -fuse-cuid=invalid \
-// RUN: %S/Inputs/hip_multiple_inputs/a.cu \
-// RUN: %S/Inputs/hip_multiple_inputs/b.hip \
-// RUN: 2>&1 | FileCheck -check-prefixes=INVALID %s
-
-// Check random CUID generator.
-
-// RUN: %clang -### -x hip \
-// RUN: --target=x86_64-unknown-linux-gnu \
-// RUN: --no-offload-new-driver \
-// RUN: --offload-arch=gfx900 \
-// RUN: --offload-arch=gfx906 \
-// RUN: -c -nogpuinc -nogpulib -fuse-cuid=random \
-// RUN: %S/Inputs/hip_multiple_inputs/a.cu \
-// RUN: %S/Inputs/hip_multiple_inputs/b.hip \
-// RUN: 2>&1 | FileCheck -check-prefixes=COMMON,HEX %s
-
-// Check fixed CUID.
-
-// RUN: %clang -### -x hip \
-// RUN: --target=x86_64-unknown-linux-gnu \
-// RUN: --no-offload-new-driver \
-// RUN: --offload-arch=gfx900 \
-// RUN: --offload-arch=gfx906 \
-// RUN: -c -nogpuinc -nogpulib -cuid=xyz_123 \
-// RUN: %S/Inputs/hip_multiple_inputs/a.cu \
-// RUN: %S/Inputs/hip_multiple_inputs/b.hip \
-// RUN: 2>&1 | FileCheck -check-prefixes=COMMON,FIXED %s
-
-// Check fixed CUID override -fuse-cuid.
-
-// RUN: %clang -### -x hip \
-// RUN: --target=x86_64-unknown-linux-gnu \
-// RUN: --no-offload-new-driver \
-// RUN: --offload-arch=gfx900 \
-// RUN: --offload-arch=gfx906 \
-// RUN: -c -nogpuinc -nogpulib -fuse-cuid=random -cuid=xyz_123 \
-// RUN: %S/Inputs/hip_multiple_inputs/a.cu \
-// RUN: %S/Inputs/hip_multiple_inputs/b.hip \
-// RUN: 2>&1 | FileCheck -check-prefixes=COMMON,FIXED %s
-
-// Check hash CUID generator.
-
-// RUN: %clang -### -x hip \
-// RUN: --target=x86_64-unknown-linux-gnu \
-// RUN: --no-offload-new-driver \
-// RUN: --offload-arch=gfx900 \
-// RUN: --offload-arch=gfx906 \
-// RUN: -c -nogpuinc -nogpulib -fuse-cuid=hash \
-// RUN: %S/Inputs/hip_multiple_inputs/a.cu \
-// RUN: %S/Inputs/hip_multiple_inputs/b.hip \
-// RUN: 2>&1 | FileCheck -check-prefixes=COMMON,HEX %s
-
-// Check that cuid is propagated to the host-only compilation.
-// RUN: %clang -### -x hip \
-// RUN: --target=x86_64-unknown-linux-gnu \
-// RUN: --no-offload-new-driver \
-// RUN: --offload-arch=gfx900 \
-// RUN: --offload-host-only \
-// RUN: -c -nogpuinc -nogpulib -cuid=xyz_123 \
-// RUN: %S/Inputs/hip_multiple_inputs/a.cu \
-// RUN: %S/Inputs/hip_multiple_inputs/b.hip \
-// RUN: 2>&1 | FileCheck -check-prefixes=HOST %s
-
-// Check that cuid is propagated to the device-only compilation.
-// RUN: %clang -### -x hip \
-// RUN: --target=x86_64-unknown-linux-gnu \
-// RUN: --no-offload-new-driver \
-// RUN: --offload-arch=gfx900 \
-// RUN: --offload-device-only \
-// RUN: -c -nogpuinc -nogpulib -cuid=xyz_123 \
-// RUN: %S/Inputs/hip_multiple_inputs/a.cu \
-// RUN: %S/Inputs/hip_multiple_inputs/b.hip \
-// RUN: 2>&1 | FileCheck -check-prefixes=DEVICE %s
-
// Check cuid is supported by the new driver.
// RUN: %clang -### -x hip \
// RUN: --target=x86_64-unknown-linux-gnu \
-// RUN: --no-offload-new-driver \
// RUN: --offload-arch=gfx900 \
// RUN: --offload-arch=gfx906 \
-// RUN: -c -nogpuinc -nogpulib --offload-new-driver \
+// RUN: -c -nogpuinc -nogpulib \
// RUN: %S/Inputs/hip_multiple_inputs/a.cu \
// RUN: %S/Inputs/hip_multiple_inputs/b.hip \
// RUN: 2>&1 | FileCheck -check-prefixes=COMMON,HEX %s
@@ -101,12 +18,9 @@
// RUN: %S/Inputs/hip_multiple_inputs/b.hip \
// RUN: 2>&1 | FileCheck -check-prefixes=COMMON,HEX %s
-// INVALID: invalid value 'invalid' in '-fuse-cuid=invalid'
-
// COMMON: "-cc1"{{.*}} "-triple" "[[TRIP:(amdgcn-amd-amdhsa|nvptx64-nvidia-cuda)]]"
// COMMON-SAME: "-target-cpu" "[[G1:(gfx900|sm_60)]]"
// HEX-SAME: "-cuid=[[CUID:[0-9a-f]+]]"
-// FIXED-SAME: "-cuid=[[CUID:xyz_123]]"
// COMMON-SAME: "{{.*}}a.cu"
// COMMON: "-cc1"{{.*}} "-triple" "[[TRIP]]"
@@ -122,7 +36,6 @@
// COMMON-SAME: "-target-cpu" "[[G1]]"
// HEX-NOT: "-cuid=[[CUID]]"
// HEX-SAME: "-cuid=[[CUID2:[0-9a-f]+]]"
-// FIXED-SAME: "-cuid=[[CUID2:xyz_123]]"
// COMMON-SAME: "{{.*}}b.hip"
// COMMON: "-cc1"{{.*}} "-triple" "[[TRIP]]"
@@ -135,21 +48,3 @@
// HEX-NOT: "-cuid=[[CUID]]"
// COMMON-SAME: "-cuid=[[CUID2]]"
// COMMON-SAME: "{{.*}}b.hip"
-
-// HOST: "-cc1"{{.*}} "-triple" "x86_64-unknown-linux-gnu"
-// HOST-SAME: "-cuid=[[CUID:xyz_123]]"
-// HOST-SAME: "{{.*}}a.cu"
-
-// HOST: "-cc1"{{.*}} "-triple" "x86_64-unknown-linux-gnu"
-// HOST-SAME: "-cuid=[[CUID]]"
-// HOST-SAME: "{{.*}}b.hip"
-
-// DEVICE: "-cc1"{{.*}} "-triple" "amdgcn-amd-amdhsa"
-// DEVICE-SAME: "-target-cpu" "gfx900"
-// DEVICE-SAME: "-cuid=[[CUID:xyz_123]]"
-// DEVICE-SAME: "{{.*}}a.cu"
-
-// DEVICE: "-cc1"{{.*}} "-triple" "amdgcn-amd-amdhsa"
-// DEVICE-SAME: "-target-cpu" "gfx900"
-// DEVICE-SAME: "-cuid=[[CUID]]"
-// DEVICE-SAME: "{{.*}}b.hip"
diff --git a/clang/test/Driver/hip-dependent-options.hip b/clang/test/Driver/hip-dependent-options.hip
index e65fec2b08d7b..39f919b7433a1 100644
--- a/clang/test/Driver/hip-dependent-options.hip
+++ b/clang/test/Driver/hip-dependent-options.hip
@@ -1,10 +1,4 @@
-// RUN: not %clang -### --target=x86_64-linux-gnu --no-offload-new-driver \
-// RUN: -x hip --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 \
-// RUN: -c -fhip-emit-relocatable -nogpuinc -nogpulib --cuda-device-only -fgpu-rdc \
-// RUN: %S/Inputs/hip_multiple_inputs/a.cu \
-// RUN: %S/Inputs/hip_multiple_inputs/b.hip --gpu-bundle-output \
-// RUN: 2>&1 | FileCheck -check-prefixes=RELOCRDC %s
-// RUN: not %clang -### --target=x86_64-linux-gnu --offload-new-driver \
+// RUN: not %clang -### --target=x86_64-linux-gnu \
// RUN: -x hip --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 \
// RUN: -c -fhip-emit-relocatable -nogpuinc -nogpulib --cuda-device-only -fgpu-rdc \
// RUN: %S/Inputs/hip_multiple_inputs/a.cu \
@@ -13,13 +7,7 @@
// RELOCRDC: error: option '-fhip-emit-relocatable' cannot be specified with '-fgpu-rdc'
-// RUN: not %clang -### --target=x86_64-linux-gnu --no-offload-new-driver \
-// RUN: -x hip --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 \
-// RUN: -c -fhip-emit-relocatable -nogpuinc -nogpulib \
-// RUN: %S/Inputs/hip_multiple_inputs/a.cu \
-// RUN: %S/Inputs/hip_multiple_inputs/b.hip --gpu-bundle-output \
-// RUN: 2>&1 | FileCheck -check-prefixes=RELOCHOST %s
-// RUN: not %clang -### --target=x86_64-linux-gnu --offload-new-driver \
+// RUN: not %clang -### --target=x86_64-linux-gnu \
// RUN: -x hip --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 \
// RUN: -c -fhip-emit-relocatable -nogpuinc -nogpulib \
// RUN: %S/Inputs/hip_multiple_inputs/a.cu \
diff --git a/clang/test/Driver/hip-device-compile.hip b/clang/test/Driver/hip-device-compile.hip
deleted file mode 100644
index efc9345f63d28..0000000000000
--- a/clang/test/Driver/hip-device-compile.hip
+++ /dev/null
@@ -1,144 +0,0 @@
-// If -emit-llvm and/or -S is used in device only compilation,
-// the output should not be bundled, except --gpu-bundle-output
-// is specified.
-
-// Output unbundled bitcode.
-// RUN: %clang -c -emit-llvm --cuda-device-only -### --target=x86_64-linux-gnu \
-// RUN: --rocm-path=%S/Inputs/rocm -o a.bc -x hip --cuda-gpu-arch=gfx900 --no-gpu-bundle-output \
-// RUN: --no-offload-new-driver --hip-device-lib=lib1.bc \
-// RUN: --hip-device-lib-path=%S/Inputs/hip_multiple_inputs/lib1 \
-// RUN: %S/Inputs/hip_multiple_inputs/a.cu \
-// RUN: 2>&1 | FileCheck -check-prefixes=CHECK,BC,NBUN %s
-
-// Output bundled bitcode.
-// RUN: %clang -c -emit-llvm --cuda-device-only -### --target=x86_64-linux-gnu \
-// RUN: --rocm-path=%S/Inputs/rocm -o a.bc -x hip --cuda-gpu-arch=gfx900 --no-gpu-bundle-output \
-// RUN: --no-offload-new-driver --hip-device-lib=lib1.bc \
-// RUN: --hip-device-lib-path=%S/Inputs/hip_multiple_inputs/lib1 \
-// RUN: %S/Inputs/hip_multiple_inputs/a.cu --gpu-bundle-output \
-// RUN: 2>&1 | FileCheck -check-prefixes=CHECK,BCBUN %s
-
-// Output unbundled LLVM IR.
-// RUN: %clang -c -S -emit-llvm --cuda-device-only -### --target=x86_64-linux-gnu \
-// RUN: --rocm-path=%S/Inputs/rocm -o a.ll -x hip --cuda-gpu-arch=gfx900 --no-gpu-bundle-output \
-// RUN: --no-offload-new-driver --hip-device-lib=lib1.bc \
-// RUN: --hip-device-lib-path=%S/Inputs/hip_multiple_inputs/lib1 \
-// RUN: %S/Inputs/hip_multiple_inputs/a.cu \
-// RUN: 2>&1 | FileCheck -check-prefixes=CHECK,LL,NBUN %s
-
-// Output bundled LLVM IR.
-// RUN: %clang -c -S -emit-llvm --cuda-device-only -### --target=x86_64-linux-gnu \
-// RUN: --rocm-path=%S/Inputs/rocm -o a.ll -x hip --cuda-gpu-arch=gfx900 --no-gpu-bundle-output \
-// RUN: --no-offload-new-driver --hip-device-lib=lib1.bc \
-// RUN: --hip-device-lib-path=%S/Inputs/hip_multiple_inputs/lib1 \
-// RUN: %S/Inputs/hip_multiple_inputs/a.cu --gpu-bundle-output \
-// RUN: 2>&1 | FileCheck -check-prefixes=CHECK,LLBUN %s
-
-// Output unbundled assembly.
-// RUN: %clang -c -S --cuda-device-only -### --target=x86_64-linux-gnu \
-// RUN: --rocm-path=%S/Inputs/rocm -o a.s -x hip --cuda-gpu-arch=gfx900 --no-gpu-bundle-output \
-// RUN: --no-offload-new-driver --hip-device-lib=lib1.bc \
-// RUN: --hip-device-lib-path=%S/Inputs/hip_multiple_inputs/lib1 \
-// RUN: %S/Inputs/hip_multiple_inputs/a.cu \
-// RUN: 2>&1 | FileCheck -check-prefixes=CHECK,ASM,NBUN %s
-
-// Output relocatable.
-// RUN: %clang -c --cuda-device-only -### --target=x86_64-linux-gnu \
-// RUN: --rocm-path=%S/Inputs/rocm -o a.o -x hip --cuda-gpu-arch=gfx900 -fhip-emit-relocatable \
-// RUN: --no-offload-new-driver --hip-device-lib=lib1.bc \
-// RUN: --hip-device-lib-path=%S/Inputs/hip_multiple_inputs/lib1 \
-// RUN: %S/Inputs/hip_multiple_inputs/a.cu \
-// RUN: 2>&1 | FileCheck -check-prefixes=CHECK,NBUN,RELOC %s
-
-// Output bundled assembly.
-// RUN: %clang -c -S --cuda-device-only -### --target=x86_64-linux-gnu \
-// RUN: --rocm-path=%S/Inputs/rocm -o a.s -x hip --cuda-gpu-arch=gfx900 --no-gpu-bundle-output \
-// RUN: --no-offload-new-driver --hip-device-lib=lib1.bc \
-// RUN: --hip-device-lib-path=%S/Inputs/hip_multiple_inputs/lib1 \
-// RUN: %S/Inputs/hip_multiple_inputs/a.cu --gpu-bundle-output \
-// RUN: 2>&1 | FileCheck -check-prefixes=CHECK,ASMBUN %s
-
-// CHECK: {{".*clang.*"}} "-cc1" "-triple" "amdgcn-amd-amdhsa"
-// CHECK-SAME: "-aux-triple" "x86_64-unknown-linux-gnu"
-// BC-SAME: "-emit-llvm-bc"
-// LL-SAME: "-emit-llvm"
-// ASM-SAME: "-S"
-// CHECK-SAME: "-main-file-name" "a.cu"
-// CHECK-SAME: "-fcuda-is-device"
-// CHECK-SAME: {{".*lib1.bc"}}
-// CHECK-SAME: "-target-cpu" "gfx900"
-// BC-SAME: "-o" "a.bc"
-// BCBUN-SAME: "-o" "{{.*}}.bc"
-// LL-SAME: "-o" "a.ll"
-// LLBUN-SAME: "-o" "{{.*}}.ll"
-// ASM-SAME: "-o" "a.s"
-// ASMBUN-SAME: "-o" "{{.*}}.s"
-// RELOC-SAME: "-o" "a.o"
-// CHECK-SAME: {{".*a.cu"}}
-
-// CHECK-NOT: {{"*.llvm-link"}}
-// CHECK-NOT: {{".*opt"}}
-// CHECK-NOT: {{".*llc"}}
-// CHECK-NOT: {{".*lld.*"}}
-// NBUN-NOT: {{".*clang-offload-bundler"}}
-// BCBUN: {{".*clang-offload-bundler"}}{{.*}}"-output=a.bc"
-// LLBUN: {{".*clang-offload-bundler"}}{{.*}}"-output=a.ll"
-// ASMBUN: {{".*clang-offload-bundler"}}{{.*}}"-output=a.s"
-// CHECK-NOT: {{".*ld.*"}}{{.*}}"-o"
-
-// If neither -emit-llvm nor -S is used in device only compilation,
-// the output should be bundled except --no-gpu-bundle-output is
-// specified.
-
-// Output bundled code objects.
-// RUN: %clang -c --cuda-device-only -### --target=x86_64-linux-gnu \
-// RUN: --rocm-path=%S/Inputs/rocm -o a.o -x hip --cuda-gpu-arch=gfx900 \
-// RUN: --no-offload-new-driver --hip-device-lib=lib1.bc \
-// RUN: --hip-device-lib-path=%S/Inputs/hip_multiple_inputs/lib1 \
-// RUN: %S/Inputs/hip_multiple_inputs/a.cu \
-// RUN: 2>&1 | FileCheck -check-prefixes=OBJ,OBJ-BUN %s
-
-// Output unbundled code objects.
-// RUN: %clang -c --cuda-device-only -### --target=x86_64-linux-gnu \
-// RUN: --rocm-path=%S/Inputs/rocm -o a.o -x hip --cuda-gpu-arch=gfx900 \
-// RUN: --no-offload-new-driver --hip-device-lib=lib1.bc \
-// RUN: --hip-device-lib-path=%S/Inputs/hip_multiple_inputs/lib1 \
-// RUN: %S/Inputs/hip_multiple_inputs/a.cu --no-gpu-bundle-output \
-// RUN: 2>&1 | FileCheck -check-prefixes=OBJ,OBJ-UBUN %s
-
-// Output bundled code objects.
-// RUN: %clang --cuda-device-only -### --target=x86_64-linux-gnu \
-// RUN: --rocm-path=%S/Inputs/rocm -o a.o -x hip --cuda-gpu-arch=gfx900 \
-// RUN: --no-offload-new-driver --hip-device-lib=lib1.bc \
-// RUN: --hip-device-lib-path=%S/Inputs/hip_multiple_inputs/lib1 \
-// RUN: %S/Inputs/hip_multiple_inputs/a.cu \
-// RUN: 2>&1 | FileCheck -check-prefixes=OBJ,OBJ-BUN %s
-
-// Output unbundled code objects.
-// RUN: %clang --cuda-device-only -### --target=x86_64-linux-gnu \
-// RUN: --rocm-path=%S/Inputs/rocm -o a.o -x hip --cuda-gpu-arch=gfx900 \
-// RUN: --no-offload-new-driver --hip-device-lib=lib1.bc \
-// RUN: --hip-device-lib-path=%S/Inputs/hip_multiple_inputs/lib1 \
-// RUN: %S/Inputs/hip_multiple_inputs/a.cu --no-gpu-bundle-output \
-// RUN: 2>&1 | FileCheck -check-prefixes=OBJ,OBJ-UBUN %s
-
-// OBJ: {{"*.clang.*"}} {{.*}} "-emit-obj"
-// OBJ-NOT: {{"*.llvm-link"}}
-// OBJ-NOT: {{".*opt"}}
-// OBJ-NOT: {{".*llc"}}
-// OBJ-BUN: {{".*lld.*"}}{{.*}}"-o" "{{.*}}.out"
-// OBJ-UBUN: {{".*lld.*"}}{{.*}}"-o" "a.o"
-// OBJ-BUN: {{".*clang-offload-bundler"}}{{.*}}"-output=a.o"
-// OBJ-UBUN-NOT: {{".*clang-offload-bundler"}}
-
-// RUN: %clang -S --cuda-device-only -### --target=x86_64-linux-gnu \
-// RUN: --rocm-path=%S/Inputs/rocm -x hip --cuda-gpu-arch=gfx900 --no-gpu-bundle-output \
-// RUN: --no-offload-new-driver -fno-offload-lto \
-// RUN: %S/Inputs/hip_multiple_inputs/a.cu \
-// RUN: 2>&1 | FileCheck -check-prefixes=NOLTO %s
-
-// NOLTO: {{".*clang.*"}} "-cc1" "-triple" "amdgcn-amd-amdhsa"
-// NOLTO-SAME: "-S"
-// NOLTO-NOT: "-flto
-// NOLTO-SAME: "-target-cpu" "gfx900"
-// NOLTO-SAME: "-o" "a-hip-amdgcn-amd-amdhsa-gfx900.s"
diff --git a/clang/test/Driver/hip-link-bc-to-bc.hip b/clang/test/Driver/hip-link-bc-to-bc.hip
deleted file mode 100644
index b372551e200e3..0000000000000
--- a/clang/test/Driver/hip-link-bc-to-bc.hip
+++ /dev/null
@@ -1,33 +0,0 @@
-// Check that clang unbundles the two bitcodes and links via llvm-link
-// RUN: rm -rf %t && mkdir %t
-// RUN: touch %t/bundle1.bc
-// RUN: touch %t/bundle2.bc
-
-// RUN: %clang -### --target=x86_64-unknown-linux-gnu --offload-arch=gfx906 --hip-link \
-// RUN: -nogpulib -nogpuinc -emit-llvm -fgpu-rdc --cuda-device-only \
-// RUN: --no-offload-new-driver %t/bundle1.bc %t/bundle2.bc \
-// RUN: 2>&1 | FileCheck -check-prefix=BITCODE %s
-
-// BITCODE: "{{.*}}clang-offload-bundler" "-type=bc" "-targets=host-x86_64-unknown-linux-gnu,hip-amdgcn-amd-amdhsa-unknown-gfx906" "-input={{.*}}bundle1.bc" "-output=[[B1HOST:.*\.bc]]" "-output=[[B1DEV1:.*\.bc]]" "-unbundle" "-allow-missing-bundles"
-// BITCODE: "{{.*}}clang{{.*}}" "-o" "[[B1DEV2:.*bundle1-gfx906-.*\.bc]]" "-x" "ir" "[[B1DEV1]]"
-
-// BITCODE: "{{.*}}clang-offload-bundler" "-type=bc" "-targets=host-x86_64-unknown-linux-gnu,hip-amdgcn-amd-amdhsa-unknown-gfx906" "-input={{.*}}bundle2.bc" "-output=[[B2HOST:.*\.bc]]" "-output=[[B2DEV1:.*\.bc]]" "-unbundle" "-allow-missing-bundles"
-// BITCODE: "{{.*}}clang{{.*}}" "-o" "[[B2DEV2:.*bundle2-gfx906-.*\.bc]]" "-x" "ir" "[[B2DEV1]]"
-
-// BITCODE: "{{.*}}llvm-link" "-o" "bundle1-hip-amdgcn-amd-amdhsa-gfx906.bc" "[[B1DEV2]]" "[[B2DEV2]]"
-
-// Check that clang unbundles the bitcode and archive and links via llvm-link
-// RUN: llvm-ar rc %t/libhipbundle.a
-// RUN: touch %t/bundle.bc
-
-// RUN: %clang -### --target=x86_64-unknown-linux-gnu --offload-arch=gfx906 --hip-link \
-// RUN: -nogpulib -nogpuinc -emit-llvm -fgpu-rdc --cuda-device-only \
-// RUN: --no-offload-new-driver %t/bundle.bc -L%t -lhipbundle \
-// RUN: 2>&1 | FileCheck -check-prefix=ARCHIVE %s
-
-// ARCHIVE: "{{.*}}clang-offload-bundler" "-type=bc" "-targets=host-x86_64-unknown-linux-gnu,hip-amdgcn-amd-amdhsa-unknown-gfx906" "-input={{.*}}bundle.bc" "-output=[[HOST:.*\.bc]]" "-output=[[DEV1:.*\.bc]]" "-unbundle" "-allow-missing-bundles"
-// ARCHIVE: "{{.*}}clang{{.*}}" "-o" "[[DEV2:.*\.bc]]" "-x" "ir" "[[DEV1]]"
-
-// ARCHIVE: "{{.*}}clang-offload-bundler" "-unbundle" "-type=a" "-input={{.*}}libhipbundle.a" "-targets=hip-amdgcn-amd-amdhsa-unknown-gfx906" "-output=[[AR:.*\.a]]" "-allow-missing-bundles" "-hip-openmp-compatible"
-
-// ARCHIVE: "{{.*}}llvm-link" "-o" "bundle-hip-amdgcn-amd-amdhsa-gfx906.bc" "[[DEV2]]" "[[AR]]"
diff --git a/clang/test/Driver/hip-link-bundle-archive.hip b/clang/test/Driver/hip-link-bundle-archive.hip
deleted file mode 100644
index f1902957fbc13..0000000000000
--- a/clang/test/Driver/hip-link-bundle-archive.hip
+++ /dev/null
@@ -1,86 +0,0 @@
-// Check clang unbundle the archive and link them by lld.
-// If there is a directory which has the same name as the
-// value of the '-l' option, it should not interfere with
-// the discovery and unbundling of the archive.
-
-// RUN: rm -rf %t hipBundled && mkdir %t hipBundled
-// RUN: touch %t/dummy.bc
-// RUN: llvm-ar cr %t/libhipBundled.a %t/dummy.bc
-// RUN: %clang -### --offload-arch=gfx906 --offload-arch=gfx1030 \
-// RUN: --no-offload-new-driver --target=x86_64-unknown-linux-gnu \
-// RUN: -nogpuinc -nogpulib %s -fgpu-rdc -L%t -lhipBundled \
-// RUN: 2>&1 | FileCheck -check-prefixes=GNU,GNU1,GNU-L %s
-
-// RUN: %clang -### --offload-arch=gfx906 --offload-arch=gfx1030 -nogpuinc \
-// RUN: --no-offload-new-driver --target=x86_64-unknown-linux-gnu \
-// RUN: -nogpuinc -nogpulib %s -fgpu-rdc -L%t -l:libhipBundled.a \
-// RUN: 2>&1 | FileCheck -check-prefixes=GNU,GNU1,GNU-LA %s
-
-// RUN: %clang -### --offload-arch=gfx906 --offload-arch=gfx1030 \
-// RUN: --no-offload-new-driver --target=x86_64-unknown-linux-gnu \
-// RUN: -nogpuinc -nogpulib %s -fgpu-rdc %t/libhipBundled.a \
-// RUN: 2>&1 | FileCheck -check-prefixes=GNU,GNU1,GNU-A %s
-
-// RUN: llvm-ar cr %t/libhipBundled.a.5.2 %t/dummy.bc
-// RUN: %clang -### --offload-arch=gfx906 --offload-arch=gfx1030 \
-// RUN: --no-offload-new-driver --target=x86_64-unknown-linux-gnu \
-// RUN: -nogpuinc -nogpulib %s -fgpu-rdc %t/libhipBundled.a.5.2 \
-// RUN: 2>&1 | FileCheck -check-prefixes=GNU,GNU2,GNU-A %s
-
-// Check if a file is not an archive, it is not unbundled.
-
-// RUN: touch %t/libNonArchive.a
-// RUN: %clang -### --offload-arch=gfx906 --offload-arch=gfx1030 \
-// RUN: --no-offload-new-driver --target=x86_64-unknown-linux-gnu \
-// RUN: -nogpuinc -nogpulib %s -fgpu-rdc -L%t -lNonArchive \
-// RUN: 2>&1 | FileCheck -check-prefixes=NONARCHIVE %s
-// RUN: %clang -### --offload-arch=gfx906 --offload-arch=gfx1030 \
-// RUN: --no-offload-new-driver --target=x86_64-unknown-linux-gnu \
-// RUN: -nogpuinc -nogpulib %s -fgpu-rdc -L%t -l:libNonArchive.a \
-// RUN: 2>&1 | FileCheck -check-prefixes=NONARCHIVE %s
-// RUN: not %clang -### --offload-arch=gfx906 --offload-arch=gfx1030 \
-// RUN: --no-offload-new-driver --target=x86_64-unknown-linux-gnu \
-// RUN: -nogpuinc -nogpulib %s -fgpu-rdc -L%t libNonArchive.a \
-// RUN: 2>&1 | FileCheck -check-prefixes=NONARCHIVE %s
-
-// Check if a file does not exist, it is not unbundled.
-
-// RUN: not %clang -### --offload-arch=gfx906 --offload-arch=gfx1030 \
-// RUN: --no-offload-new-driver --target=x86_64-unknown-linux-gnu \
-// RUN: -nogpuinc -nogpulib %s -fgpu-rdc %t/NoneExist.a \
-// RUN: 2>&1 | FileCheck -check-prefixes=NONE %s
-
-// Check unbundling archive for MSVC.
-
-// RUN: llvm-ar cr %t/hipBundled2.lib %t/dummy.bc
-// RUN: %clang -### --offload-arch=gfx906 --offload-arch=gfx1030 \
-// RUN: --no-offload-new-driver --target=x86_64-pc-windows-msvc -fuse-ld= \
-// RUN: -nogpuinc -nogpulib %s -fgpu-rdc -L%t -lhipBundled2 \
-// RUN: 2>&1 | FileCheck -check-prefix=MSVC %s
-
-// RUN: %clang -### --offload-arch=gfx906 --offload-arch=gfx1030 \
-// RUN: --no-offload-new-driver --target=x86_64-pc-windows-msvc -fuse-ld= \
-// RUN: -nogpuinc -nogpulib %s -fgpu-rdc -L%t -l:hipBundled2.lib \
-// RUN: 2>&1 | FileCheck -check-prefix=MSVC %s
-
-// RUN: %clang -### --offload-arch=gfx906 --offload-arch=gfx1030 \
-// RUN: --no-offload-new-driver --target=x86_64-pc-windows-msvc -fuse-ld= \
-// RUN: -nogpuinc -nogpulib %s -fgpu-rdc %t/hipBundled2.lib \
-// RUN: 2>&1 | FileCheck -check-prefix=MSVC %s
-
-// GNU1: "{{.*}}clang-offload-bundler" "-unbundle" "-type=a" "-input={{.*}}[[LIB:libhipBundled\.a]]" "-targets=hip-amdgcn-amd-amdhsa-unknown-gfx906" "-output=[[A906:.*\.a]]" "-allow-missing-bundles"
-// GNU2: "{{.*}}clang-offload-bundler" "-unbundle" "-type=a" "-input={{.*}}[[LIB:libhipBundled\.a\.5\.2]]" "-targets=hip-amdgcn-amd-amdhsa-unknown-gfx906" "-output=[[A906:.*\.a]]" "-allow-missing-bundles"
-// GNU: "{{.*}}lld{{.*}}" {{.*}}"-plugin-opt=mcpu=gfx906" {{.*}} "[[A906]]"
-// GNU: "{{.*}}clang-offload-bundler" "-unbundle" "-type=a" "-input={{.*}}[[LIB]]" "-targets=hip-amdgcn-amd-amdhsa-unknown-gfx1030" "-output=[[A1030:.*\.a]]" "-allow-missing-bundles"
-// GNU: "{{.*}}lld{{.*}}" {{.*}}"-plugin-opt=mcpu=gfx1030" {{.*}} "[[A1030]]"
-// GNU-L: "{{.*}}ld{{.*}}" {{.*}}"-o" "a.out" {{.*}}"-lhipBundled"
-// GNU-LA: "{{.*}}ld{{.*}}" {{.*}}"-o" "a.out" {{.*}}"-l:libhipBundled.a"
-// GNU-A: "{{.*}}ld{{.*}}" {{.*}}"-o" "a.out" "{{.*}}[[LIB]]"
-// NONARCHIVE-NOT: "{{.*}}clang-offload-bundler" "-unbundle" "-type=a" "-input={{.*libNonArchive\.a}}"
-// NONE-NOT: "{{.*}}clang-offload-bundler" "-unbundle" "-type=a" "-input={{.*NoneExist\.a}}"
-
-// MSVC: "{{.*}}clang-offload-bundler" "-unbundle" "-type=a" "-input={{.*}}hipBundled2.lib" "-targets=hip-amdgcn-amd-amdhsa-unknown-gfx906" "-output=[[A906:.*\.a]]" "-allow-missing-bundles"
-// MSVC: "{{.*}}lld{{.*}}" {{.*}}"-plugin-opt=mcpu=gfx906" {{.*}} "[[A906]]"
-// MSVC: "{{.*}}clang-offload-bundler" "-unbundle" "-type=a" "-input={{.*}}hipBundled2.lib" "-targets=hip-amdgcn-amd-amdhsa-unknown-gfx1030" "-output=[[A1030:.*\.a]]" "-allow-missing-bundles"
-// MSVC: "{{.*}}lld{{.*}}" {{.*}}"-plugin-opt=mcpu=gfx1030" {{.*}} "[[A1030]]"
-// MSVC: "{{.*}}link{{.*}}" {{.*}}"-out:a.exe" {{.*}}hipBundled2.lib"
diff --git a/clang/test/Driver/hip-link-save-temps.hip b/clang/test/Driver/hip-link-save-temps.hip
deleted file mode 100644
index e321970274bb4..0000000000000
--- a/clang/test/Driver/hip-link-save-temps.hip
+++ /dev/null
@@ -1,49 +0,0 @@
-// -fgpu-rdc link with output
-// RUN: rm -rf %t && mkdir %t
-// RUN: touch %t/obj1.o
-// RUN: touch %t/obj2.o
-// RUN: %clang -### --target=x86_64-linux-gnu -nogpulib -save-temps \
-// RUN: --hip-link -o executable -fgpu-rdc --cuda-gpu-arch=gfx900 \
-// RUN: --no-offload-new-driver --offload-arch=gfx906 %t/obj1.o %t/obj2.o 2>&1 | \
-// RUN: FileCheck -check-prefixes=CHECK,OUT %s
-
-// -fgpu-rdc link without output
-// RUN: touch %t/obj1.o
-// RUN: touch %t/obj2.o
-// RUN: %clang -### --target=x86_64-linux-gnu -nogpulib -save-temps \
-// RUN: --no-offload-new-driver --hip-link -fgpu-rdc --cuda-gpu-arch=gfx900 \
-// RUN: --offload-arch=gfx906 %t/obj1.o %t/obj2.o 2>&1 | \
-// RUN: FileCheck -check-prefixes=CHECK,NOUT %s
-
-// -fgpu-rdc link with output and --emit-static-lib
-// RUN: touch %t/obj1.o
-// RUN: touch %t/obj2.o
-// RUN: %clang -### --target=x86_64-linux-gnu -nogpulib -save-temps \
-// RUN: --hip-link -o libTest.a -fgpu-rdc --cuda-gpu-arch=gfx900 \
-// RUN: --no-offload-new-driver --emit-static-lib \
-// RUN: --offload-arch=gfx906 %t/obj1.o %t/obj2.o 2>&1 | \
-// RUN: FileCheck -check-prefixes=CHECK,SLO %s
-
-// -fgpu-rdc link without output and --emit-static-lib
-// RUN: touch %t/obj1.o
-// RUN: touch %t/obj2.o
-// RUN: %clang -### --target=x86_64-linux-gnu -nogpulib -save-temps \
-// RUN: --hip-link -fgpu-rdc --cuda-gpu-arch=gfx900 \
-// RUN: --no-offload-new-driver --emit-static-lib \
-// RUN: --offload-arch=gfx906 %t/obj1.o %t/obj2.o 2>&1 | \
-// RUN: FileCheck -check-prefixes=CHECK,SLNO %s
-
-// CHECK: "{{.*clang-offload-bundler.*}}" {{.*}} "-output=obj1-host-x86_64-unknown-linux-gnu.o" "-output=obj1-hip-amdgcn-amd-amdhsa-gfx900.o" "-output=obj1-hip-amdgcn-amd-amdhsa-gfx906.o" "-unbundle"
-// CHECK: "{{.*clang-offload-bundler.*}}" {{.*}} "-output=obj2-host-x86_64-unknown-linux-gnu.o" "-output=obj2-hip-amdgcn-amd-amdhsa-gfx900.o" "-output=obj2-hip-amdgcn-amd-amdhsa-gfx906.o" "-unbundle"
-// CHECK-NOT: {{".*/llvm-link"}}
-// CHECK-NOT: {{".*/opt"}}
-// CHECK-NOT: {{".*/llc"}}
-// CHECK: "{{.*lld.*}}" {{.*}} "-plugin-opt=-amdgpu-internalize-symbols"
-// CHECK-SAME: "-o" "[[HIPFB1:.+]]" "obj1-hip-amdgcn-amd-amdhsa-gfx900.o" "obj2-hip-amdgcn-amd-amdhsa-gfx900.o"
-// CHECK: "{{.*lld.*}}" {{.*}} "-plugin-opt=-amdgpu-internalize-symbols"
-// CHECK-SAME: "-o" "[[HIPFB2:.+]]" "obj1-hip-amdgcn-amd-amdhsa-gfx906.o" "obj2-hip-amdgcn-amd-amdhsa-gfx906.o"
-// CHECK: "{{.*clang.*}}" "-target" "x86_64-unknown-linux-gnu" "-o" "[[OBJBUNDLE:.+.o]]" "-x" "assembler" "{{.*}}.mcin" "-c"
-// OUT: "{{.*ld.*}}" {{.*}} "-o" "executable" {{.*}} "[[OBJBUNDLE]]"
-// NOUT: "{{.*ld.*}}" {{.*}} "-o" "a.out" {{.*}} "[[OBJBUNDLE]]"
-// SLO: "{{.*llvm-ar.*}}" "rcsD" "libTest.a" {{.*}} "[[OBJBUNDLE]]"
-// SLNO: "{{.*llvm-ar.*}}" "rcsD" "a.out" {{.*}} "[[OBJBUNDLE]]"
diff --git a/clang/test/Driver/hip-link-shared-library.hip b/clang/test/Driver/hip-link-shared-library.hip
deleted file mode 100644
index a075ee82dda1c..0000000000000
--- a/clang/test/Driver/hip-link-shared-library.hip
+++ /dev/null
@@ -1,15 +0,0 @@
-// RUN: touch %t.o
-// RUN: touch %t.so
-// RUN: %clang --hip-link -ccc-print-bindings --target=x86_64-linux-gnu \
-// RUN: --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 %t.o %t.so \
-// RUN: --no-offload-new-driver -fgpu-rdc 2>&1 | FileCheck %s
-
-// CHECK: # "x86_64-unknown-linux-gnu" - "offload bundler", inputs: ["[[IN:.*o]]"], outputs: ["[[HOSTOBJ:.*o]]", "{{.*o}}", "{{.*o}}"]
-// CHECK: # "amdgcn-amd-amdhsa" - "offload bundler", inputs: ["[[IN]]"], outputs: ["{{.*o}}", "[[DOBJ1:.*o]]", "[[DOBJ2:.*o]]"]
-// CHECK: # "amdgcn-amd-amdhsa" - "AMDGCN::Linker", inputs: ["[[DOBJ1]]"], output: "[[IMG1:.*out]]"
-// CHECK-NOT: offload bundler
-// CHECK: # "amdgcn-amd-amdhsa" - "AMDGCN::Linker", inputs: ["[[DOBJ2]]"], output: "[[IMG2:.*out]]"
-// CHECK-NOT: offload bundler
-// CHECK: # "amdgcn-amd-amdhsa" - "AMDGCN::Linker", inputs: ["[[IMG1]]", "[[IMG2]]"], output: "[[FATBINOBJ:.*o]]"
-// CHECK-NOT: offload bundler
-// CHECK: # "x86_64-unknown-linux-gnu" - "GNU::Linker", inputs: ["[[HOSTOBJ]]", "{{.*}}.so", "[[FATBINOBJ]]"], output: "a.out"
diff --git a/clang/test/Driver/hip-link-static-library.hip b/clang/test/Driver/hip-link-static-library.hip
deleted file mode 100644
index dcdc26af3b36b..0000000000000
--- a/clang/test/Driver/hip-link-static-library.hip
+++ /dev/null
@@ -1,34 +0,0 @@
-// RUN: touch %t.o
-// RUN: %clang --hip-link -ccc-print-bindings --target=x86_64-linux-gnu \
-// RUN: --no-offload-new-driver --emit-static-lib \
-// RUN: --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 -fgpu-rdc %t.o\
-// RUN: 2>&1 | FileCheck %s
-
-// CHECK: # "x86_64-unknown-linux-gnu" - "offload bundler", inputs: ["[[IN:.*o]]"], outputs: ["[[HOSTOBJ:.*o]]", "{{.*o}}", "{{.*o}}"]
-// CHECK: # "amdgcn-amd-amdhsa" - "offload bundler", inputs: ["[[IN]]"], outputs: ["{{.*o}}", "[[DOBJ1:.*o]]", "[[DOBJ2:.*o]]"]
-// CHECK: # "amdgcn-amd-amdhsa" - "AMDGCN::Linker", inputs: ["[[DOBJ1]]"], output: "[[IMG1:.*out]]"
-// CHECK-NOT: offload bundler
-// CHECK: # "amdgcn-amd-amdhsa" - "AMDGCN::Linker", inputs: ["[[DOBJ2]]"], output: "[[IMG2:.*out]]"
-// CHECK-NOT: offload bundler
-// CHECK: # "amdgcn-amd-amdhsa" - "AMDGCN::Linker", inputs: ["[[IMG1]]", "[[IMG2]]"], output: "[[FATBINOBJ:.*o]]"
-// CHECK-NOT: offload bundler
-// CHECK: # "x86_64-unknown-linux-gnu" - "GNU::StaticLibTool", inputs: ["[[HOSTOBJ]]", "[[FATBINOBJ]]"], output: "a.out"
-
-// RUN: %clang --hip-link -ccc-print-bindings --target=x86_64-linux-gnu \
-// RUN: --no-offload-new-driver --emit-static-lib \
-// RUN: --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 %t.o\
-// RUN: 2>&1 | FileCheck -check-prefix=NORDC %s
-
-// NORDC-NOT: offload bundler
-// NORDC: # "x86_64-unknown-linux-gnu" - "GNU::StaticLibTool", inputs: ["{{.*o}}"], output: "a.out"
-
-// RUN: %clang --hip-link -### --target=x86_64-linux-gnu \
-// RUN: --no-offload-new-driver --emit-static-lib -lgcc \
-// RUN: -Wl,--enable-new-dtags -Wl,--rpath=/opt \
-// RUN: --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 -fgpu-rdc %t.o\
-// RUN: 2>&1 | FileCheck -check-prefix=NOFLAG %s
-
-// NOFLAG-NOT: .*lgcc
-// NOFLAG-NOT: .*enable-new-dtags
-// NOFLAG-NOT: .*rpath=/opt
-// NOFLAG: "{{.*}}llvm-ar{{.*}}" "rcsD" "{{.*}}.out" "{{.*o}}" "{{.*o}}"
diff --git a/clang/test/Driver/hip-offload-compress-zlib.hip b/clang/test/Driver/hip-offload-compress-zlib.hip
deleted file mode 100644
index df63c527a3e0b..0000000000000
--- a/clang/test/Driver/hip-offload-compress-zlib.hip
+++ /dev/null
@@ -1,44 +0,0 @@
-// REQUIRES: zlib && !zstd
-
-// Test compress bundled bitcode.
-
-// RUN: rm -rf %t.bc
-// RUN: %clang -c -v --target=x86_64-linux-gnu \
-// RUN: -x hip --offload-arch=gfx1100 --offload-arch=gfx1101 \
-// RUN: --no-offload-new-driver -fgpu-rdc -nogpuinc -nogpulib \
-// RUN: %S/Inputs/hip_multiple_inputs/a.cu \
-// RUN: --offload-compress --offload-compression-level=9 \
-// RUN: --offload-device-only --gpu-bundle-output \
-// RUN: -o %t.bc \
-// RUN: 2>&1 | FileCheck %s
-
-// CHECK: clang-offload-bundler{{.*}} -type=o
-// CHECK-SAME: -targets={{.*}}hip-amdgcn-amd-amdhsa-unknown-gfx1100,hip-amdgcn-amd-amdhsa-unknown-gfx1101
-// CHECK-SAME: --compress --verbose --compression-level=9
-// CHECK: Compressed bundle format
-
-// Test uncompress of bundled bitcode.
-
-// RUN: %clang --hip-link -### -v --target=x86_64-linux-gnu \
-// RUN: --offload-arch=gfx1100 --offload-arch=gfx1101 \
-// RUN: --no-offload-new-driver -fgpu-rdc -nogpulib \
-// RUN: %t.bc --offload-device-only \
-// RUN: 2>&1 | FileCheck -check-prefix=UNBUNDLE %s
-
-// UNBUNDLE: clang-offload-bundler{{.*}} "-type=bc"
-// UNBUNDLE-SAME: -targets={{.*}}hip-amdgcn-amd-amdhsa-unknown-gfx1100,hip-amdgcn-amd-amdhsa-unknown-gfx1101
-// UNBUNDLE-SAME: -unbundle
-// UNBUNDLE-SAME: -verbose
-
-// Test compress bundled code objects.
-
-// RUN: %clang -c -### -v --target=x86_64-linux-gnu \
-// RUN: -x hip --offload-arch=gfx1100 --offload-arch=gfx1101 \
-// RUN: --no-offload-new-driver -nogpuinc -nogpulib \
-// RUN: %S/Inputs/hip_multiple_inputs/a.cu \
-// RUN: --offload-compress \
-// RUN: 2>&1 | FileCheck -check-prefix=CO %s
-
-// CO: clang-offload-bundler{{.*}} "-type=o"
-// CO-SAME: -targets={{.*}}hipv4-amdgcn-amd-amdhsa--gfx1100,hipv4-amdgcn-amd-amdhsa--gfx1101
-// CO-SAME: "--compress" "--verbose"
diff --git a/clang/test/Driver/hip-offload-compress-zstd.hip b/clang/test/Driver/hip-offload-compress-zstd.hip
index bffeb38afebac..884b8add4cbb9 100644
--- a/clang/test/Driver/hip-offload-compress-zstd.hip
+++ b/clang/test/Driver/hip-offload-compress-zstd.hip
@@ -1,52 +1,11 @@
// REQUIRES: zstd
-// Test compress bundled bitcode.
-
-// RUN: rm -rf %t.bc
-// RUN: %clang -c -v --target=x86_64-linux-gnu \
-// RUN: -x hip --offload-arch=gfx1100 --offload-arch=gfx1101 \
-// RUN: --no-offload-new-driver -fgpu-rdc -nogpuinc -nogpulib \
-// RUN: %S/Inputs/hip_multiple_inputs/a.cu \
-// RUN: --offload-compress --offload-compression-level=9 \
-// RUN: --offload-device-only --gpu-bundle-output \
-// RUN: -o %t.bc \
-// RUN: 2>&1 | FileCheck %s
-
-// CHECK: clang-offload-bundler{{.*}} -type=o
-// CHECK-SAME: -targets={{.*}}hip-amdgcn-amd-amdhsa-unknown-gfx1100,hip-amdgcn-amd-amdhsa-unknown-gfx1101
-// CHECK-SAME: --compress --verbose --compression-level=9
-// CHECK: Compressed bundle format
-
-// Test uncompress of bundled bitcode.
-
-// RUN: %clang --hip-link -### -v --target=x86_64-linux-gnu \
-// RUN: --offload-arch=gfx1100 --offload-arch=gfx1101 \
-// RUN: --no-offload-new-driver -fgpu-rdc -nogpulib \
-// RUN: %t.bc --offload-device-only \
-// RUN: 2>&1 | FileCheck -check-prefix=UNBUNDLE %s
-
-// UNBUNDLE: clang-offload-bundler{{.*}} "-type=bc"
-// UNBUNDLE-SAME: -targets={{.*}}hip-amdgcn-amd-amdhsa-unknown-gfx1100,hip-amdgcn-amd-amdhsa-unknown-gfx1101
-// UNBUNDLE-SAME: -unbundle
-// UNBUNDLE-SAME: -verbose
-
-// Test compress bundled code objects.
-
-// RUN: %clang -c -### -v --target=x86_64-linux-gnu \
-// RUN: -x hip --offload-arch=gfx1100 --offload-arch=gfx1101 \
-// RUN: --no-offload-new-driver -nogpuinc -nogpulib \
-// RUN: %S/Inputs/hip_multiple_inputs/a.cu \
-// RUN: --offload-compress \
-// RUN: 2>&1 | FileCheck -check-prefix=CO %s
-
-// CO: clang-offload-bundler{{.*}} "-type=o"
-// CO-SAME: -targets={{.*}}hipv4-amdgcn-amd-amdhsa--gfx1100,hipv4-amdgcn-amd-amdhsa--gfx1101
-// CO-SAME: "--compress" "--verbose"
+// Test compress with the new driver.
// RUN: rm -rf %t.bc
// RUN: %clang -### -v --target=x86_64-linux-gnu \
// RUN: -x hip --offload-arch=gfx1100 --offload-arch=gfx1101 \
-// RUN: --offload-new-driver -fgpu-rdc -nogpuinc -nogpulib \
+// RUN: -fgpu-rdc -nogpuinc -nogpulib \
// RUN: %S/Inputs/hip_multiple_inputs/a.cu \
// RUN: --offload-compress --offload-compression-level=9 \
// RUN: --gpu-bundle-output \
diff --git a/clang/test/Driver/hip-options.hip b/clang/test/Driver/hip-options.hip
index 25d5d7f7673d1..e66d2fe228610 100644
--- a/clang/test/Driver/hip-options.hip
+++ b/clang/test/Driver/hip-options.hip
@@ -242,22 +242,22 @@
// Check --offload-compress --offload-jobs=N does not cause warning.
// RUN: %clang -### -Werror --target=x86_64-unknown-linux-gnu -nogpuinc -nogpulib \
// RUN: --offload-arch=gfx1100 --offload-compress --offload-host-only -M %s \
-// RUN: --offload-jobs=4 --offload-new-driver
+// RUN: --offload-jobs=4
// Check --offload-jobs=N option.
// RUN: %clang -### -Werror --target=x86_64-unknown-linux-gnu -nogpuinc -nogpulib \
-// RUN: --offload-arch=gfx1100 --offload-new-driver --offload-jobs=4 %s 2>&1 | \
+// RUN: --offload-arch=gfx1100 --offload-jobs=4 %s 2>&1 | \
// RUN: FileCheck -check-prefix=JOBS %s
// JOBS: clang-linker-wrapper{{.*}} "--wrapper-jobs=4"
// RUN: not %clang -### --target=x86_64-unknown-linux-gnu -nogpuinc -nogpulib \
-// RUN: --offload-arch=gfx1100 --offload-new-driver --offload-jobs=0x4 %s 2>&1 | \
+// RUN: --offload-arch=gfx1100 --offload-jobs=0x4 %s 2>&1 | \
// RUN: FileCheck -check-prefix=INVJOBS %s
// INVJOBS: clang: error: invalid integral value '0x4' in '--offload-jobs=0x4'
// RUN: %clang -### -Werror --target=x86_64-unknown-linux-gnu -nogpuinc -nogpulib \
-// RUN: --offload-arch=gfx1100 --offload-new-driver --offload-jobs=jobserver %s 2>&1 | \
+// RUN: --offload-arch=gfx1100 --offload-jobs=jobserver %s 2>&1 | \
// RUN: FileCheck -check-prefix=JOBSV %s
// JOBSV: clang-linker-wrapper{{.*}} "--wrapper-jobs=jobserver"
@@ -265,14 +265,14 @@
// RUN: %clang -### -Werror --target=x86_64-unknown-linux-gnu -nogpuinc -nogpulib \
// RUN: -resource-dir=%S/Inputs/resource_dir_with_per_target_subdir \
-// RUN: --offload-arch=gfx1100 --offload-new-driver \
+// RUN: --offload-arch=gfx1100 \
// RUN: -fprofile-instr-generate -fcoverage-mapping %s 2>&1 | \
// RUN: FileCheck -check-prefix=COV %s
// COV: clang-linker-wrapper{{.*}} "--device-compiler=amdgcn-amd-amdhsa=-fprofile-instr-generate" "--device-compiler=amdgcn-amd-amdhsa=-fcoverage-mapping"
// RUN: %clang -### -Werror --target=x86_64-unknown-linux-gnu -nogpuinc -nogpulib \
// RUN: -resource-dir=%S/Inputs/resource_dir_with_per_target_subdir \
-// RUN: --offload-arch=gfx1100 --offload-new-driver \
+// RUN: --offload-arch=gfx1100 \
// RUN: -fprofile-instr-generate -fcoverage-mapping \
// RUN: -fcoverage-compilation-dir=/src %s 2>&1 | \
// RUN: FileCheck -check-prefix=COV-DIR %s
@@ -280,7 +280,7 @@
// RUN: %clang -### -Werror --target=x86_64-unknown-linux-gnu -nogpuinc -nogpulib \
// RUN: -resource-dir=%S/Inputs/resource_dir \
-// RUN: --offload-arch=gfx1100 --offload-new-driver \
+// RUN: --offload-arch=gfx1100 \
// RUN: -fprofile-instr-generate -fcoverage-mapping %s 2>&1 | \
// RUN: FileCheck -check-prefix=NO-COV %s
// NO-COV-NOT: --device-compiler=amdgcn-amd-amdhsa=-fprofile-instr-generate
diff --git a/clang/test/Driver/hip-output-file-name.hip b/clang/test/Driver/hip-output-file-name.hip
deleted file mode 100644
index 6a505411b0a47..0000000000000
--- a/clang/test/Driver/hip-output-file-name.hip
+++ /dev/null
@@ -1,82 +0,0 @@
-// Output bundled code objects for combined compilation.
-// RUN: %clang -### -c --target=x86_64-linux-gnu -fgpu-rdc --no-offload-new-driver \
-// RUN: -nogpulib -nogpuinc --offload-arch=gfx803 --offload-arch=gfx900 %s \
-// RUN: 2>&1 | FileCheck %s
-
-// CHECK: {{.*}}clang-offload-bundler{{.*}}"-output=hip-output-file-name.o"
-
-// Check -E default output is "-" (stdout).
-// If there are multiple preprocessor expansion outputs clang-offload-bundler
-// is used to bundle the final output.
-
-// Output bundled PPE for one GPU for mixed compliation.
-// RUN: %clang -### -E --target=x86_64-linux-gnu --no-offload-new-driver \
-// RUN: -nogpulib -nogpuinc --offload-arch=gfx803 %s \
-// RUN: 2>&1 | FileCheck -check-prefixes=DASH %s
-
-// Output unbundled PPE for one GPU for device only compilation.
-// RUN: %clang -### -E --offload-device-only --target=x86_64-linux-gnu \
-// RUN: --no-offload-new-driver -nogpulib -nogpuinc --offload-arch=gfx803 %s \
-// RUN: 2>&1 | FileCheck -check-prefixes=CLANG-DASH %s
-
-// Output bundled PPE for two GPUs for mixed compilation.
-// RUN: %clang -### -E --target=x86_64-linux-gnu --no-offload-new-driver \
-// RUN: -nogpulib -nogpuinc --offload-arch=gfx803 --offload-arch=gfx900 %s \
-// RUN: 2>&1 | FileCheck -check-prefixes=DASH %s
-
-// Output bundled PPE for two GPUs for mixed compilation with -save-temps.
-// RUN: %clang -### -E -save-temps --target=x86_64-linux-gnu --no-offload-new-driver \
-// RUN: -nogpulib -nogpuinc --offload-arch=gfx803 --offload-arch=gfx900 %s \
-// RUN: 2>&1 | FileCheck -check-prefixes=DASH %s
-
-// Output unbundled PPE for two GPUs for device only compilation.
-// RUN: %clang -### -E --offload-device-only --target=x86_64-linux-gnu --no-offload-new-driver \
-// RUN: -nogpulib -nogpuinc --offload-arch=gfx803 --offload-arch=gfx900 %s \
-// RUN: 2>&1 | FileCheck -check-prefixes=CLANG-DASH %s
-
-// Output bundled PPE for two GPUs for device only compilation with --gpu-bundle-output.
-// RUN: %clang -### -E --offload-device-only --target=x86_64-linux-gnu --no-offload-new-driver \
-// RUN: -nogpulib -nogpuinc --offload-arch=gfx803 --offload-arch=gfx900 %s --gpu-bundle-output \
-// RUN: 2>&1 | FileCheck -check-prefixes=DASH %s
-
-// Output unbundled PPE for two GPUs for device only compilation with --no-gpu-bundle-output.
-// RUN: %clang -### -E --offload-device-only --target=x86_64-linux-gnu --no-offload-new-driver \
-// RUN: -nogpulib -nogpuinc --offload-arch=gfx803 --offload-arch=gfx900 %s --no-gpu-bundle-output \
-// RUN: 2>&1 | FileCheck -check-prefixes=CLANG-DASH %s
-
-// Output unbundled PPE for host only compilation.
-// RUN: %clang -### -E --offload-host-only --target=x86_64-linux-gnu --no-offload-new-driver \
-// RUN: -nogpulib -nogpuinc --offload-arch=gfx803 --offload-arch=gfx900 %s \
-// RUN: 2>&1 | FileCheck -check-prefixes=CLANG-DASH %s
-
-// DASH-NOT: {{.*}}clang{{.*}}"-o" "-"
-// DASH: {{.*}}clang-offload-bundler{{.*}}"-output=-"
-// CLANG-DASH: {{.*}}clang{{.*}}"-o" "-"
-// CLANG-DASH-NOT: {{.*}}clang-offload-bundler{{.*}}"-output=-"
-
-// Check -E with -o.
-
-// Output bundled PPE for two GPUs for mixed compilation.
-// RUN: %clang -### -E -o test.cui --target=x86_64-linux-gnu --no-offload-new-driver \
-// RUN: -nogpulib -nogpuinc --offload-arch=gfx803 --offload-arch=gfx900 %s \
-// RUN: 2>&1 | FileCheck -check-prefixes=OUT %s
-
-// Output bundled PPE for two GPUs for mixed compilation.
-// RUN: %clang -### -E -o test.cui -save-temps --target=x86_64-linux-gnu --no-offload-new-driver \
-// RUN: -nogpulib -nogpuinc --offload-arch=gfx803 --offload-arch=gfx900 %s \
-// RUN: 2>&1 | FileCheck -check-prefixes=OUT %s
-
-// Output bundled PPE for two GPUs for device only compilation with --gpu-bundle-output.
-// RUN: %clang -### -E -o test.cui --offload-device-only --target=x86_64-linux-gnu --no-offload-new-driver \
-// RUN: -nogpulib -nogpuinc --offload-arch=gfx803 --offload-arch=gfx900 --gpu-bundle-output %s \
-// RUN: 2>&1 | FileCheck -check-prefixes=OUT %s
-
-// Output unbundled PPE for two GPUs for device only compilation.
-// RUN: %clang -### -E -o test.cui --offload-host-only --target=x86_64-linux-gnu --no-offload-new-driver \
-// RUN: -nogpulib -nogpuinc --offload-arch=gfx803 --offload-arch=gfx900 %s \
-// RUN: 2>&1 | FileCheck -check-prefixes=CLANG-OUT %s
-
-// OUT-NOT: {{.*}}clang{{.*}}"-o" "test.cui"
-// OUT: {{.*}}clang-offload-bundler{{.*}}"-output=test.cui"
-// CLANG-OUT: {{.*}}clang{{.*}}"-o" "test.cui"
-// CLANG-OUT-NOT: {{.*}}clang-offload-bundler{{.*}}"-output=test.cui"
diff --git a/clang/test/Driver/hip-partial-link.hip b/clang/test/Driver/hip-partial-link.hip
deleted file mode 100644
index d1a57bbe1d75c..0000000000000
--- a/clang/test/Driver/hip-partial-link.hip
+++ /dev/null
@@ -1,97 +0,0 @@
-// REQUIRES: x86-registered-target, amdgpu-registered-target, lld
-
-// RUN: %clang -x hip --target=x86_64-unknown-linux-gnu --no-offload-new-driver \
-// RUN: --offload-arch=gfx906 -c -nostdinc -nogpuinc -nohipwrapperinc \
-// RUN: -nogpulib -fgpu-rdc -I%S/Inputs %s -o %t.1.o
-
-// RUN: %clang -x hip --target=x86_64-unknown-linux-gnu -DLIB --no-offload-new-driver \
-// RUN: --offload-arch=gfx906 -c -nostdinc -nogpuinc -nohipwrapperinc \
-// RUN: -nogpulib -fgpu-rdc -I%S/Inputs %s -o %t.2.o
-
-// RUN: %clang -x hip --target=x86_64-unknown-linux-gnu -DMAIN --no-offload-new-driver \
-// RUN: --offload-arch=gfx906 -c -nostdinc -nogpuinc -nohipwrapperinc \
-// RUN: -nogpulib -fgpu-rdc -I%S/Inputs %s -o %t.main.o
-
-// RUN: llvm-nm %t.1.o | FileCheck -check-prefix=OBJ1 %s
-// OBJ1: B __hip_cuid_[[ID:[0-9a-f]+]]
-// OBJ1: U __hip_fatbin_[[ID]]
-// OBJ1: U __hip_gpubin_handle_[[ID]]
-
-// RUN: llvm-nm %t.2.o | FileCheck -check-prefix=OBJ2 %s
-// OBJ2: B __hip_cuid_[[ID:[0-9a-f]+]]
-// OBJ2: U __hip_fatbin_[[ID]]
-// OBJ2: U __hip_gpubin_handle_[[ID]]
-
-// Link %t.1.o and %t.2.o by -r and then link with %t.main.o
-
-// RUN: %clang -v --target=x86_64-unknown-linux-gnu --no-offload-new-driver \
-// RUN: --hip-link -fgpu-rdc --offload-arch=gfx906 \
-// RUN: -r -fuse-ld=lld -nostdlib %t.1.o %t.2.o -o %t.lib.o \
-// RUN: 2>&1 | FileCheck -check-prefix=LD-R %s
-// LD-R: Found undefined HIP fatbin symbol: __hip_fatbin_[[ID1:[0-9a-f]+]]
-// LD-R: Found undefined HIP fatbin symbol: __hip_fatbin_[[ID2:[0-9a-f]+]]
-// LD-R: Found undefined HIP gpubin handle symbol: __hip_gpubin_handle_[[ID1]]
-// LD-R: Found undefined HIP gpubin handle symbol: __hip_gpubin_handle_[[ID2]]
-// LD-R: "{{.*[/\\]}}clang-offload-bundler" {{.*}}-unbundle
-// LD-R: "{{.*[/\\]}}lld" -flavor gnu -m elf64_amdgpu
-// LD-R: "{{.*[/\\]}}clang-offload-bundler"
-// LD-R: "{{.*[/\\]}}clang{{.*}}" -target x86_64-unknown-linux-gnu
-// LD-R: "{{.*[/\\]}}ld.lld" {{.*}} -r
-
-// RUN: llvm-nm %t.lib.o | FileCheck -check-prefix=OBJ %s
-// OBJ: B __hip_cuid_[[ID1:[0-9a-f]+]]
-// OBJ: B __hip_cuid_[[ID2:[0-9a-f]+]]
-// OBJ: R __hip_fatbin_[[ID1]]
-// OBJ: R __hip_fatbin_[[ID2]]
-// OBJ: D __hip_gpubin_handle_[[ID1]]
-// OBJ: D __hip_gpubin_handle_[[ID2]]
-
-// RUN: %clang -v --target=x86_64-unknown-linux-gnu --no-offload-new-driver \
-// RUN: --hip-link -fgpu-rdc --offload-arch=gfx906 \
-// RUN: -fuse-ld=lld -nostdlib -r %t.main.o %t.lib.o -o %t.final.o \
-// RUN: 2>&1 | FileCheck -check-prefix=LINK-O %s
-// LINK-O-NOT: Found undefined HIP {{.*}}symbol
-
-// Generate a static lib with %t.1.o and %t.2.o then link with %t.main.o
-
-// RUN: %clang -v --target=x86_64-unknown-linux-gnu --no-offload-new-driver \
-// RUN: --hip-link -fgpu-rdc --offload-arch=gfx906 \
-// RUN: --emit-static-lib -fuse-ld=lld -nostdlib %t.1.o %t.2.o -o %t.a \
-// RUN: 2>&1 | FileCheck -check-prefix=STATIC %s
-// STATIC: Found undefined HIP fatbin symbol: __hip_fatbin_[[ID1:[0-9a-f]+]]
-// STATIC: Found undefined HIP fatbin symbol: __hip_fatbin_[[ID2:[0-9a-f]+]]
-// STATIC: Found undefined HIP gpubin handle symbol: __hip_gpubin_handle_[[ID1]]
-// STATIC: Found undefined HIP gpubin handle symbol: __hip_gpubin_handle_[[ID2]]
-// STATIC: "{{.*[/\\]}}clang-offload-bundler" {{.*}}-unbundle
-// STATIC: "{{.*[/\\]}}lld" -flavor gnu -m elf64_amdgpu
-// STATIC: "{{.*[/\\]}}clang-offload-bundler"
-// STATIC: "{{.*[/\\]}}clang{{.*}}" -target x86_64-unknown-linux-gnu
-// STATIC: "{{.*[/\\]}}llvm-ar"
-
-// RUN: %clang -v --target=x86_64-unknown-linux-gnu --no-offload-new-driver \
-// RUN: --hip-link -no-hip-rt -fgpu-rdc --offload-arch=gfx906 \
-// RUN: -fuse-ld=lld -nostdlib -r %t.main.o %t.a -o %t.final.o \
-// RUN: 2>&1 | FileCheck -check-prefix=LINK-A %s
-// LINK-A-NOT: Found undefined HIP {{.*}}symbol
-
-#include "hip.h"
-
-#ifdef LIB
-__device__ int x;
-__device__ void libfun() {
- x = 1;
-}
-#elif !defined(MAIN)
-__device__ void libfun();
-__global__ void kern() {
- libfun();
-}
-void run() {
- kern<<<1,1>>>();
-}
-#else
-extern void run();
-int main() {
- run();
-}
-#endif
diff --git a/clang/test/Driver/hip-phases.hip b/clang/test/Driver/hip-phases.hip
index 8fb58dc98cefc..7ac9121786a83 100644
--- a/clang/test/Driver/hip-phases.hip
+++ b/clang/test/Driver/hip-phases.hip
@@ -7,55 +7,32 @@
// Test single gpu architecture with complete compilation.
//
// RUN: %clang -x hip --target=x86_64-unknown-linux-gnu -ccc-print-phases \
-// RUN: --no-offload-new-driver --cuda-gpu-arch=gfx803 %s 2>&1 \
-// RUN: | FileCheck -check-prefixes=BIN,OLDN %s
-// RUN: %clang -x hip --target=x86_64-unknown-linux-gnu -ccc-print-phases \
-// RUN: --offload-new-driver --cuda-gpu-arch=gfx803 %s 2>&1 \
+// RUN: --cuda-gpu-arch=gfx803 %s 2>&1 \
// RUN: | FileCheck -check-prefixes=BIN,NEW,NEWN %s
// RUN: %clang -x hip --target=x86_64-unknown-linux-gnu -ccc-print-phases \
-// RUN: --offload-new-driver --cuda-gpu-arch=gfx803 -flto -c %s 2>&1 \
+// RUN: --cuda-gpu-arch=gfx803 -flto -c %s 2>&1 \
// RUN: | FileCheck -check-prefixes=BIN,NEW,NEWLTO %s
//
// RUN: %clang -x hip --target=x86_64-unknown-linux-gnu -ccc-print-phases \
-// RUN: --no-offload-new-driver --cuda-gpu-arch=gfx803 -fgpu-rdc %s 2>&1 \
-// RUN: | FileCheck -check-prefixes=BIN,OLDR %s
-// RUN: %clang -x hip --target=x86_64-unknown-linux-gnu -ccc-print-phases \
-// RUN: --offload-new-driver --cuda-gpu-arch=gfx803 -fgpu-rdc %s 2>&1 \
+// RUN: --cuda-gpu-arch=gfx803 -fgpu-rdc %s 2>&1 \
// RUN: | FileCheck -check-prefixes=BIN,NEW,NEWR %s
//
// BIN-DAG: [[P0:[0-9]+]]: input, "{{.*}}hip-phases.hip", [[T:hip]], (host-[[T]])
// BIN-DAG: [[P1:[0-9]+]]: preprocessor, {[[P0]]}, [[T]]-cpp-output, (host-[[T]])
// BIN-DAG: [[P2:[0-9]+]]: compiler, {[[P1]]}, ir, (host-[[T]])
-// OLDR-DAG: [[P12:[0-9]+]]: backend, {[[P2]]}, assembler, (host-[[T]])
-// OLDR-DAG: [[P13:[0-9]+]]: assembler, {[[P12]]}, object, (host-[[T]])
// BIN-DAG: [[P3:[0-9]+]]: input, "{{.*}}hip-phases.hip", [[T]], (device-[[T]], [[ARCH:gfx803]])
// BIN-DAG: [[P4:[0-9]+]]: preprocessor, {[[P3]]}, [[T]]-cpp-output, (device-[[T]], [[ARCH]])
// BIN-DAG: [[P5:[0-9]+]]: compiler, {[[P4]]}, ir, (device-[[T]], [[ARCH]])
-// OLDN-DAG: [[P6:[0-9]+]]: backend, {[[P5]]}, assembler, (device-[[T]], [[ARCH]])
-// OLDN-DAG: [[P7:[0-9]+]]: assembler, {[[P6]]}, object, (device-[[T]], [[ARCH]])
-// OLDN-DAG: [[P8:[0-9]+]]: linker, {[[P7]]}, image, (device-[[T]], [[ARCH]])
-// OLDN-DAG: [[P9:[0-9]+]]: offload, "device-[[T]] (amdgcn-amd-amdhsa:[[ARCH]])" {[[P8]]}, image
-// OLDN-DAG: [[P10:[0-9]+]]: linker, {[[P9]]}, hip-fatbin, (device-[[T]])
-// OLDR-DAG: [[P6:[0-9]+]]: backend, {[[P5]]}, lto-bc, (device-[[T]], [[ARCH]])
-// OLDR-DAG: [[P7:[0-9]+]]: linker, {[[P6]]}, image, (device-[[T]], [[ARCH]])
-// OLDR-DAG: [[P8:[0-9]+]]: offload, "device-[[T]] (amdgcn-amd-amdhsa:[[ARCH]])" {[[P7]]}, image
-// OLDR-DAG: [[P9:[0-9]+]]: linker, {[[P8]]}, object, (device-[[T]])
-// OLDR-DAG: [[P10:[0-9]+]]: offload, "device-[[T]] (amdgcn-amd-amdhsa)" {[[P9]]}, object
// NEW-DAG: [[P6:[0-9]+]]: backend, {[[P5]]}, lto-bc, (device-[[T]], [[ARCH]])
// NEW-DAG: [[P7:[0-9]+]]: offload, "device-[[T]] (amdgcn-amd-amdhsa:[[ARCH]])" {[[P6]]}, lto-bc
// NEW-DAG: [[P8:[0-9]+]]: llvm-offload-binary, {[[P7]]}, image, (device-[[T]])
// NEWN-DAG: [[P9:[0-9]+]]: clang-linker-wrapper, {[[P8]]}, hip-fatbin, (device-[[T]])
// NEWLTO-DAG: [[P9:[0-9]+]]: clang-linker-wrapper, {[[P8]]}, hip-fatbin, (device-[[T]])
-// OLDN-DAG: [[P11:[0-9]+]]: offload, "host-[[T]] (x86_64-unknown-linux-gnu)" {[[P2]]}, "device-[[T]] (amdgcn-amd-amdhsa)" {[[P10]]}, ir
// NEWN-DAG: [[P10:[0-9]+]]: offload, "host-[[T]] (x86_64-unknown-linux-gnu)" {[[P2]]}, "device-[[T]] (amdgcn-amd-amdhsa)" {[[P9]]}, ir
// NEWLTO-DAG: [[P10:[0-9]+]]: offload, "host-[[T]] (x86_64-unknown-linux-gnu)" {[[P2]]}, "device-[[T]] (amdgcn-amd-amdhsa)" {[[P9]]}, ir
// NEWR-DAG: [[P9:[0-9]+]]: offload, "host-[[T]] (x86_64-unknown-linux-gnu)" {[[P2]]}, "device-[[T]] (x86_64-unknown-linux-gnu)" {[[P8]]}, ir
-// OLDR-DAG: [[P14:[0-9]+]]: linker, {[[P13]], [[P10]]}, image, (host-[[T]])
-// OLDN-DAG: [[P12:[0-9]+]]: backend, {[[P11]]}, assembler, (host-[[T]])
-// OLDN-DAG: [[P13:[0-9]+]]: assembler, {[[P12]]}, object, (host-[[T]])
-// OLDN-DAG: [[P14:[0-9]+]]: linker, {[[P13]]}, image, (host-[[T]])
// NEWN-DAG: [[P11:[0-9]+]]: backend, {[[P10]]}, assembler, (host-[[T]])
// NEWN-DAG: [[P12:[0-9]+]]: assembler, {[[P11]]}, object, (host-[[T]])
// NEWN-DAG: [[P13:[0-9]+]]: clang-linker-wrapper, {[[P12]]}, image, (host-[[T]])
@@ -64,233 +41,15 @@
// NEWR-DAG: [[P11:[0-9]+]]: assembler, {[[P10]]}, object, (host-[[T]])
// NEWR-DAG: [[P12:[0-9]+]]: clang-linker-wrapper, {[[P11]]}, image, (host-[[T]])
-//
-// Test single gpu architecture up to the assemble phase.
-//
-// RUN: %clang -x hip --target=x86_64-unknown-linux-gnu -ccc-print-phases \
-// RUN: --no-offload-new-driver --cuda-gpu-arch=gfx803 %s -S 2>&1 \
-// RUN: | FileCheck -check-prefixes=ASM %s
-// RUN: %clang -x hip --target=x86_64-unknown-linux-gnu -ccc-print-phases \
-// RUN: --offload-new-driver --cuda-gpu-arch=gfx803 %s -S 2>&1 \
-// RUN: | FileCheck -check-prefixes=ASM %s
-// ASM-DAG: [[P0:[0-9]+]]: input, "{{.*}}hip-phases.hip", [[T:hip]], (device-[[T]], [[ARCH:gfx803]])
-// ASM-DAG: [[P1:[0-9]+]]: preprocessor, {[[P0]]}, [[T]]-cpp-output, (device-[[T]], [[ARCH]])
-// ASM-DAG: [[P2:[0-9]+]]: compiler, {[[P1]]}, ir, (device-[[T]], [[ARCH]])
-// ASM-DAG: [[P3:[0-9]+]]: backend, {[[P2]]}, lto-ir, (device-[[T]], [[ARCH]])
-
-// ASM-DAG: [[P5:[0-9]+]]: input, "{{.*}}hip-phases.hip", [[T]], (host-[[T]])
-// ASM-DAG: [[P6:[0-9]+]]: preprocessor, {[[P5]]}, [[T]]-cpp-output, (host-[[T]])
-// ASM-DAG: [[P7:[0-9]+]]: compiler, {[[P6]]}, ir, (host-[[T]])
-// ASM-DAG: [[P8:[0-9]+]]: backend, {[[P7]]}, assembler, (host-[[T]])
-
-//
-// Test two gpu architectures with complete compilation with -fno-gpu-rdc.
-//
-// RUN: %clang -x hip --target=x86_64-unknown-linux-gnu -ccc-print-phases \
-// RUN: --no-offload-new-driver --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 %s 2>&1 \
-// RUN: | FileCheck -check-prefixes=NRD2,NCL2 %s
-
-// RUN: %clang -x hip --target=x86_64-unknown-linux-gnu -ccc-print-phases \
-// RUN: --no-offload-new-driver --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 %s -c 2>&1 \
-// RUN: | FileCheck -check-prefixes=NRD2 %s
-
-// NRD2-DAG: [[P0:[0-9]+]]: input, "{{.*}}hip-phases.hip", [[T:hip]], (host-[[T]])
-// NRD2-DAG: [[P1:[0-9]+]]: preprocessor, {[[P0]]}, [[T]]-cpp-output, (host-[[T]])
-// NRD2-DAG: [[P2:[0-9]+]]: compiler, {[[P1]]}, ir, (host-[[T]])
-
-// NRD2-DAG: [[P3:[0-9]+]]: input, "{{.*}}hip-phases.hip", [[T]], (device-[[T]], [[ARCH1:gfx803]])
-// NRD2-DAG: [[P4:[0-9]+]]: preprocessor, {[[P3]]}, [[T]]-cpp-output, (device-[[T]], [[ARCH1]])
-// NRD2-DAG: [[P5:[0-9]+]]: compiler, {[[P4]]}, ir, (device-[[T]], [[ARCH1]])
-// NRD2-DAG: [[P6:[0-9]+]]: backend, {[[P5]]}, assembler, (device-[[T]], [[ARCH1]])
-// NRD2-DAG: [[P7:[0-9]+]]: assembler, {[[P6]]}, object, (device-[[T]], [[ARCH1]])
-// NRD2-DAG: [[P8:[0-9]+]]: linker, {[[P7]]}, image, (device-[[T]], [[ARCH1]])
-// NRD2-DAG: [[P9:[0-9]+]]: offload, "device-[[T]] (amdgcn-amd-amdhsa:[[ARCH1]])" {[[P8]]}, image
-
-// NRD2-DAG: [[P10:[0-9]+]]: input, "{{.*}}hip-phases.hip", [[T]], (device-[[T]], [[ARCH2:gfx900]])
-// NRD2-DAG: [[P11:[0-9]+]]: preprocessor, {[[P10]]}, [[T]]-cpp-output, (device-[[T]], [[ARCH2]])
-// NRD2-DAG: [[P12:[0-9]+]]: compiler, {[[P11]]}, ir, (device-[[T]], [[ARCH2]])
-// NRD2-DAG: [[P13:[0-9]+]]: backend, {[[P12]]}, assembler, (device-[[T]], [[ARCH2]])
-// NRD2-DAG: [[P14:[0-9]+]]: assembler, {[[P13]]}, object, (device-[[T]], [[ARCH2]])
-// NRD2-DAG: [[P15:[0-9]+]]: linker, {[[P14]]}, image, (device-[[T]], [[ARCH2]])
-// NRD2-DAG: [[P16:[0-9]+]]: offload, "device-[[T]] (amdgcn-amd-amdhsa:[[ARCH2]])" {[[P15]]}, image
-// NRD2-DAG: [[P17:[0-9]+]]: linker, {[[P9]], [[P16]]}, hip-fatbin, (device-[[T]])
-// NRD2-DAG: [[P18:[0-9]+]]: offload, "host-[[T]] (x86_64-unknown-linux-gnu)" {[[P2]]}, "device-[[T]] (amdgcn-amd-amdhsa)" {[[P17]]}, ir
-// NRD2-DAG: [[P19:[0-9]+]]: backend, {[[P18]]}, assembler, (host-[[T]])
-// NRD2-DAG: [[P20:[0-9]+]]: assembler, {[[P19]]}, object, (host-[[T]])
-// NCL2-DAG: [[P21:[0-9]+]]: linker, {[[P20]]}, image, (host-[[T]])
-
-//
-// Test two gpu architectures with complete compilation with -fgpu-rdc.
-//
-// RUN: %clang -x hip --target=x86_64-unknown-linux-gnu -ccc-print-phases \
-// RUN: --no-offload-new-driver --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 %s -fgpu-rdc 2>&1 \
-// RUN: | FileCheck -check-prefixes=RDC2,RCL2 %s
-
-// RUN: %clang -x hip --target=x86_64-unknown-linux-gnu -ccc-print-phases \
-// RUN: --no-offload-new-driver --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 %s -fgpu-rdc -c 2>&1 \
-// RUN: | FileCheck -check-prefixes=RDC2,RC2 %s
-
-// RCL2-DAG: [[P0:[0-9]+]]: input, "{{.*}}hip-phases.hip", [[T:hip]], (host-[[T]])
-// RCL2-DAG: [[P1:[0-9]+]]: preprocessor, {[[P0]]}, [[T]]-cpp-output, (host-[[T]])
-// RCL2-DAG: [[P2:[0-9]+]]: compiler, {[[P1]]}, ir, (host-[[T]])
-// RCL2-DAG: [[P19:[0-9]+]]: backend, {[[P2]]}, assembler, (host-[[T]])
-// RCL2-DAG: [[P20:[0-9]+]]: assembler, {[[P19]]}, object, (host-[[T]])
-
-// RDC2-DAG: [[P3:[0-9]+]]: input, "{{.*}}hip-phases.hip", [[T:hip]], (device-[[T]], [[ARCH1:gfx803]])
-// RDC2-DAG: [[P4:[0-9]+]]: preprocessor, {[[P3]]}, [[T]]-cpp-output, (device-[[T]], [[ARCH1]])
-// RDC2-DAG: [[P5:[0-9]+]]: compiler, {[[P4]]}, ir, (device-[[T]], [[ARCH1]])
-// RDC2-DAG: [[P6:[0-9]+]]: backend, {[[P5]]}, lto-bc, (device-[[T]], [[ARCH1]])
-// RCL2-DAG: [[P8:[0-9]+]]: linker, {[[P6]]}, image, (device-[[T]], [[ARCH1]])
-// RCL2-DAG: [[P9:[0-9]+]]: offload, "device-[[T]] (amdgcn-amd-amdhsa:[[ARCH1]])" {[[P8]]}, image
-// RC2-DAG: [[P9:[0-9]+]]: offload, "device-[[T]] (amdgcn-amd-amdhsa:[[ARCH1]])" {[[P6]]}, lto-bc
-
-// RDC2-DAG: [[P10:[0-9]+]]: input, "{{.*}}hip-phases.hip", [[T]], (device-[[T]], [[ARCH2:gfx900]])
-// RDC2-DAG: [[P11:[0-9]+]]: preprocessor, {[[P10]]}, [[T]]-cpp-output, (device-[[T]], [[ARCH2]])
-// RDC2-DAG: [[P12:[0-9]+]]: compiler, {[[P11]]}, ir, (device-[[T]], [[ARCH2]])
-// RDC2-DAG: [[P13:[0-9]+]]: backend, {[[P12]]}, lto-bc, (device-[[T]], [[ARCH2]])
-// RCL2-DAG: [[P15:[0-9]+]]: linker, {[[P13]]}, image, (device-[[T]], [[ARCH2]])
-// RCL2-DAG: [[P16:[0-9]+]]: offload, "device-[[T]] (amdgcn-amd-amdhsa:[[ARCH2]])" {[[P15]]}, image
-// RC2-DAG: [[P16:[0-9]+]]: offload, "device-[[T]] (amdgcn-amd-amdhsa:[[ARCH2]])" {[[P13]]}, lto-bc
-
-// RC2-DAG: [[P0:[0-9]+]]: input, "{{.*}}hip-phases.hip", [[T:hip]], (host-[[T]])
-// RC2-DAG: [[P1:[0-9]+]]: preprocessor, {[[P0]]}, [[T]]-cpp-output, (host-[[T]])
-// RC2-DAG: [[P2:[0-9]+]]: compiler, {[[P1]]}, ir, (host-[[T]])
-// RC2-DAG: [[P19:[0-9]+]]: backend, {[[P2]]}, assembler, (host-[[T]])
-// RC2-DAG: [[P20:[0-9]+]]: assembler, {[[P19]]}, object, (host-[[T]])
-
-// RCL2-DAG: [[P17:[0-9]+]]: linker, {[[P9]], [[P16]]}, object, (device-[[T]])
-// RCL2-DAG: [[P22:[0-9]+]]: offload, "device-[[T]] (amdgcn-amd-amdhsa)" {[[P17]]}, object
-// RCL2-DAG: [[P23:[0-9]+]]: linker, {[[P20]], [[P22]]}, image, (host-[[T]])
-// RC2-DAG: [[P23:[0-9]+]]: clang-offload-bundler, {[[P9]], [[P16]], [[P20]]}, object, (host-[[T]])
-
-//
-// Test two gpu architecturess up to the assemble phase.
-//
-// RUN: %clang -x hip --target=x86_64-unknown-linux-gnu -ccc-print-phases \
-// RUN: --no-offload-new-driver --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 %s -S 2>&1 \
-// RUN: | FileCheck -check-prefixes=ASM2 %s
-// ASM2-DAG: [[P0:[0-9]+]]: input, "{{.*}}hip-phases.hip", [[T:hip]], (device-[[T]], [[ARCH1:gfx803]])
-// ASM2-DAG: [[P1:[0-9]+]]: preprocessor, {[[P0]]}, [[T]]-cpp-output, (device-[[T]], [[ARCH1]])
-// ASM2-DAG: [[P2:[0-9]+]]: compiler, {[[P1]]}, ir, (device-[[T]], [[ARCH1]])
-// ASM2-DAG: [[P5:[0-9]+]]: input, "{{.*}}hip-phases.hip", [[T]], (device-[[T]], [[ARCH2:sm_35|gfx900]])
-// ASM2-DAG: [[P6:[0-9]+]]: preprocessor, {[[P5]]}, [[T]]-cpp-output, (device-[[T]], [[ARCH2]])
-// ASM2-DAG: [[P7:[0-9]+]]: compiler, {[[P6]]}, ir, (device-[[T]], [[ARCH2]])
-// ASM2-DAG: [[P10:[0-9]+]]: input, "{{.*}}hip-phases.hip", [[T]], (host-[[T]])
-// ASM2-DAG: [[P11:[0-9]+]]: preprocessor, {[[P10]]}, [[T]]-cpp-output, (host-[[T]])
-// ASM2-DAG: [[P12:[0-9]+]]: compiler, {[[P11]]}, ir, (host-[[T]])
-// ASM2-DAG: [[P13:[0-9]+]]: backend, {[[P12]]}, assembler, (host-[[T]])
-
-//
-// Test single gpu architecture with complete compilation in host-only
-// compilation mode.
-//
-// RUN: %clang -x hip --target=x86_64-unknown-linux-gnu -ccc-print-phases \
-// RUN: --no-offload-new-driver --cuda-gpu-arch=gfx803 %s --cuda-host-only 2>&1 \
-// RUN: | FileCheck -check-prefixes=HBIN %s
-// HBIN-DAG: [[P0:[0-9]+]]: input, "{{.*}}hip-phases.hip", [[T:hip]], (host-[[T]])
-// HBIN-DAG: [[P1:[0-9]+]]: preprocessor, {[[P0]]}, [[T]]-cpp-output, (host-[[T]])
-// HBIN-DAG: [[P2:[0-9]+]]: compiler, {[[P1]]}, ir, (host-[[T]])
-// HBIN-DAG: [[P3:[0-9]+]]: backend, {[[P2]]}, assembler, (host-[[T]])
-// HBIN-DAG: [[P4:[0-9]+]]: assembler, {[[P3]]}, object, (host-[[T]])
-// HBIN-DAG: [[P5:[0-9]+]]: linker, {[[P4]]}, image, (host-[[T]])
-// HBIN-NOT: device
-//
-// Test single gpu architecture up to the assemble phase in host-only
-// compilation mode.
-//
-// RUN: %clang -x hip --target=x86_64-unknown-linux-gnu -ccc-print-phases \
-// RUN: --no-offload-new-driver --cuda-gpu-arch=gfx803 %s --cuda-host-only -S 2>&1 \
-// RUN: | FileCheck -check-prefixes=HASM %s
-// HASM-DAG: [[P0:[0-9]+]]: input, "{{.*}}hip-phases.hip", [[T:hip]], (host-[[T]])
-// HASM-DAG: [[P1:[0-9]+]]: preprocessor, {[[P0]]}, [[T]]-cpp-output, (host-[[T]])
-// HASM-DAG: [[P2:[0-9]+]]: compiler, {[[P1]]}, ir, (host-[[T]])
-// HASM-DAG: [[P3:[0-9]+]]: backend, {[[P2]]}, assembler, (host-[[T]])
-// HASM-NOT: device
-
-//
-// Test two gpu architectures with complete compilation in host-only
-// compilation mode.
-//
-// RUN: %clang -x hip --target=x86_64-unknown-linux-gnu -ccc-print-phases \
-// RUN: --no-offload-new-driver --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 %s --cuda-host-only 2>&1 \
-// RUN: | FileCheck -check-prefixes=HBIN2 %s
-// HBIN2-DAG: [[P0:[0-9]+]]: input, "{{.*}}hip-phases.hip", [[T:hip]], (host-[[T]])
-// HBIN2-DAG: [[P1:[0-9]+]]: preprocessor, {[[P0]]}, [[T]]-cpp-output, (host-[[T]])
-// HBIN2-DAG: [[P2:[0-9]+]]: compiler, {[[P1]]}, ir, (host-[[T]])
-// HBIN2-DAG: [[P3:[0-9]+]]: backend, {[[P2]]}, assembler, (host-[[T]])
-// HBIN2-DAG: [[P4:[0-9]+]]: assembler, {[[P3]]}, object, (host-[[T]])
-// HBIN2-DAG: [[P5:[0-9]+]]: linker, {[[P4]]}, image, (host-[[T]])
-// HBIN2-NOT: device
-
-//
-// Test two gpu architectures up to the assemble phase in host-only
-// compilation mode.
-//
-// RUN: %clang -x hip --target=x86_64-unknown-linux-gnu -ccc-print-phases \
-// RUN: --no-offload-new-driver --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 %s --cuda-host-only -S \
-// RUN: 2>&1 | FileCheck -check-prefixes=HASM2 %s
-// HASM2-DAG: [[P0:[0-9]+]]: input, "{{.*}}hip-phases.hip", [[T:hip]], (host-[[T]])
-// HASM2-DAG: [[P1:[0-9]+]]: preprocessor, {[[P0]]}, [[T]]-cpp-output, (host-[[T]])
-// HASM2-DAG: [[P2:[0-9]+]]: compiler, {[[P1]]}, ir, (host-[[T]])
-// HASM2-DAG: [[P3:[0-9]+]]: backend, {[[P2]]}, assembler, (host-[[T]])
-// HASM2-NOT: device
-
-//
-// Test single gpu architecture with complete compilation in device-only
-// compilation mode.
-//
-// RUN: %clang -x hip --target=x86_64-unknown-linux-gnu -ccc-print-phases \
-// RUN: --no-offload-new-driver --cuda-gpu-arch=gfx803 %s --cuda-device-only 2>&1 \
-// RUN: | FileCheck -check-prefixes=DBIN %s
-//
-// Test single gpu architecture with complete compilation in device-only
-// compilation mode with an unused host linker flag.
-//
-// RUN: %clang -x hip --target=x86_64-unknown-linux-gnu -ccc-print-phases \
-// RUN: --no-offload-new-driver --cuda-gpu-arch=gfx803 %s --cuda-device-only -Wl,--disable-new-dtags 2>&1 \
-// RUN: | FileCheck -check-prefixes=DBIN %s
-
-// DBIN-DAG: [[P0:[0-9]+]]: input, "{{.*}}hip-phases.hip", [[T:hip]], (device-[[T]], [[ARCH:gfx803]])
-// DBIN-DAG: [[P1:[0-9]+]]: preprocessor, {[[P0]]}, [[T]]-cpp-output, (device-[[T]], [[ARCH]])
-// DBIN-DAG: [[P2:[0-9]+]]: compiler, {[[P1]]}, ir, (device-[[T]], [[ARCH]])
-// DBIN-DAG: [[P3:[0-9]+]]: backend, {[[P2]]}, assembler, (device-[[T]], [[ARCH]])
-// DBIN-DAG: [[P4:[0-9]+]]: assembler, {[[P3]]}, object, (device-[[T]], [[ARCH]])
-// DBIN-DAG: [[P5:[0-9]+]]: linker, {[[P4]]}, image, (device-[[T]], [[ARCH]])
-// DBIN-DAG: [[P6:[0-9]+]]: offload, "device-[[T]] (amdgcn-amd-amdhsa:[[ARCH]])" {[[P5]]}, image
-// DBIN-DAG: [[P7:[0-9]+]]: linker, {[[P6]]}, hip-fatbin, (device-hip)
-// DBIN-DAG: [[P8:[0-9]+]]: offload, "device-[[T]] (amdgcn-amd-amdhsa)" {[[P7]]}, hip-fatbin
-// DBIN-NOT: host
-
-//
-// Test single gpu architecture up to the assemble phase in device-only
-// compilation mode.
-//
-// RUN: %clang -x hip --target=x86_64-unknown-linux-gnu -ccc-print-phases --no-offload-new-driver \
-// RUN: --cuda-gpu-arch=gfx803 %s --cuda-device-only -S --no-gpu-bundle-output 2>&1 \
-// RUN: | FileCheck -check-prefixes=DASM %s
-// DASM-DAG: [[P0:[0-9]+]]: input, "{{.*}}hip-phases.hip", [[T:hip]], (device-[[T]], [[ARCH:gfx803]])
-// DASM-DAG: [[P1:[0-9]+]]: preprocessor, {[[P0]]}, [[T]]-cpp-output, (device-[[T]], [[ARCH]])
-// DASM-DAG: [[P2:[0-9]+]]: compiler, {[[P1]]}, ir, (device-[[T]], [[ARCH]])
-// DASM-DAG: [[P3:[0-9]+]]: backend, {[[P2]]}, assembler, (device-[[T]], [[ARCH]])
-// DASM-DAG: [[P4:[0-9]+]]: offload, "device-[[T]] (amdgcn-amd-amdhsa:[[ARCH]])" {[[P3]]}, assembler
-// DASM-NOT: clang-offload-bundler
-// DASM-NOT: host
-
//
// Test single gpu architecture with compile to relocatable in device-only
// compilation mode.
//
-// RUN: %clang -x hip --target=x86_64-unknown-linux-gnu -ccc-print-phases --no-offload-new-driver \
-// RUN: --cuda-gpu-arch=gfx803 %s --cuda-device-only -fhip-emit-relocatable 2>&1 \
-// RUN: | FileCheck -check-prefixes=RELOC %s
-// RUN: %clang -x hip --target=x86_64-unknown-linux-gnu -ccc-print-phases --offload-new-driver \
+// RUN: %clang -x hip --target=x86_64-unknown-linux-gnu -ccc-print-phases \
// RUN: --cuda-gpu-arch=gfx803 %s --cuda-device-only -fhip-emit-relocatable 2>&1 \
// RUN: | FileCheck -check-prefixes=RELOC %s
//
-// RUN: %clang -x hip --target=x86_64-unknown-linux-gnu -ccc-print-phases --no-offload-new-driver \
-// RUN: --cuda-gpu-arch=gfx803 %s --cuda-device-only -fhip-emit-relocatable -Wl,--disable-new-dtags \
-// RUN: 2>&1 | FileCheck -check-prefixes=RELOC %s
-// RUN: %clang -x hip --target=x86_64-unknown-linux-gnu -ccc-print-phases --offload-new-driver \
+// RUN: %clang -x hip --target=x86_64-unknown-linux-gnu -ccc-print-phases \
// RUN: --cuda-gpu-arch=gfx803 %s --cuda-device-only -fhip-emit-relocatable -Wl,--disable-new-dtags \
// RUN: 2>&1 | FileCheck -check-prefixes=RELOC %s
//
@@ -303,360 +62,10 @@
// RELOC-DAG: [[P5:[0-9]+]]: offload, "device-[[T]] (amdgcn-amd-amdhsa:[[ARCH]])" {[[P4]]}
// RELOC-NOT: host
-//
-// Test two gpu architectures with compile to relocatable in device-only
-// compilation mode.
-//
-// RUN: %clang -x hip --target=x86_64-unknown-linux-gnu -ccc-print-phases --no-offload-new-driver \
-// RUN: --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 %s --cuda-device-only -fhip-emit-relocatable 2>&1 \
-// RUN: | FileCheck -check-prefixes=RELOC2 %s
-//
-// RUN: %clang -x hip --target=x86_64-unknown-linux-gnu -ccc-print-phases --no-offload-new-driver \
-// RUN: --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 %s --cuda-device-only -fhip-emit-relocatable \
-// RUN: -Wl,--disable-new-dtags 2>&1 | FileCheck -check-prefixes=RELOC2 %s
-//
-// RELOC2-DAG: [[P0:[0-9]+]]: input, "{{.*}}hip-phases.hip", [[T:hip]], (device-[[T]], [[ARCH:gfx803]])
-// RELOC2-DAG: [[P1:[0-9]+]]: preprocessor, {[[P0]]}, [[T]]-cpp-output, (device-[[T]], [[ARCH]])
-// RELOC2-DAG: [[P2:[0-9]+]]: compiler, {[[P1]]}, ir, (device-[[T]], [[ARCH]])
-// RELOC2-DAG: [[P3:[0-9]+]]: backend, {[[P2]]}, assembler, (device-[[T]], [[ARCH]])
-// RELOC2-DAG: [[P4:[0-9]+]]: assembler, {[[P3]]}, object, (device-[[T]], [[ARCH]])
-// RELOC2-NOT: linker
-// RELOC2-DAG: [[P5:[0-9]+]]: offload, "device-[[T]] (amdgcn-amd-amdhsa:[[ARCH]])" {[[P4]]}, object
-// RELOC2-DAG: [[P6:[0-9]+]]: input, "{{.*}}hip-phases.hip", [[T:hip]], (device-[[T]], [[ARCH2:gfx900]])
-// RELOC2-DAG: [[P7:[0-9]+]]: preprocessor, {[[P6]]}, [[T]]-cpp-output, (device-[[T]], [[ARCH2]])
-// RELOC2-DAG: [[P8:[0-9]+]]: compiler, {[[P7]]}, ir, (device-[[T]], [[ARCH2]])
-// RELOC2-DAG: [[P9:[0-9]+]]: backend, {[[P8]]}, assembler, (device-[[T]], [[ARCH2]])
-// RELOC2-DAG: [[P10:[0-9]+]]: assembler, {[[P9]]}, object, (device-[[T]], [[ARCH2]])
-// RELOC2-NOT: linker
-// RELOC2-DAG: [[P11:[0-9]+]]: offload, "device-[[T]] (amdgcn-amd-amdhsa:[[ARCH2]])" {[[P10]]}, object
-// RELOC2-NOT: host
-
-//
-// Test two gpu architectures with complete compilation in device-only
-// compilation mode.
-//
-// RUN: %clang -x hip --target=x86_64-unknown-linux-gnu -ccc-print-phases --no-offload-new-driver \
-// RUN: --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 %s --cuda-device-only \
-// RUN: 2>&1 | FileCheck -check-prefixes=DBIN2 %s
-//
-// Test two gpu architectures with complete compilation in device-only
-// compilation mode with an unused host linker flag.
-//
-// RUN: %clang -x hip --target=x86_64-unknown-linux-gnu -ccc-print-phases --no-offload-new-driver \
-// RUN: --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 %s --cuda-device-only \
-// RUN: -Wl,--disable-new-dtags 2>&1 | FileCheck -check-prefixes=DBIN2 %s
-
-// DBIN2-DAG: [[P0:[0-9]+]]: input, "{{.*}}hip-phases.hip", [[T:hip]], (device-[[T]], [[ARCH:gfx803]])
-// DBIN2-DAG: [[P1:[0-9]+]]: preprocessor, {[[P0]]}, [[T]]-cpp-output, (device-[[T]], [[ARCH]])
-// DBIN2-DAG: [[P2:[0-9]+]]: compiler, {[[P1]]}, ir, (device-[[T]], [[ARCH]])
-// DBIN2-DAG: [[P3:[0-9]+]]: backend, {[[P2]]}, assembler, (device-[[T]], [[ARCH]])
-// DBIN2-DAG: [[P4:[0-9]+]]: assembler, {[[P3]]}, object, (device-[[T]], [[ARCH]])
-// DBIN2-DAG: [[P5:[0-9]+]]: linker, {[[P4]]}, image, (device-[[T]], [[ARCH]])
-// DBIN2-DAG: [[P6:[0-9]+]]: offload, "device-[[T]] (amdgcn-amd-amdhsa:[[ARCH]])" {[[P5]]}, image
-// DBIN2-DAG: [[P7:[0-9]+]]: input, "{{.*}}hip-phases.hip", [[T]], (device-[[T]], [[ARCH2:gfx900]])
-// DBIN2-DAG: [[P8:[0-9]+]]: preprocessor, {[[P7]]}, [[T]]-cpp-output, (device-[[T]], [[ARCH2]])
-// DBIN2-DAG: [[P9:[0-9]+]]: compiler, {[[P8]]}, ir, (device-[[T]], [[ARCH2]])
-// DBIN2-DAG: [[P10:[0-9]+]]: backend, {[[P9]]}, assembler, (device-[[T]], [[ARCH2]])
-// DBIN2-DAG: [[P11:[0-9]+]]: assembler, {[[P10]]}, object, (device-[[T]], [[ARCH2]])
-// DBIN2-DAG: [[P12:[0-9]+]]: linker, {[[P11]]}, image, (device-[[T]], [[ARCH2]])
-// DBIN2-DAG: [[P13:[0-9]+]]: offload, "device-[[T]] (amdgcn-amd-amdhsa:[[ARCH2]])" {[[P12]]}, image
-// DBIN2-DAG: [[P14:[0-9]+]]: linker, {[[P6]], [[P13]]}, hip-fatbin, (device-hip)
-// DBIN2-DAG: [[P15:[0-9]+]]: offload, "device-[[T]] (amdgcn-amd-amdhsa)" {[[P14]]}, hip-fatbin
-// DBIN2-NOT: host
-
-//
-// Test two gpu architectures up to the assemble phase in device-only
-// compilation mode.
-//
-// RUN: %clang -x hip --target=x86_64-unknown-linux-gnu --no-offload-new-driver \
-// RUN: -ccc-print-phases --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 %s \
-// RUN: --cuda-device-only -S -o %t.s 2>&1 \
-// RUN: | FileCheck -check-prefixes=DASM2,DASM2-NOBUNDLE %s
-// RUN: %clang -x hip --target=x86_64-unknown-linux-gnu --no-offload-new-driver \
-// RUN: -ccc-print-phases --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 %s \
-// RUN: --cuda-device-only -S -o %t.s --no-gpu-bundle-output 2>&1 \
-// RUN: | FileCheck -check-prefixes=DASM2,DASM2-NOBUNDLE %s
-// RUN: %clang -x hip --target=x86_64-unknown-linux-gnu --no-offload-new-driver \
-// RUN: -ccc-print-phases --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 %s \
-// RUN: --cuda-device-only -S 2>&1 \
-// RUN: | FileCheck -check-prefixes=DASM2,DASM2-NOBUNDLE %s
-// RUN: %clang -x hip --target=x86_64-unknown-linux-gnu --no-offload-new-driver \
-// RUN: -ccc-print-phases --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 %s \
-// RUN: --cuda-device-only -S --gpu-bundle-output 2>&1 \
-// RUN: | FileCheck -check-prefixes=DASM2,DASM2-BUNDLE %s
-// DASM2-DAG: [[P0:[0-9]+]]: input, "{{.*}}hip-phases.hip", [[T:hip]], (device-[[T]], [[ARCH:gfx803]])
-// DASM2-DAG: [[P1:[0-9]+]]: preprocessor, {[[P0]]}, [[T]]-cpp-output, (device-[[T]], [[ARCH]])
-// DASM2-DAG: [[P2:[0-9]+]]: compiler, {[[P1]]}, ir, (device-[[T]], [[ARCH]])
-// DASM2-DAG: [[P3:[0-9]+]]: backend, {[[P2]]}, assembler, (device-[[T]], [[ARCH]])
-// DASM2-DAG: [[P4:[0-9]+]]: offload, "device-[[T]] (amdgcn-amd-amdhsa:[[ARCH]])" {[[P3]]}, assembler
-// DASM2-DAG: [[P5:[0-9]+]]: input, "{{.*}}hip-phases.hip", [[T]], (device-[[T]], [[ARCH2:gfx900]])
-// DASM2-DAG: [[P6:[0-9]+]]: preprocessor, {[[P5]]}, [[T]]-cpp-output, (device-[[T]], [[ARCH2]])
-// DASM2-DAG: [[P7:[0-9]+]]: compiler, {[[P6]]}, ir, (device-[[T]], [[ARCH2]])
-// DASM2-DAG: [[P8:[0-9]+]]: backend, {[[P7]]}, assembler, (device-[[T]], [[ARCH2]])
-// DASM2-DAG: [[P9:[0-9]+]]: offload, "device-[[T]] (amdgcn-amd-amdhsa:[[ARCH2]])" {[[P8]]}, assembler
-// DASM2-BUNDLE: [[P10:[0-9]+]]: clang-offload-bundler, {[[P4]], [[P9]]}, assembler, (device-hip)
-// DASM2-NOBUNDLE-NOT: clang-offload-bundler, {[[P4]], [[P9]]}, assembler, (device-hip)
-// DASM2-NOT: host
-
-//
-// Test linking two objects with two gpu architectures.
-//
-// RUN: rm -rf %t && mkdir %t
-// RUN: touch %t/obj1.o %t/obj2.o
-
-// RUN: %clang --target=x86_64-unknown-linux-gnu -ccc-print-phases --hip-link \
-// RUN: --no-offload-new-driver --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 %t/obj1.o %t/obj2.o 2>&1 \
-// RUN: | FileCheck -check-prefixes=L2,NL2 %s
-//
-// RUN: %clang --target=x86_64-unknown-linux-gnu -ccc-print-phases --hip-link \
-// RUN: --no-offload-new-driver --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 %t/obj1.o %t/obj2.o \
-// RUN: -fgpu-rdc 2>&1 | FileCheck -check-prefixes=L2,RL2,RL2-EM %s
-//
-// RUN: %clang --target=x86_64-unknown-linux-gnu -ccc-print-phases --hip-link \
-// RUN: --no-offload-new-driver --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 %t/obj1.o %t/obj2.o \
-// RUN: -fgpu-rdc --cuda-device-only 2>&1 | FileCheck -check-prefixes=L2,RL2,RL2-DEV %s
-
-// RUN: %clang --target=x86_64-unknown-linux-gnu -ccc-print-phases --hip-link \
-// RUN: --no-offload-new-driver --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 %t/obj1.o %t/obj2.o \
-// RUN: -fgpu-rdc --cuda-device-only -Wl,--disable-new-dtags 2>&1 \
-// RUN: | FileCheck -check-prefixes=L2,RL2,RL2-DEV %s
-
-// RUN: %clang --target=x86_64-unknown-linux-gnu -ccc-print-phases --hip-link \
-// RUN: --no-offload-new-driver --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 %t/obj1.o %t/obj2.o \
-// RUN: -fgpu-rdc --cuda-device-only --no-gpu-bundle-output 2>&1 \
-// RUN: | FileCheck -check-prefixes=L2,RL2,RL2-NB %s
-
-// RUN: %clang --target=x86_64-unknown-linux-gnu -ccc-print-phases --hip-link \
-// RUN: --no-offload-new-driver --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 %t/obj1.o %t/obj2.o \
-// RUN: -fgpu-rdc --cuda-device-only --no-gpu-bundle-output -Wl,--disable-new-dtags 2>&1 \
-// RUN: | FileCheck -check-prefixes=L2,RL2,RL2-NB %s
-
-// L2-DAG: [[P0:[0-9]+]]: input, "{{.*}}obj1.o", object
-// RL2-DAG: [[P1:[0-9]+]]: clang-offload-unbundler, {[[P0]]}, object
-// L2-DAG: [[P2:[0-9]+]]: input, "{{.*}}obj2.o", object
-// RL2-DAG: [[P3:[0-9]+]]: clang-offload-unbundler, {[[P2]]}, object
-
-// RL2-DAG: [[P4:[0-9]+]]: linker, {[[P1]], [[P3]]}, image, (device-[[T:hip]], [[ARCH1:gfx803]])
-// RL2-DAG: [[P5:[0-9]+]]: offload, "device-[[T]] (amdgcn-amd-amdhsa:[[ARCH1]])" {[[P4]]}, image
-// RL2-DAG: [[P6:[0-9]+]]: linker, {[[P1]], [[P3]]}, image, (device-[[T]], [[ARCH2:gfx900]])
-// RL2-DAG: [[P7:[0-9]+]]: offload, "device-[[T]] (amdgcn-amd-amdhsa:[[ARCH2]])" {[[P6]]}, image
-// RL2-DEV-DAG: [[P8:[0-9]+]]: linker, {[[P5]], [[P7]]}, hip-fatbin, (device-[[T]])
-// RL2-DEV-DAG: [[P9:[0-9]+]]: offload, "device-[[T]] (amdgcn-amd-amdhsa)" {[[P8]]}, hip-fatbin
-// RL2-EM-DAG: [[P8:[0-9]+]]: linker, {[[P5]], [[P7]]}, object, (device-[[T]])
-// RL2-EM-DAG: [[P9:[0-9]+]]: offload, "device-[[T]] (amdgcn-amd-amdhsa)" {[[P8]]}, object
-// RL2-NB-NOT: linker
-// RL2-NB-NOT: offload
-
-// NL2-DAG: [[P4:[0-9]+]]: linker, {[[P0]], [[P2]]}, image
-// RL2-EM-DAG: [[P4:[0-9]+]]: linker, {[[P1]], [[P3]], [[P9]]}, image, (host-[[T]])
-// RL2-DEV-NOT: linker
-// RL2-NB-NOT: host
-
-// Test one gpu architectures up to the preprocessor expansion output phase in device-only
-// compilation mode. no bundle.
-//
-// RUN: %clang -x hip --target=x86_64-unknown-linux-gnu \
-// RUN: -ccc-print-phases --cuda-gpu-arch=gfx803 %s \
-// RUN: --no-offload-new-driver --cuda-device-only -E 2>&1 \
-// RUN: | FileCheck -check-prefixes=PPE,PPEN %s
-
-// RUN: %clang -x hip --target=x86_64-unknown-linux-gnu \
-// RUN: -ccc-print-phases --cuda-gpu-arch=gfx803 %s \
-// RUN: --no-offload-new-driver --cuda-device-only -E --no-gpu-bundle-output 2>&1 \
-// RUN: | FileCheck -check-prefixes=PPE,PPEN %s
-
-// Test one gpu architectures up to the preprocessor expansion output phase in device-only
-// compilation mode. bundle.
-
-// RUN: %clang -x hip --target=x86_64-unknown-linux-gnu \
-// RUN: -ccc-print-phases --cuda-gpu-arch=gfx803 %s \
-// RUN: --no-offload-new-driver --cuda-device-only -E --gpu-bundle-output 2>&1 \
-// RUN: | FileCheck -check-prefixes=PPE,PPEB %s
-
-// Test two gpu architectures up to the preprocessor expansion output phase in device-only
-// compilation mode. no bundle.
-
-// RUN: %clang -x hip --target=x86_64-unknown-linux-gnu \
-// RUN: -ccc-print-phases --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 %s \
-// RUN: --no-offload-new-driver --cuda-device-only -E 2>&1 \
-// RUN: | FileCheck -check-prefixes=PPE2,PPE2N %s
-
-// RUN: %clang -x hip --target=x86_64-unknown-linux-gnu \
-// RUN: -ccc-print-phases --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 %s \
-// RUN: --no-offload-new-driver --cuda-device-only -E --no-gpu-bundle-output 2>&1 \
-// RUN: | FileCheck -check-prefixes=PPE2,PPE2N %s
-
-// Test two gpu architectures up to the preprocessor expansion output phase in device-only
-// compilation mode. bundle.
-
-// RUN: %clang -x hip --target=x86_64-unknown-linux-gnu \
-// RUN: -ccc-print-phases --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 %s \
-// RUN: --no-offload-new-driver --cuda-device-only -E --gpu-bundle-output 2>&1 \
-// RUN: | FileCheck -check-prefixes=PPE2,PPE2B %s
-
-// Test one gpu architectures up to the LLVM IR output phase in device-only
-// compilation mode. no bundle.
-//
-// RUN: %clang -x hip --target=x86_64-unknown-linux-gnu \
-// RUN: -ccc-print-phases --cuda-gpu-arch=gfx803 %s \
-// RUN: --no-offload-new-driver --cuda-device-only -c -emit-llvm 2>&1 \
-// RUN: | FileCheck -check-prefixes=LLVM %s
-
-// Test two gpu architectures up to the LLVM IR output phase in device-only
-// compilation mode. bundle.
-//
-// RUN: %clang -x hip --target=x86_64-unknown-linux-gnu \
-// RUN: -ccc-print-phases --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 %s \
-// RUN: --no-offload-new-driver --cuda-device-only -c -emit-llvm -o %t.bc --gpu-bundle-output 2>&1 \
-// RUN: | FileCheck -check-prefixes=LLVM2 %s
-
-// Test two gpu architectures up to the LLVM IR output phase in device-only
-// compilation mode with bundled preprocessor expansion as input. bundle.
-//
-// RUN: %clang -x hip-cpp-output --target=x86_64-unknown-linux-gnu \
-// RUN: -ccc-print-phases --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 %s \
-// RUN: --no-offload-new-driver --cuda-device-only -c -emit-llvm -o %t.bc --gpu-bundle-output 2>&1 \
-// RUN: | FileCheck -check-prefixes=PPELLVM2 %s
-
-// PPE-DAG: [[P0:[0-9]+]]: input, "{{.*}}hip-phases.hip", [[T:hip]], (device-[[T]], [[ARCH:gfx803]])
-// PPE-DAG: [[P1:[0-9]+]]: preprocessor, {[[P0]]}, [[T]]-cpp-output, (device-[[T]], [[ARCH]])
-// PPE-DAG: [[P2:[0-9]+]]: offload, "device-[[T]] (amdgcn-amd-amdhsa:[[ARCH]])" {[[P1]]}, [[T]]-cpp-output
-// PPEB-DAG: [[P3:[0-9]+]]: clang-offload-bundler, {[[P2]]}, [[T]]-cpp-output, (device-hip)
-// PPEN-NOT: clang-offload-bundler, {{.*}}, [[T]]-cpp-output, (device-hip)
-// PPE-NOT: host
-
-// PPE2-DAG: [[P0:[0-9]+]]: input, "{{.*}}hip-phases.hip", [[T:hip]], (device-[[T]], [[ARCH:gfx803]])
-// PPE2-DAG: [[P1:[0-9]+]]: preprocessor, {[[P0]]}, [[T]]-cpp-output, (device-[[T]], [[ARCH]])
-// PPE2-DAG: [[P2:[0-9]+]]: offload, "device-[[T]] (amdgcn-amd-amdhsa:[[ARCH]])" {[[P1]]}, [[T]]-cpp-output
-// PPE2-DAG: [[P5:[0-9]+]]: input, "{{.*}}hip-phases.hip", [[T]], (device-[[T]], [[ARCH2:gfx900]])
-// PPE2-DAG: [[P6:[0-9]+]]: preprocessor, {[[P5]]}, [[T]]-cpp-output, (device-[[T]], [[ARCH2]])
-// PPE2-DAG: [[P9:[0-9]+]]: offload, "device-[[T]] (amdgcn-amd-amdhsa:[[ARCH2]])" {[[P6]]}, [[T]]-cpp-output
-// PPE2B-DAG: [[P10:[0-9]+]]: clang-offload-bundler, {[[P2]], [[P9]]}, [[T]]-cpp-output, (device-hip)
-// PPE2N-NOT: clang-offload-bundler, {{.*}}, [[T]]-cpp-output, (device-hip)
-// PPE2-NOT: host
-
-// LLVM-DAG: [[P0:[0-9]+]]: input, "{{.*}}hip-phases.hip", [[T:hip]], (device-[[T]], [[ARCH:gfx803]])
-// LLVM-DAG: [[P1:[0-9]+]]: preprocessor, {[[P0]]}, [[T]]-cpp-output, (device-[[T]], [[ARCH]])
-// LLVM-DAG: [[P2:[0-9]+]]: compiler, {[[P1]]}, ir, (device-[[T]], [[ARCH]])
-// LLVM-DAG: [[P3:[0-9]+]]: backend, {[[P2]]}, ir, (device-[[T]], [[ARCH]])
-// LLVM-NOT: clang-offload-bundler
-// LLVM-NOT: host
-
-// LLVM2-DAG: [[P0:[0-9]+]]: input, "{{.*}}hip-phases.hip", [[T:hip]], (device-[[T]], [[ARCH:gfx803]])
-// LLVM2-DAG: [[P1:[0-9]+]]: preprocessor, {[[P0]]}, [[T]]-cpp-output, (device-[[T]], [[ARCH]])
-// LLVM2-DAG: [[P2:[0-9]+]]: compiler, {[[P1]]}, ir, (device-[[T]], [[ARCH]])
-// LLVM2-DAG: [[P3:[0-9]+]]: backend, {[[P2]]}, ir, (device-[[T]], [[ARCH]])
-// LLVM2-DAG: [[P4:[0-9]+]]: offload, "device-[[T]] (amdgcn-amd-amdhsa:[[ARCH]])" {[[P3]]}, ir
-// LLVM2-DAG: [[P5:[0-9]+]]: input, "{{.*}}hip-phases.hip", [[T]], (device-[[T]], [[ARCH2:gfx900]])
-// LLVM2-DAG: [[P6:[0-9]+]]: preprocessor, {[[P5]]}, [[T]]-cpp-output, (device-[[T]], [[ARCH2]])
-// LLVM2-DAG: [[P7:[0-9]+]]: compiler, {[[P6]]}, ir, (device-[[T]], [[ARCH2]])
-// LLVM2-DAG: [[P8:[0-9]+]]: backend, {[[P7]]}, ir, (device-[[T]], [[ARCH2]])
-// LLVM2-DAG: [[P9:[0-9]+]]: offload, "device-[[T]] (amdgcn-amd-amdhsa:[[ARCH2]])" {[[P8]]}, ir
-// LLVM2-DAG: [[P10:[0-9]+]]: clang-offload-bundler, {[[P4]], [[P9]]}, ir, (device-hip)
-// LLVM2-NOT: host
-
-// PPELLVM2-DAG: [[P0:[0-9]+]]: input, "{{.*}}hip-phases.hip", [[T:hip]]-cpp-output
-// PPELLVM2-DAG: [[P1:[0-9]+]]: clang-offload-unbundler, {[[P0]]}, hip-cpp-output
-// PPELLVM2-DAG: [[P2:[0-9]+]]: compiler, {[[P1]]}, ir, (device-[[T]], [[ARCH:gfx803]])
-// PPELLVM2-DAG: [[P3:[0-9]+]]: backend, {[[P2]]}, ir, (device-[[T]], [[ARCH]])
-// PPELLVM2-DAG: [[P4:[0-9]+]]: offload, "device-[[T]] (amdgcn-amd-amdhsa:[[ARCH]])" {[[P3]]}, ir
-// PPELLVM2-DAG: [[P7:[0-9]+]]: compiler, {[[P1]]}, ir, (device-[[T]], [[ARCH2:gfx900]])
-// PPELLVM2-DAG: [[P8:[0-9]+]]: backend, {[[P7]]}, ir, (device-[[T]], [[ARCH2]])
-// PPELLVM2-DAG: [[P9:[0-9]+]]: offload, "device-[[T]] (amdgcn-amd-amdhsa:[[ARCH2]])" {[[P8]]}, ir
-// PPELLVM2-DAG: [[P10:[0-9]+]]: clang-offload-bundler, {[[P4]], [[P9]]}, ir, (device-hip)
-// PPELLVM2-NOT: host
-
-// Test mixed HIP and C++ compilation. HIP program should have HIP offload kind.
-// C++ program should have no offload kind.
-
-// Test compile empty.hip and empty.cpp.
-// RUN: %clang --target=x86_64-unknown-linux-gnu --no-offload-new-driver \
-// RUN: -ccc-print-phases --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 \
-// RUN: -c %S/Inputs/empty.hip %S/Inputs/empty.cpp 2>&1 | FileCheck -check-prefixes=MIXED %s
-// RUN: %clang --target=x86_64-unknown-linux-gnu --no-offload-new-driver \
-// RUN: -ccc-print-phases --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 \
-// RUN: -c %S/Inputs/empty.hip %S/Inputs/empty.cpp 2>&1 | FileCheck -check-prefixes=MIXED-NEG %s
-
-// Test compile and link empty.hip and empty.cpp.
-// RUN: %clang --target=x86_64-unknown-linux-gnu --no-offload-new-driver \
-// RUN: -ccc-print-phases --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 \
-// RUN: %S/Inputs/empty.hip %S/Inputs/empty.cpp 2>&1 | FileCheck -check-prefixes=MIXED %s
-// RUN: %clang --target=x86_64-unknown-linux-gnu --no-offload-new-driver \
-// RUN: -ccc-print-phases --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 \
-// RUN: %S/Inputs/empty.hip %S/Inputs/empty.cpp 2>&1 | FileCheck -check-prefixes=MIXED-NEG %s
-
-// Test compile and link empty.hip and empty.cpp with --hip-link -fgpu-rdc.
-// RUN: %clang --target=x86_64-unknown-linux-gnu --hip-link -fgpu-rdc --no-offload-new-driver \
-// RUN: -ccc-print-phases --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 \
-// RUN: %S/Inputs/empty.hip %S/Inputs/empty.cpp 2>&1 | FileCheck -check-prefixes=MIXED %s
-// RUN: %clang --target=x86_64-unknown-linux-gnu --hip-link -fgpu-rdc --no-offload-new-driver \
-// RUN: -ccc-print-phases --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 \
-// RUN: %S/Inputs/empty.hip %S/Inputs/empty.cpp 2>&1 | FileCheck -check-prefixes=MIXED-NEG %s
-
-// Test compile and link -x hip empty.hip and -x c++ empty.cpp.
-// RUN: %clang --target=x86_64-unknown-linux-gnu --no-offload-new-driver \
-// RUN: -ccc-print-phases --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 \
-// RUN: -x hip %S/Inputs/empty.hip -x c++ %S/Inputs/empty.cpp 2>&1 | FileCheck -check-prefixes=MIXED %s
-// RUN: %clang --target=x86_64-unknown-linux-gnu --no-offload-new-driver \
-// RUN: -ccc-print-phases --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 \
-// RUN: -x hip %S/Inputs/empty.hip -x c++ %S/Inputs/empty.cpp 2>&1 | FileCheck -check-prefixes=MIXED-NEG %s
-
-// Test compile and link -x hip empty.hip and empty.cpp.
-// RUN: %clang --target=x86_64-unknown-linux-gnu --no-offload-new-driver \
-// RUN: -ccc-print-phases --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 \
-// RUN: -x hip %S/Inputs/empty.hip %S/Inputs/empty.cpp 2>&1 | FileCheck -check-prefixes=MIXED2 %s
-// RUN: %clang --target=x86_64-unknown-linux-gnu --no-offload-new-driver \
-// RUN: -ccc-print-phases --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 \
-// RUN: -x hip %S/Inputs/empty.hip %S/Inputs/empty.cpp 2>&1 | FileCheck -check-prefixes=MIXED2-NEG %s
-
-// Test compile and link empty.hip and -x hip empty.cpp.
-// RUN: %clang --target=x86_64-unknown-linux-gnu --no-offload-new-driver \
-// RUN: -ccc-print-phases --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 \
-// RUN: %S/Inputs/empty.hip -x hip %S/Inputs/empty.cpp 2>&1 | FileCheck -check-prefixes=MIXED2 %s
-// RUN: %clang --target=x86_64-unknown-linux-gnu --no-offload-new-driver \
-// RUN: -ccc-print-phases --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 \
-// RUN: -x hip %S/Inputs/empty.hip %S/Inputs/empty.cpp 2>&1 | FileCheck -check-prefixes=MIXED2-NEG %s
-
-// MIXED-DAG: input, "{{.*}}empty.hip", hip, (host-hip)
-// MIXED-DAG: input, "{{.*}}empty.hip", hip, (device-hip, gfx803)
-// MIXED-DAG: input, "{{.*}}empty.hip", hip, (device-hip, gfx900)
-// MIXED-DAG: input, "{{.*}}empty.cpp", c++
-// MIXED-NEG-NOT: input, "{{.*}}empty.cpp", c++, (device-hip
-
-// MIXED2-DAG: input, "{{.*}}empty.hip", hip, (host-hip)
-// MIXED2-DAG: input, "{{.*}}empty.hip", hip, (device-hip, gfx803)
-// MIXED2-DAG: input, "{{.*}}empty.hip", hip, (device-hip, gfx900)
-// MIXED2-DAG: input, "{{.*}}empty.cpp", hip, (host-hip)
-// MIXED2-DAG: input, "{{.*}}empty.cpp", hip, (device-hip, gfx803)
-// MIXED2-DAG: input, "{{.*}}empty.cpp", hip, (device-hip, gfx900)
-// MIXED2-NEG-NOT: input, "{{.*}}empty.cpp", c++
-
-// Test HIP bitcode to bitcode linking. Input should be bundled or unbundled bitcode, and
-// output should be unbundled linked bitcode
-
-// RUN: touch %t/bitcodeA.bc
-// RUN: touch %t/bitcodeB.bc
-// RUN: %clang -ccc-print-phases --hip-link -emit-llvm --cuda-device-only \
-// RUN: --no-offload-new-driver --offload-arch=gfx906 %t/bitcodeA.bc %t/bitcodeB.bc 2>&1 \
-// RUN: | FileCheck -check-prefixes=CHECK %s
-
-// CHECK: [[A0:[0-9]+]]: input, "{{.*}}bitcodeA.bc", ir
-// CHECK: [[A1:[0-9]+]]: clang-offload-unbundler, {[[A0]]}, ir
-// CHECK: [[A2:[0-9]+]]: compiler, {[[A1]]}, ir, (device-hip, [[ARCH:gfx906]])
-// CHECK: [[A3:[0-9]+]]: backend, {[[A2]]}, ir, (device-hip, [[ARCH]])
-
-// CHECK: [[B0:[0-9]+]]: input, "{{.*}}bitcodeB.bc", ir
-// CHECK: [[B1:[0-9]+]]: clang-offload-unbundler, {[[B0]]}, ir
-// CHECK: [[B2:[0-9]+]]: compiler, {[[B1]]}, ir, (device-hip, [[ARCH]])
-// CHECK: [[B3:[0-9]+]]: backend, {[[B2]]}, ir, (device-hip, [[ARCH]])
-
-// CHECK: [[L0:[0-9]+]]: linker, {[[A3]], [[B3]]}, ir, (device-hip, [[ARCH]])
-// CHECK: offload, "device-hip (amdgcn-amd-amdhsa:[[ARCH]])" {[[L0]]}, ir
-
//
// Test the bindings using the new driver in LTO-mode.
//
-// RUN: %clang -### --target=x86_64-linux-gnu --offload-new-driver -ccc-print-phases \
+// RUN: %clang -### --target=x86_64-linux-gnu -ccc-print-phases \
// RUN: --offload-arch=gfx90a --offload-arch=gfx908 -foffload-lto -fgpu-rdc -c %s 2>&1 \
// RUN: | FileCheck -check-prefix=LTO %s
// LTO: 0: input, "[[INPUT:.+]]", hip, (host-hip)
@@ -680,7 +89,7 @@
//
// Test the new driver when not bundling
//
-// RUN: %clang -### --target=x86_64-linux-gnu --offload-new-driver -ccc-print-phases \
+// RUN: %clang -### --target=x86_64-linux-gnu -ccc-print-phases \
// RUN: --offload-device-only --offload-arch=gfx90a -emit-llvm -c %s 2>&1 \
// RUN: | FileCheck -check-prefix=DEVICE-ONLY %s
// DEVICE-ONLY: 0: input, "[[INPUT:.+]]", hip, (device-hip, gfx90a)
@@ -692,7 +101,7 @@
//
// Test the new driver bundling SPIR-V targets.
//
-// RUN: %clang -### --target=x86_64-linux-gnu --offload-new-driver -ccc-print-phases \
+// RUN: %clang -### --target=x86_64-linux-gnu -ccc-print-phases \
// RUN: --offload-device-only -no-use-spirv-backend \
// RUN: --offload-arch=amdgcnspirv,gfx1030 %s 2>&1 \
// RUN: | FileCheck -check-prefix=SPIRV-ONLY %s
diff --git a/clang/test/Driver/hip-rdc-device-only.hip b/clang/test/Driver/hip-rdc-device-only.hip
deleted file mode 100644
index b946f198160a2..0000000000000
--- a/clang/test/Driver/hip-rdc-device-only.hip
+++ /dev/null
@@ -1,184 +0,0 @@
-// RUN: %clang -### --target=x86_64-linux-gnu --no-offload-new-driver \
-// RUN: -x hip --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 \
-// RUN: -c -nogpuinc -nogpulib --cuda-device-only -fgpu-rdc \
-// RUN: %S/Inputs/hip_multiple_inputs/a.cu \
-// RUN: %S/Inputs/hip_multiple_inputs/b.hip --gpu-bundle-output \
-// RUN: 2>&1 | FileCheck -check-prefixes=COMMON,EMITBC %s
-
-// With `-emit-llvm`, the output should be the same as the aforementioned line
-// as `-fgpu-rdc` in HIP implies `-emit-llvm`.
-
-// RUN: %clang -### --target=x86_64-linux-gnu --no-offload-new-driver \
-// RUN: -x hip --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 \
-// RUN: -c -emit-llvm -nogpuinc -nogpulib --cuda-device-only -fgpu-rdc \
-// RUN: %S/Inputs/hip_multiple_inputs/a.cu \
-// RUN: %S/Inputs/hip_multiple_inputs/b.hip --gpu-bundle-output \
-// RUN: 2>&1 | FileCheck -check-prefixes=COMMON,EMITBC %s
-
-// With `-fno-hip-emit-relocatable`, the output should be the same as the aforementioned line
-// as `-fgpu-rdc` in HIP implies `-fno-hip-emit-relocatable`.
-
-// RUN: %clang -### --target=x86_64-linux-gnu --no-offload-new-driver \
-// RUN: -x hip --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 \
-// RUN: -c -fno-hip-emit-relocatable -nogpuinc -nogpulib --cuda-device-only -fgpu-rdc \
-// RUN: %S/Inputs/hip_multiple_inputs/a.cu \
-// RUN: %S/Inputs/hip_multiple_inputs/b.hip --gpu-bundle-output \
-// RUN: 2>&1 | FileCheck -check-prefixes=COMMON,EMITBC %s
-
-// RUN: %clang -### --target=x86_64-linux-gnu --no-offload-new-driver \
-// RUN: -x hip --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 \
-// RUN: -S -nogpuinc -nogpulib --cuda-device-only -fgpu-rdc \
-// RUN: %S/Inputs/hip_multiple_inputs/a.cu \
-// RUN: %S/Inputs/hip_multiple_inputs/b.hip --gpu-bundle-output \
-// RUN: 2>&1 | FileCheck -check-prefixes=COMMON,EMITLL %s
-
-// With `-emit-llvm`, the output should be the same as the aforementioned line
-// as `-fgpu-rdc` in HIP implies `-emit-llvm`.
-
-// RUN: %clang -### --target=x86_64-linux-gnu --no-offload-new-driver \
-// RUN: -x hip --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 \
-// RUN: -S -emit-llvm -nogpuinc -nogpulib --cuda-device-only -fgpu-rdc \
-// RUN: %S/Inputs/hip_multiple_inputs/a.cu \
-// RUN: %S/Inputs/hip_multiple_inputs/b.hip --gpu-bundle-output \
-// RUN: 2>&1 | FileCheck -check-prefixes=COMMON,EMITLL %s
-
-// With `-save-temps`, commane lines for each steps are dumped. For assembly
-// output, there should 3 steps (preprocessor, compile, and backend) per source
-// and per target, totally 12 steps.
-
-// RUN: %clang -### -save-temps --target=x86_64-linux-gnu --no-offload-new-driver \
-// RUN: -x hip --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 \
-// RUN: -S -nogpuinc -nogpulib --cuda-device-only -fgpu-rdc \
-// RUN: %S/Inputs/hip_multiple_inputs/a.cu \
-// RUN: %S/Inputs/hip_multiple_inputs/b.hip --gpu-bundle-output \
-// RUN: 2>&1 | FileCheck -check-prefix=SAVETEMP %s
-
-// Check output one file without bundling cause error.
-
-// RUN: not %clang -### --target=x86_64-linux-gnu --no-offload-new-driver \
-// RUN: -x hip --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 \
-// RUN: -S -nogpuinc -nogpulib --cuda-device-only -fgpu-rdc \
-// RUN: %S/Inputs/hip_multiple_inputs/a.cu -o %t.s --no-gpu-bundle-output \
-// RUN: 2>&1 | FileCheck -check-prefix=FAIL %s
-
-// COMMON: [[CLANG:".*clang.*"]] "-cc1" "-triple" "amdgcn-amd-amdhsa"
-// COMMON-SAME: "-aux-triple" "x86_64-unknown-linux-gnu"
-// EMITBC-SAME: "-emit-llvm-bc"
-// EMITLL-SAME: "-emit-llvm"
-// COMMON-SAME: {{.*}} "-main-file-name" "a.cu"
-// COMMON-SAME: "-fcuda-is-device" "-fno-threadsafe-statics" "-fvisibility=hidden"
-// COMMON-SAME: "-fapply-global-visibility-to-externs"
-// COMMON-SAME: "-target-cpu" "gfx803"
-// COMMON-SAME: "-fgpu-rdc"
-// EMITBC-SAME: {{.*}} "-o" {{".*a.*\.(bc|o)"}} "-x" "hip"
-// EMITLL-SAME: {{.*}} "-o" {{".*a.*\.(s|ll)"}} "-x" "hip"
-// CHECK-SAME: {{.*}} {{".*a.cu"}}
-
-// COMMON: [[CLANG]] "-cc1" "-triple" "amdgcn-amd-amdhsa"
-// COMMON-SAME: "-aux-triple" "x86_64-unknown-linux-gnu"
-// EMITBC-SAME: "-emit-llvm-bc"
-// EMITLL-SAME: "-emit-llvm"
-// COMMON-SAME: {{.*}} "-main-file-name" "a.cu"
-// COMMON-SAME: "-fcuda-is-device" "-fno-threadsafe-statics" "-fvisibility=hidden"
-// COMMON-SAME: "-fapply-global-visibility-to-externs"
-// COMMON-SAME: "-target-cpu" "gfx900"
-// COMMON-SAME: "-fgpu-rdc"
-// EMITBC-SAME: {{.*}} "-o" {{".*a.*\.(bc|o)"}} "-x" "hip"
-// EMITLL-SAME: {{.*}} "-o" {{".*a.*\.(s|ll)"}} "-x" "hip"
-// COMMON-SAME: {{.*}} {{".*a.cu"}}
-
-// COMMON: "{{.*}}clang-offload-bundler" "-type={{(bc|ll|o|s)}}"
-// COMMON-SAME: "-targets=hip-amdgcn-amd-amdhsa-unknown-gfx803,hip-amdgcn-amd-amdhsa-unknown-gfx900"
-// COMMON-SAME: "-output=a-hip-amdgcn-amd-amdhsa.{{(bc|ll|o|s)}}"
-
-// COMMON: [[CLANG]] "-cc1" "-triple" "amdgcn-amd-amdhsa"
-// COMMON-SAME: "-aux-triple" "x86_64-unknown-linux-gnu"
-// EMITBC-SAME: "-emit-llvm-bc"
-// EMITLL-SAME: "-emit-llvm"
-// COMMON-SAME: {{.*}} "-main-file-name" "b.hip"
-// COMMON-SAME: "-fcuda-is-device" "-fno-threadsafe-statics" "-fvisibility=hidden"
-// COMMON-SAME: "-fapply-global-visibility-to-externs"
-// COMMON-SAME: "-target-cpu" "gfx803"
-// COMMON-SAME: "-fgpu-rdc"
-// EMITBC-SAME: {{.*}} "-o" {{".*b.*\.(bc|o)"}} "-x" "hip"
-// EMITLL-SAME: {{.*}} "-o" {{".*b.*\.(s|ll)"}} "-x" "hip"
-// COMMON-SAME: {{.*}} {{".*b.hip"}}
-
-// COMMON: [[CLANG]] "-cc1" "-triple" "amdgcn-amd-amdhsa"
-// COMMON-SAME: "-aux-triple" "x86_64-unknown-linux-gnu"
-// EMITBC-SAME: "-emit-llvm-bc"
-// EMITLL-SAME: "-emit-llvm"
-// COMMON-SAME: {{.*}} "-main-file-name" "b.hip"
-// COMMON-SAME: "-fcuda-is-device" "-fno-threadsafe-statics" "-fvisibility=hidden"
-// COMMON-SAME: "-fapply-global-visibility-to-externs"
-// COMMON-SAME: "-target-cpu" "gfx900"
-// COMMON-SAME: "-fgpu-rdc"
-// EMITBC-SAME: {{.*}} "-o" {{".*b.*\.(bc|o)"}} "-x" "hip"
-// EMITLL-SAME: {{.*}} "-o" {{".*b.*\.(s|ll)"}} "-x" "hip"
-// COMMON-SAME: {{.*}} {{".*b.hip"}}
-
-// COMMON: "{{.*}}clang-offload-bundler" "-type={{(bc|ll|o|s)}}"
-// COMMON-SAME: "-targets=hip-amdgcn-amd-amdhsa-unknown-gfx803,hip-amdgcn-amd-amdhsa-unknown-gfx900"
-// COMMON-SAME: "-output=b-hip-amdgcn-amd-amdhsa.{{(bc|ll|o|s)}}"
-
-// SAVETEMP: [[CLANG:".*clang.*"]] "-cc1" "-triple" "amdgcn-amd-amdhsa" "-aux-triple" "x86_64-unknown-linux-gnu"
-// SAVETEMP-SAME: "-E"
-// SAVETEMP-SAME: {{.*}} "-main-file-name" "a.cu" {{.*}} "-target-cpu" "gfx803"
-// SAVETEMP-SAME: {{.*}} "-o" [[A_GFX803_CUI:"a.*hipi"]] "-x" "hip" {{".*a.cu"}}
-// SAVETEMP-NEXT: [[CLANG]] "-cc1" "-triple" "amdgcn-amd-amdhsa" "-aux-triple" "x86_64-unknown-linux-gnu"
-// SAVETEMP-SAME: "-emit-llvm-bc"
-// SAVETEMP-SAME: {{.*}} "-main-file-name" "a.cu" {{.*}} "-target-cpu" "gfx803"
-// SAVETEMP-SAME: {{.*}} "-o" [[A_GFX803_TMP_BC:"a.*tmp.bc"]] "-x" "hip-cpp-output" [[A_GFX803_CUI]]
-// SAVETEMP-NEXT: [[CLANG]] "-cc1" "-triple" "amdgcn-amd-amdhsa" "-aux-triple" "x86_64-unknown-linux-gnu"
-// SAVETEMP-SAME: "-emit-llvm"
-// SAVETEMP-SAME: {{.*}} "-main-file-name" "a.cu" {{.*}} "-target-cpu" "gfx803"
-// SAVETEMP-SAME: {{.*}} "-o" {{"a.*\.s"}} "-x" "ir" [[A_GFX803_TMP_BC]]
-
-// SAVETEMP: [[CLANG]] "-cc1" "-triple" "amdgcn-amd-amdhsa" "-aux-triple" "x86_64-unknown-linux-gnu"
-// SAVETEMP-SAME: "-E"
-// SAVETEMP-SAME: {{.*}} "-main-file-name" "a.cu" {{.*}} "-target-cpu" "gfx900"
-// SAVETEMP-SAME: {{.*}} "-o" [[A_GFX900_CUI:"a.*hipi"]] "-x" "hip" {{".*a.cu"}}
-// SAVETEMP-NEXT: [[CLANG]] "-cc1" "-triple" "amdgcn-amd-amdhsa" "-aux-triple" "x86_64-unknown-linux-gnu"
-// SAVETEMP-SAME: "-emit-llvm-bc"
-// SAVETEMP-SAME: {{.*}} "-main-file-name" "a.cu" {{.*}} "-target-cpu" "gfx900"
-// SAVETEMP-SAME: {{.*}} "-o" [[A_GFX900_TMP_BC:"a.*tmp.bc"]] "-x" "hip-cpp-output" [[A_GFX900_CUI]]
-// SAVETEMP-NEXT: [[CLANG]] "-cc1" "-triple" "amdgcn-amd-amdhsa" "-aux-triple" "x86_64-unknown-linux-gnu"
-// SAVETEMP-SAME: "-emit-llvm"
-// SAVETEMP-SAME: {{.*}} "-main-file-name" "a.cu" {{.*}} "-target-cpu" "gfx900"
-// SAVETEMP-SAME: {{.*}} "-o" {{"a.*\.s"}} "-x" "ir" [[A_GFX900_TMP_BC]]
-
-// SAVETEMP: "{{.*}}clang-offload-bundler" "-type=s"
-// SAVETEMP-SAME: "-targets=hip-amdgcn-amd-amdhsa-unknown-gfx803,hip-amdgcn-amd-amdhsa-unknown-gfx900"
-// SAVETEMP-SAME: "-output=a-hip-amdgcn-amd-amdhsa.s"
-
-// SAVETEMP: [[CLANG]] "-cc1" "-triple" "amdgcn-amd-amdhsa" "-aux-triple" "x86_64-unknown-linux-gnu"
-// SAVETEMP-SAME: "-E"
-// SAVETEMP-SAME: {{.*}} "-main-file-name" "b.hip" {{.*}} "-target-cpu" "gfx803"
-// SAVETEMP-SAME: {{.*}} "-o" [[B_GFX803_CUI:"b.*hipi"]] "-x" "hip" {{".*b.hip"}}
-// SAVETEMP-NEXT: [[CLANG]] "-cc1" "-triple" "amdgcn-amd-amdhsa" "-aux-triple" "x86_64-unknown-linux-gnu"
-// SAVETEMP-SAME: "-emit-llvm-bc"
-// SAVETEMP-SAME: {{.*}} "-main-file-name" "b.hip" {{.*}} "-target-cpu" "gfx803"
-// SAVETEMP-SAME: {{.*}} "-o" [[B_GFX803_TMP_BC:"b.*tmp.bc"]] "-x" "hip-cpp-output" [[B_GFX803_CUI]]
-// SAVETEMP-NEXT: [[CLANG]] "-cc1" "-triple" "amdgcn-amd-amdhsa" "-aux-triple" "x86_64-unknown-linux-gnu"
-// SAVETEMP-SAME: "-emit-llvm"
-// SAVETEMP-SAME: {{.*}} "-main-file-name" "b.hip" {{.*}} "-target-cpu" "gfx803"
-// SAVETEMP-SAME: {{.*}} "-o" {{"b.*\.s"}} "-x" "ir" [[B_GFX803_TMP_BC]]
-
-// SAVETEMP: [[CLANG]] "-cc1" "-triple" "amdgcn-amd-amdhsa" "-aux-triple" "x86_64-unknown-linux-gnu"
-// SAVETEMP-SAME: "-E"
-// SAVETEMP-SAME: {{.*}} "-main-file-name" "b.hip" {{.*}} "-target-cpu" "gfx900"
-// SAVETEMP-SAME: {{.*}} "-o" [[B_GFX900_CUI:"b.*hipi"]] "-x" "hip" {{".*b.hip"}}
-// SAVETEMP-NEXT: [[CLANG]] "-cc1" "-triple" "amdgcn-amd-amdhsa" "-aux-triple" "x86_64-unknown-linux-gnu"
-// SAVETEMP-SAME: "-emit-llvm-bc"
-// SAVETEMP-SAME: {{.*}} "-main-file-name" "b.hip" {{.*}} "-target-cpu" "gfx900"
-// SAVETEMP-SAME: {{.*}} "-o" [[B_GFX900_TMP_BC:"b.*tmp.bc"]] "-x" "hip-cpp-output" [[B_GFX900_CUI]]
-// SAVETEMP-NEXT: [[CLANG]] "-cc1" "-triple" "amdgcn-amd-amdhsa" "-aux-triple" "x86_64-unknown-linux-gnu"
-// SAVETEMP-SAME: "-emit-llvm"
-// SAVETEMP-SAME: {{.*}} "-main-file-name" "b.hip" {{.*}} "-target-cpu" "gfx900"
-// SAVETEMP-SAME: {{.*}} "-o" {{"b.*\.s"}} "-x" "ir" [[B_GFX900_TMP_BC]]
-
-// SAVETEMP: "{{.*}}clang-offload-bundler" "-type=s"
-// SAVETEMP-SAME: "-targets=hip-amdgcn-amd-amdhsa-unknown-gfx803,hip-amdgcn-amd-amdhsa-unknown-gfx900"
-// SAVETEMP-SAME: "-output=b-hip-amdgcn-amd-amdhsa.s"
-
-// FAIL: error: cannot specify -o when generating multiple output files
diff --git a/clang/test/Driver/hip-save-temps.hip b/clang/test/Driver/hip-save-temps.hip
index 6ad0ef6dc4e77..db53c7510d388 100644
--- a/clang/test/Driver/hip-save-temps.hip
+++ b/clang/test/Driver/hip-save-temps.hip
@@ -1,69 +1,3 @@
-// -fno-gpu-rdc without -o with -c
-// RUN: %clang -### --target=x86_64-linux-gnu -nogpulib -save-temps \
-// RUN: --no-offload-new-driver -nogpuinc --offload-arch=gfx900 -c %s 2>&1 | \
-// RUN: FileCheck -check-prefixes=CHECK,NORDC %s
-
-// -fno-gpu-rdc without -o
-// RUN: %clang -### --target=x86_64-linux-gnu -nogpulib -save-temps \
-// RUN: --no-offload-new-driver -nogpuinc --offload-arch=gfx900 %s 2>&1 | \
-// RUN: FileCheck -check-prefixes=CHECK,NORDC,NOUT %s
-
-// -fno-gpu-rdc with -o
-// RUN: %clang -### --target=x86_64-linux-gnu -nogpulib -save-temps \
-// RUN: --no-offload-new-driver -nogpuinc -o executable --offload-arch=gfx900 %s 2>&1 | \
-// RUN: FileCheck -check-prefixes=CHECK,NORDC,WOUT %s
-
-// -fgpu-rdc without -o with -c
-// RUN: %clang -### --target=x86_64-linux-gnu -nogpulib -save-temps \
-// RUN: --no-offload-new-driver -nogpuinc -fgpu-rdc --offload-arch=gfx900 -c %s 2>&1 | \
-// RUN: FileCheck -check-prefixes=CHECK,RDC,RDCC %s
-
-// -fgpu-rdc without -o
-// RUN: %clang -### --target=x86_64-linux-gnu -nogpulib -save-temps \
-// RUN: --no-offload-new-driver -nogpuinc -fgpu-rdc --offload-arch=gfx900 %s 2>&1 | \
-// RUN: FileCheck -check-prefixes=CHECK,RDC,RDCL,NOUT %s
-
-// -fgpu-rdc with -o
-// UN: %clang -### --target=x86_64-linux-gnu -nogpulib -save-temps \
-// UN: --offload-new-driver -nogpuinc -o executable -fgpu-rdc --offload-arch=gfx900 %s 2>&1 | \
-// UN: FileCheck -check-prefixes=CHECK,RDC,RDCL,WOUT %s
-
-// -fgpu-rdc host object path
-// RDCL: "{{.*clang.*}}" "-cc1" {{.*}} "-E" {{.*}} "-o" "hip-save-temps-host-x86_64-unknown-linux-gnu.hipi"
-// RDCL: "{{.*clang.*}}" "-cc1" {{.*}} "-emit-llvm-bc" {{.*}} "-o" "hip-save-temps-host-x86_64-unknown-linux-gnu.bc"
-// RDCL: "{{.*clang.*}}" "-cc1" {{.*}} "-S" {{.*}} "-o" "hip-save-temps-host-x86_64-unknown-linux-gnu.s"
-// RDCL: "{{.*clang.*}}" "-cc1as" {{.*}} "-o" "hip-save-temps-host-x86_64-unknown-linux-gnu.o"
-
-// device object paths
-// CHECK: {{".*clang.*"}} "-cc1" {{.*}} "-E" {{.*}} [[CPU:"-target-cpu" "gfx900"]] {{.*}} "-o" "hip-save-temps-hip-amdgcn-amd-amdhsa-gfx900.hipi"
-// NORDC: {{".*clang.*"}} "-cc1" {{.*}} "-emit-llvm-bc" {{.*}} [[CPU]] {{.*}} "-disable-llvm-passes" {{.*}} "-o" "hip-save-temps-hip-amdgcn-amd-amdhsa-gfx900.bc"
-// RDC: {{".*clang.*"}} "-cc1" {{.*}} "-emit-llvm-bc" {{.*}} [[CPU]] {{.*}} "-disable-llvm-passes" {{.*}} "-o" "hip-save-temps-hip-amdgcn-amd-amdhsa-gfx900.tmp.bc"
-
-// RDC: {{".*clang.*"}} "-cc1" {{.*}} "-emit-llvm-bc" {{.*}} [[CPU]] {{.*}} "-o" "hip-save-temps-hip-amdgcn-amd-amdhsa-gfx900.{{(bc|o)}}"
-// CHECK-NOT: "{{.*}}llvm-link"
-// CHECK-NOT: "{{.*}}opt"
-// CHECK-NOT: "{{.*}}llc"
-// NORDC: {{.*lld.*}}"-o" "hip-save-temps-hip-amdgcn-amd-amdhsa-gfx900.out"
-// RDCL: "{{.*lld.*}}" {{.*}} "-plugin-opt=-amdgpu-internalize-symbols" {{.*}}"-save-temps"
-// RDCL-SAME: "-o" "a.out-hip-amdgcn-amd-amdhsa-gfx900"
-// RDCC: "{{.*clang.*}}" "-cc1" {{.*}} "-E" {{.*}} "-o" "hip-save-temps-host-x86_64-unknown-linux-gnu.hipi"
-// RDCC: "{{.*clang.*}}" "-cc1" {{.*}} "-emit-llvm-bc" {{.*}} "-o" "hip-save-temps-host-x86_64-unknown-linux-gnu.bc"
-// RDCC: "{{.*clang.*}}" "-cc1" {{.*}} "-S" {{.*}} "-o" "hip-save-temps-host-x86_64-unknown-linux-gnu.s"
-// RDCC: "{{.*clang.*}}" "-cc1as" {{.*}} "-o" "hip-save-temps-host-x86_64-unknown-linux-gnu.o"
-// RDCC: "{{.*clang-offload-bundler.*}}" {{.*}} "-output=hip-save-temps.o"
-// RDCL: "{{.*clang-offload-bundler.*}}" {{.*}} "-output=hip-save-temps-hip-amdgcn-amd-amdhsa.hipfb"
-// RDCL: "{{.*clang.*}}" "-target" "x86_64-unknown-linux-gnu" "-o" "{{.*}}.o" "-x" "assembler" "{{.*}}.mcin" "-c"
-
-// -fno-gpu-rdc host object path
-// NORDC: "{{.*clang.*}}" "-cc1" {{.*}} "-E" {{.*}} "-o" "hip-save-temps-host-x86_64-unknown-linux-gnu.hipi"
-// NORDC: "{{.*clang.*}}" "-cc1" {{.*}} "-emit-llvm-bc" {{.*}} "-fcuda-include-gpubinary" {{.*}} "-o" "hip-save-temps-host-x86_64-unknown-linux-gnu.bc"
-// NORDC: "{{.*clang.*}}" "-cc1" {{.*}} "-S" {{.*}} "-o" "hip-save-temps-host-x86_64-unknown-linux-gnu.s"
-// NORDC: "{{.*clang.*}}" "-cc1as" {{.*}} "-o" "hip-save-temps{{.*}}.o"
-
-// output to default a.out or -o specified file name
-// NOUT: {{.*}}ld{{.*}}"-o" "a.out"
-// WOUT: {{.*}}ld{{.*}}"-o" "executable"
-
// Check to ensure we have a .tmp for unoptimized bitcode with -fno-gpu-rdc.
// RUN: %clang -### -ccc-print-bindings --target=x86_64-linux-gnu -nogpulib \
// RUN: -save-temps -fno-gpu-rdc -nogpuinc --offload-arch=gfx906 -c %s 2>&1 | \
diff --git a/clang/test/Driver/hip-spirv-backend-bindings.c b/clang/test/Driver/hip-spirv-backend-bindings.c
index fc85f663689c3..3e4251a178c5b 100644
--- a/clang/test/Driver/hip-spirv-backend-bindings.c
+++ b/clang/test/Driver/hip-spirv-backend-bindings.c
@@ -1,9 +1,9 @@
-// RUN: %clang --offload-new-driver --target=x86_64-unknown-linux-gnu --offload-arch=amdgcnspirv \
+// RUN: %clang --target=x86_64-unknown-linux-gnu --offload-arch=amdgcnspirv \
// RUN: -nogpuinc -nogpulib -x hip %s -save-temps \
// RUN: -use-spirv-backend -ccc-print-bindings \
// RUN: 2>&1 | FileCheck %s --check-prefixes=CHECK-SPIRV-BASE,CHECK-SPIRV
-// RUN: %clang --offload-new-driver --target=x86_64-unknown-linux-gnu --offload-arch=amdgcnspirv \
+// RUN: %clang --target=x86_64-unknown-linux-gnu --offload-arch=amdgcnspirv \
// RUN: -nogpuinc -nogpulib -x hip %s -save-temps \
// RUN: -use-spirv-backend -fgpu-rdc -ccc-print-bindings \
// RUN: 2>&1 | FileCheck %s --check-prefixes=CHECK-SPIRV-BASE,CHECK-SPIRV-RDC
@@ -24,7 +24,7 @@
// CHECK-SPIRV # "x86_64-unknown-linux-gnu" - "Offload::Linker", inputs: ["[[x86_O]]"], output: "[[x86_O:.+\.o]]"
// CHECK-SPIRV # "x86_64-unknown-linux-gnu" - "GNU::Linker", inputs: ["[[x86_O]]"], output: "{{.+\.out}}"
-// RUN: %clang --offload-new-driver --target=x86_64-unknown-linux-gnu --offload-arch=amdgcnspirv \
+// RUN: %clang --target=x86_64-unknown-linux-gnu --offload-arch=amdgcnspirv \
// RUN: -nogpuinc -nogpulib -x hip %s -save-temps \
// RUN: -use-spirv-backend --offload-device-only -ccc-print-bindings \
// RUN: 2>&1 | FileCheck %s --check-prefix=CHECK-SPIRV-OFFLOAD-DEVICE-ONLY
@@ -33,7 +33,7 @@
// CHECK-SPIRV-OFFLOAD-DEVICE-ONLY: # "spirv64-amd-amdhsa" - "clang", inputs: ["[[HIPI]]"], output: "[[SPV_TMP_BC:.+\.bc]]"
// CHECK-SPIRV-OFFLOAD-DEVICE-ONLY: # "spirv64-amd-amdhsa" - "clang", inputs: ["[[SPV_TMP_BC]]"], output: "{{.+\.o}}"
-// RUN: %clang --offload-new-driver --target=x86_64-unknown-linux-gnu --offload-arch=amdgcnspirv \
+// RUN: %clang --target=x86_64-unknown-linux-gnu --offload-arch=amdgcnspirv \
// RUN: -nogpuinc -nogpulib -x hip %s -save-temps \
// RUN: -use-spirv-backend --offload-device-only -fgpu-rdc -ccc-print-bindings \
// RUN: 2>&1 | FileCheck %s --check-prefix=CHECK-SPIRV-OFFLOAD-DEVICE-ONLY-RDC
@@ -42,12 +42,12 @@
// CHECK-SPIRV-OFFLOAD-DEVICE-ONLY-RDC: # "spirv64-amd-amdhsa" - "clang", inputs: ["[[HIPI]]"], output: "[[SPV_TMP_BC:.+\.bc]]"
// CHECK-SPIRV-OFFLOAD-DEVICE-ONLY-RDC: # "spirv64-amd-amdhsa" - "clang", inputs: ["[[SPV_TMP_BC]]"], output: "{{.+\.(o|s)}}"
-// RUN: %clang --offload-new-driver --target=x86_64-unknown-linux-gnu --offload-arch=amdgcnspirv \
+// RUN: %clang --target=x86_64-unknown-linux-gnu --offload-arch=amdgcnspirv \
// RUN: -nogpuinc -nogpulib -x hip %s -save-temps \
// RUN: -use-spirv-backend --offload-device-only -S -fgpu-rdc -ccc-print-bindings \
// RUN: 2>&1 | FileCheck %s --check-prefix=CHECK-SPIRV-OFFLOAD-DEVICE-ONLY-RDC
-// RUN: %clang --offload-new-driver --target=x86_64-unknown-linux-gnu --offload-arch=amdgcnspirv \
+// RUN: %clang --target=x86_64-unknown-linux-gnu --offload-arch=amdgcnspirv \
// RUN: -nogpuinc -nogpulib -x hip %s -save-temps \
// RUN: -use-spirv-backend --offload-device-only -S -ccc-print-bindings \
// RUN: 2>&1 | FileCheck %s --check-prefix=CHECK-SPIRV-TEXTUAL-OFFLOAD-DEVICE-ONLY
diff --git a/clang/test/Driver/hip-spirv-backend-opt.c b/clang/test/Driver/hip-spirv-backend-opt.c
index 91fddfb05e8e9..ed5d47be36e9c 100644
--- a/clang/test/Driver/hip-spirv-backend-opt.c
+++ b/clang/test/Driver/hip-spirv-backend-opt.c
@@ -2,46 +2,46 @@
// --offload-device-only is always set --- testing interactions with -S and -fgpu-rdc
-// RUN: %clang --offload-new-driver --target=x86_64-unknown-linux-gnu --offload-arch=amdgcnspirv \
+// RUN: %clang --target=x86_64-unknown-linux-gnu --offload-arch=amdgcnspirv \
// RUN: -nogpuinc -nogpulib -### -x hip %s -save-temps \
// RUN: -use-spirv-backend --offload-device-only -S -no-canonical-prefixes \
// RUN: 2>&1 | FileCheck %s --check-prefixes=CHECK-SPIRV-TRANSLATOR,CHECK-SPIRV-BACKEND-TEXTUAL
-// RUN: %clang --offload-new-driver --target=x86_64-unknown-linux-gnu --offload-arch=amdgcnspirv \
+// RUN: %clang --target=x86_64-unknown-linux-gnu --offload-arch=amdgcnspirv \
// RUN: -nogpuinc -nogpulib -### -x hip %s -save-temps \
// RUN: -use-spirv-backend --offload-device-only -no-canonical-prefixes \
// RUN: 2>&1 | FileCheck %s --check-prefixes=CHECK-SPIRV-TRANSLATOR,CHECK-SPIRV-BACKEND-BINARY
// The new driver's behavior is to emit LLVM IR for --offload-device-only and -fgpu-rdc (independently of SPIR-V).
-// RUN: %clang --offload-new-driver --target=x86_64-unknown-linux-gnu --offload-arch=amdgcnspirv \
+// RUN: %clang --target=x86_64-unknown-linux-gnu --offload-arch=amdgcnspirv \
// RUN: -### -nogpuinc -nogpulib -x hip %s -save-temps \
// RUN: -use-spirv-backend --offload-device-only -S -fgpu-rdc -no-canonical-prefixes \
// RUN: 2>&1 | FileCheck %s --check-prefixes=CHECK-SPIRV-TRANSLATOR,CHECK-SPIRV-BACKEND-LL,CHECK-FGPU-RDC
// The new driver's behavior is to emit LLVM IR for --offload-device-only and -fgpu-rdc (independently of SPIR-V).
-// RUN: %clang --offload-new-driver --target=x86_64-unknown-linux-gnu --offload-arch=amdgcnspirv \
+// RUN: %clang --target=x86_64-unknown-linux-gnu --offload-arch=amdgcnspirv \
// RUN: -nogpuinc -nogpulib -### -x hip %s -save-temps \
// RUN: -use-spirv-backend --offload-device-only -fgpu-rdc -no-canonical-prefixes \
// RUN: 2>&1 | FileCheck %s --check-prefixes=CHECK-SPIRV-TRANSLATOR,CHECK-SPIRV-BACKEND-BC,CHECK-FGPU-RDC
// --offload-device-only is always unset --- testing interactions with -S and -fgpu-rdc
-// RUN: %clang --offload-new-driver --target=x86_64-unknown-linux-gnu --offload-arch=amdgcnspirv \
+// RUN: %clang --target=x86_64-unknown-linux-gnu --offload-arch=amdgcnspirv \
// RUN: -nogpuinc -nogpulib -### -x hip %s -save-temps \
// RUN: -use-spirv-backend -S -fgpu-rdc -no-canonical-prefixes \
// RUN: 2>&1 | FileCheck %s --check-prefixes=CHECK-SPIRV-TRANSLATOR,CHECK-SPIRV-BACKEND-BC,CHECK-FGPU-RDC
-// RUN: %clang --offload-new-driver --target=x86_64-unknown-linux-gnu --offload-arch=amdgcnspirv \
+// RUN: %clang --target=x86_64-unknown-linux-gnu --offload-arch=amdgcnspirv \
// RUN: -nogpuinc -nogpulib -### -x hip %s -save-temps \
// RUN: -use-spirv-backend -S -no-canonical-prefixes \
// RUN: 2>&1 | FileCheck %s --check-prefixes=CHECK-SPIRV-TRANSLATOR,CHECK-SPIRV-BACKEND-BC
-// RUN: %clang --offload-new-driver --target=x86_64-unknown-linux-gnu --offload-arch=amdgcnspirv \
+// RUN: %clang --target=x86_64-unknown-linux-gnu --offload-arch=amdgcnspirv \
// RUN: -nogpuinc -nogpulib -### -x hip %s -save-temps \
// RUN: -use-spirv-backend -fgpu-rdc -no-canonical-prefixes \
// RUN: 2>&1 | FileCheck %s --check-prefixes=CHECK-SPIRV-TRANSLATOR,CHECK-SPIRV-BACKEND-BC,CHECK-CLANG-LINKER-WRAPPER
-// RUN: %clang --offload-new-driver --target=x86_64-unknown-linux-gnu --offload-arch=amdgcnspirv \
+// RUN: %clang --target=x86_64-unknown-linux-gnu --offload-arch=amdgcnspirv \
// RUN: -nogpuinc -nogpulib -### -x hip %s -save-temps \
// RUN: -use-spirv-backend -no-canonical-prefixes \
// RUN: 2>&1 | FileCheck %s --check-prefixes=CHECK-SPIRV-TRANSLATOR,CHECK-SPIRV-BACKEND-BC,CHECK-CLANG-LINKER-WRAPPER
diff --git a/clang/test/Driver/hip-spirv-backend-phases.c b/clang/test/Driver/hip-spirv-backend-phases.c
index 06e93c796fe8f..ba40f4759b56c 100644
--- a/clang/test/Driver/hip-spirv-backend-phases.c
+++ b/clang/test/Driver/hip-spirv-backend-phases.c
@@ -1,4 +1,4 @@
-// RUN: %clang --offload-new-driver --target=x86_64-unknown-linux-gnu --offload-arch=amdgcnspirv \
+// RUN: %clang --target=x86_64-unknown-linux-gnu --offload-arch=amdgcnspirv \
// RUN: -nogpuinc -nogpulib -x hip %s -save-temps \
// RUN: -use-spirv-backend -ccc-print-phases \
// RUN: 2>&1 | FileCheck %s --check-prefix=CHECK-SPIRV-BINARY
@@ -20,7 +20,7 @@
// CHECK-SPIRV-BINARY: [[P12:[0-9]+]]: assembler, {[[P11]]}, object, (host-hip)
// CHECK-SPIRV-BINARY: [[P13:[0-9]+]]: clang-linker-wrapper, {[[P12]]}, image, (host-hip)
-// RUN: %clang --offload-new-driver --target=x86_64-unknown-linux-gnu --offload-arch=amdgcnspirv \
+// RUN: %clang --target=x86_64-unknown-linux-gnu --offload-arch=amdgcnspirv \
// RUN: -nogpuinc -nogpulib -x hip %s -save-temps \
// RUN: -use-spirv-backend -fgpu-rdc -ccc-print-phases \
// RUN: 2>&1 | FileCheck %s --check-prefix=CHECK-SPIRV-BINARY-RDC
@@ -41,7 +41,7 @@
// CHECK-SPIRV-BINARY-RDC: [[P11:[0-9]+]]: assembler, {[[P10]]}, object, (host-hip)
// CHECK-SPIRV-BINARY-RDC: [[P12:[0-9]+]]: clang-linker-wrapper, {[[P11]]}, image, (host-hip)
-// RUN: %clang --offload-new-driver --target=x86_64-unknown-linux-gnu --offload-arch=amdgcnspirv \
+// RUN: %clang --target=x86_64-unknown-linux-gnu --offload-arch=amdgcnspirv \
// RUN: -nogpuinc -nogpulib -x hip %s -save-temps \
// RUN: -use-spirv-backend --offload-device-only -ccc-print-phases \
// RUN: 2>&1 | FileCheck %s --check-prefix=CHECK-SPIRV-BINARY-OFFLOAD-DEVICE-ONLY
@@ -55,7 +55,7 @@
// CHECK-SPIRV-BINARY-OFFLOAD-DEVICE-ONLY: [[P6:[0-9]+]]: linker, {[[P5]]}, hip-fatbin, (device-hip)
// CHECK-SPIRV-BINARY-OFFLOAD-DEVICE-ONLY: [[P7:[0-9]+]]: offload, "device-hip (spirv64-amd-amdhsa)" {[[P6]]}, none
-// RUN: %clang --offload-new-driver --target=x86_64-unknown-linux-gnu --offload-arch=amdgcnspirv \
+// RUN: %clang --target=x86_64-unknown-linux-gnu --offload-arch=amdgcnspirv \
// RUN: -nogpuinc -nogpulib -x hip %s -save-temps \
// RUN: -use-spirv-backend --offload-device-only -fgpu-rdc -ccc-print-phases \
// RUN: 2>&1 | FileCheck %s --check-prefix=CHECK-SPIRV-OFFLOAD-DEVICE-ONLY-RDC
@@ -66,12 +66,12 @@
// CHECK-SPIRV-OFFLOAD-DEVICE-ONLY-RDC: [[P3:[0-9]+]]: backend, {[[P2]]}, lto-{{(bc|ir)}}, (device-hip, amdgcnspirv)
// CHECK-SPIRV-OFFLOAD-DEVICE-ONLY-RDC: [[P4:[0-9]+]]: offload, "device-hip (spirv64-amd-amdhsa:amdgcnspirv)" {[[P3]]}, none
-// RUN: %clang --offload-new-driver --target=x86_64-unknown-linux-gnu --offload-arch=amdgcnspirv \
+// RUN: %clang --target=x86_64-unknown-linux-gnu --offload-arch=amdgcnspirv \
// RUN: -nogpuinc -nogpulib -x hip %s -save-temps \
// RUN: -use-spirv-backend --offload-device-only -S -fgpu-rdc -ccc-print-phases \
// RUN: 2>&1 | FileCheck %s --check-prefix=CHECK-SPIRV-OFFLOAD-DEVICE-ONLY-RDC
-// RUN: %clang --offload-new-driver --target=x86_64-unknown-linux-gnu --offload-arch=amdgcnspirv \
+// RUN: %clang --target=x86_64-unknown-linux-gnu --offload-arch=amdgcnspirv \
// RUN: -nogpuinc -nogpulib -x hip %s -save-temps \
// RUN: -use-spirv-backend --offload-device-only -S -ccc-print-phases \
// RUN: 2>&1 | FileCheck %s --check-prefix=CHECK-SPIRV-TEXTUAL-OFFLOAD-DEVICE-ONLY
diff --git a/clang/test/Driver/hip-spirv-translator-new-driver.c b/clang/test/Driver/hip-spirv-translator-new-driver.c
index 64ae58e5c34cf..828ec45b98d96 100644
--- a/clang/test/Driver/hip-spirv-translator-new-driver.c
+++ b/clang/test/Driver/hip-spirv-translator-new-driver.c
@@ -1,7 +1,7 @@
-// The --offload-new-driver was crashing when using -save-temps due to a failure in clang-linker-wrapper.
+// The offloading driver was crashing when using -save-temps due to a failure in clang-linker-wrapper.
// The input and output files cannot be the same.
-// RUN: %clang --offload-new-driver -### -save-temps -nogpuinc -nogpulib \
+// RUN: %clang -### -save-temps -nogpuinc -nogpulib \
// RUN: --target=x86_64-unknown-linux-gnu --offload-arch=amdgcnspirv -x hip %s 2>&1 \
// RUN: | FileCheck %s
diff --git a/clang/test/Driver/hip-target-id.hip b/clang/test/Driver/hip-target-id.hip
deleted file mode 100644
index b9ff07cbe68d0..0000000000000
--- a/clang/test/Driver/hip-target-id.hip
+++ /dev/null
@@ -1,66 +0,0 @@
-// RUN: %clang -### --target=x86_64-linux-gnu \
-// RUN: -x hip \
-// RUN: --offload-arch=gfx908:xnack+:sramecc+ \
-// RUN: --offload-arch=gfx908:xnack+:sramecc- \
-// RUN: --no-offload-new-driver --rocm-path=%S/Inputs/rocm \
-// RUN: %s 2>&1 | FileCheck %s
-
-// RUN: %clang -### --target=x86_64-linux-gnu \
-// RUN: -x hip \
-// RUN: --offload-arch=gfx908:xnack+:sramecc+ \
-// RUN: --offload-arch=gfx908:xnack+:sramecc- \
-// RUN: --rocm-path=%S/Inputs/rocm \
-// RUN: --no-offload-new-driver -save-temps \
-// RUN: %s 2>&1 | FileCheck --check-prefixes=CHECK %s
-
-// RUN: %clang -### --target=x86_64-linux-gnu \
-// RUN: -x hip \
-// RUN: --offload-arch=gfx908:xnack+:sramecc+ \
-// RUN: --offload-arch=gfx908:xnack+:sramecc- \
-// RUN: --rocm-path=%S/Inputs/rocm \
-// RUN: --no-offload-new-driver -fgpu-rdc \
-// RUN: %s 2>&1 | FileCheck --check-prefixes=CHECK %s
-
-// CHECK: [[CLANG:"[^"]*clang[^"]*"]] "-cc1" "-triple" "amdgcn-amd-amdhsa"
-// CHECK-SAME: "-target-cpu" "gfx908"
-// CHECK-SAME: "-mxnack"
-// CHECK-SAME: "-msramecc"
-
-// TMP: [[CLANG:"[^"]*clang[^"]*"]] "-cc1as" "-triple" "amdgcn-amd-amdhsa"
-// TMP-SAME: "-target-cpu" "gfx908"
-// TMP-SAME: "-mxnack"
-// TMP-SAME: "-msramecc"
-
-// CHECK: [[LLD:"[^"]*lld[^"]*"]] {{.*}} "-plugin-opt=mcpu=gfx908"
-
-// CHECK: [[CLANG]] "-cc1" "-triple" "amdgcn-amd-amdhsa"
-// CHECK-SAME: "-target-cpu" "gfx908"
-// CHECK-SAME: "-mxnack"
-// CHECK-SAME: "-mno-sramecc"
-
-// CHECK: [[LLD]] {{.*}} "-plugin-opt=mcpu=gfx908"
-
-// CHECK: {{"[^"]*clang-offload-bundler[^"]*"}}
-// CHECK-SAME: "-targets=host-x86_64-unknown-linux-gnu,hipv4-amdgcn-amd-amdhsa--gfx908:sramecc+:xnack+,hipv4-amdgcn-amd-amdhsa--gfx908:sramecc-:xnack+"
-
-// Check canonicalization and repeating of target ID.
-
-// RUN: %clang -### --target=x86_64-linux-gnu \
-// RUN: -x hip \
-// RUN: --offload-arch=fiji \
-// RUN: --offload-arch=gfx803 \
-// RUN: --offload-arch=fiji \
-// RUN: --no-offload-new-driver --rocm-path=%S/Inputs/rocm \
-// RUN: %s 2>&1 | FileCheck -check-prefix=FIJI %s
-// FIJI: "-targets=host-x86_64-unknown-linux-gnu,hipv4-amdgcn-amd-amdhsa--gfx803"
-
-// RUN: not %clang -### --target=x86_64-linux-gnu \
-// RUN: -x hip \
-// RUN: --offload-arch=gfx900:xnack- \
-// RUN: --offload-arch=gfx900:xnack+ \
-// RUN: --offload-arch=gfx908:sramecc+ \
-// RUN: --offload-arch=gfx908:sramecc- \
-// RUN: --offload-arch=gfx906 \
-// RUN: --no-offload-new-driver --rocm-path=%S/Inputs/rocm \
-// RUN: %s 2>&1 | FileCheck -check-prefix=MULTI %s
-// MULTI: "-targets=host-x86_64-unknown-linux-gnu,hipv4-amdgcn-amd-amdhsa--gfx900:xnack+,hipv4-amdgcn-amd-amdhsa--gfx900:xnack-,hipv4-amdgcn-amd-amdhsa--gfx908:sramecc+,hipv4-amdgcn-amd-amdhsa--gfx908:sramecc-,hipv4-amdgcn-amd-amdhsa--gfx906"
diff --git a/clang/test/Driver/hip-temps-linux.hip b/clang/test/Driver/hip-temps-linux.hip
deleted file mode 100644
index 5117f5b8e1f65..0000000000000
--- a/clang/test/Driver/hip-temps-linux.hip
+++ /dev/null
@@ -1,18 +0,0 @@
-// REQUIRES: x86-registered-target
-// REQUIRES: amdgpu-registered-target
-// REQUIRES: system-linux
-
-// Check no temporary files or directores are left after compilation.
-// RUN: rm -rf %t/mytmp
-// RUN: mkdir -p %t/mytmp
-// RUN: env TMP="%t/mytmp" TMPDIR="%t/mytmp" %clang --target=x86_64-linux-gnu -nogpulib -nogpuinc \
-// RUN: --rocm-path=%S/Inputs/rocm -nostdinc -nostdlib -c \
-// RUN: --no-offload-new-driver --offload-arch=gfx1030 -emit-llvm -v %s 2>&1 | \
-// RUN: FileCheck -check-prefixes=CHECK -DOUTPUT_PATH="%t%{fs-sep}mytmp%{fs-sep}" %s
-// RUN: ls %t/mytmp >%t/mytmp.txt 2>&1
-// RUN: touch %t/empty.txt
-// RUN: diff %t/mytmp.txt %t/empty.txt
-
-// CHECK: -o {{"?}}[[OUTPUT_PATH]]hip-temps-linux-gfx1030-{{.*}}.bc{{"?}}
-
-int main() {}
diff --git a/clang/test/Driver/hip-temps-windows.hip b/clang/test/Driver/hip-temps-windows.hip
deleted file mode 100644
index 5df4c05b24c56..0000000000000
--- a/clang/test/Driver/hip-temps-windows.hip
+++ /dev/null
@@ -1,18 +0,0 @@
-// REQUIRES: x86-registered-target
-// REQUIRES: amdgpu-registered-target
-// REQUIRES: system-windows
-
-// Check no temporary files or directores are left after compilation.
-// RUN: rm -rf %t/mytmp
-// RUN: mkdir -p %t/mytmp
-// RUN: env TMP="%t/mytmp" %clang --target=x86_64-pc-windows-msvc -nogpulib -nogpuinc \
-// RUN: --rocm-path=%S/Inputs/rocm -nostdinc -nostdlib -c \
-// RUN: --no-offload-new-driver --offload-arch=gfx1030 -emit-llvm -v %s 2>&1 | \
-// RUN: FileCheck -check-prefixes=CHECK %s
-// RUN: ls %t/mytmp >%t/mytmp.txt 2>&1
-// RUN: touch %t/empty.txt
-// RUN: diff %t/mytmp.txt %t/empty.txt
-
-// CHECK: -o "{{.*}}mytmp{{/|\\\\}}hip-temps-windows-gfx1030-{{.*}}.bc"
-
-int main() {}
diff --git a/clang/test/Driver/hip-toolchain-features.hip b/clang/test/Driver/hip-toolchain-features.hip
deleted file mode 100644
index d15367723d19a..0000000000000
--- a/clang/test/Driver/hip-toolchain-features.hip
+++ /dev/null
@@ -1,73 +0,0 @@
-// RUN: %clang -### --target=x86_64-linux-gnu -fgpu-rdc -nogpulib --no-offload-new-driver \
-// RUN: -nogpuinc --offload-arch=gfx906:xnack+ --offload-arch=gfx900:xnack+ %s \
-// RUN: 2>&1 | FileCheck %s -check-prefix=XNACK
-// RUN: %clang -### --target=x86_64-linux-gnu -fgpu-rdc -nogpulib --no-offload-new-driver \
-// RUN: -nogpuinc --offload-arch=gfx906:xnack- --offload-arch=gfx900:xnack- %s \
-// RUN: 2>&1 | FileCheck %s -check-prefix=NOXNACK
-
-// XNACK: {{.*}}clang{{.*}}"-mxnack"
-// NOXNACK: {{.*}}clang{{.*}}"-mno-xnack"
-
-// RUN: %clang -### --target=x86_64-linux-gnu -fgpu-rdc -nogpulib \
-// RUN: -nogpuinc --offload-arch=gfx908:sramecc+ --no-offload-new-driver %s \
-// RUN: 2>&1 | FileCheck %s -check-prefix=SRAM
-// RUN: %clang -### --target=x86_64-linux-gnu -fgpu-rdc -nogpulib \
-// RUN: -nogpuinc --offload-arch=gfx908:sramecc- --no-offload-new-driver %s \
-// RUN: 2>&1 | FileCheck %s -check-prefix=NOSRAM
-
-// SRAM: {{.*}}clang{{.*}}"-msramecc"
-// NOSRAM: {{.*}}clang{{.*}}"-mno-sramecc"
-
-// RUN: %clang -### --target=x86_64-linux-gnu -fgpu-rdc -nogpulib \
-// RUN: -nogpuinc --offload-arch=gfx1010 --no-offload-new-driver %s \
-// RUN: -mcumode 2>&1 | FileCheck %s -check-prefix=CUMODE
-// RUN: %clang -### --target=x86_64-linux-gnu -fgpu-rdc -nogpulib \
-// RUN: -nogpuinc --offload-arch=gfx1010 --no-offload-new-driver %s \
-// RUN: -mno-cumode 2>&1 | FileCheck %s -check-prefix=NOTCUMODE
-
-// CUMODE: {{.*}}clang{{.*}}"-target-feature" "+cumode"
-// NOTCUMODE: {{.*}}clang{{.*}}"-target-feature" "-cumode"
-// CUMODE: {{.*}}lld{{.*}} "-plugin-opt=-mattr=+cumode"
-// NOTCUMODE: {{.*}}lld{{.*}} "-plugin-opt=-mattr=-cumode"
-
-// RUN: %clang -### --target=x86_64-linux-gnu -fgpu-rdc -nogpulib \
-// RUN: -nogpuinc --offload-arch=gfx908:xnack+:sramecc+ --no-offload-new-driver %s \
-// RUN: 2>&1 | FileCheck %s -check-prefix=ALL3
-// RUN: %clang -### --target=x86_64-linux-gnu -fgpu-rdc -nogpulib \
-// RUN: -nogpuinc --offload-arch=gfx908:xnack-:sramecc- --no-offload-new-driver %s \
-// RUN: 2>&1 | FileCheck %s -check-prefix=NOALL3
-
-// ALL3: {{.*}}clang{{.*}}"-mxnack" {{.*}}"-msramecc"
-// NOALL3: {{.*}}clang{{.*}}"-mno-xnack" {{.*}}"-mno-sramecc"
-
-// RUN: %clang -### --target=x86_64-linux-gnu -fgpu-rdc -nogpulib \
-// RUN: -nogpuinc --offload-arch=gfx1010 --no-offload-new-driver %s \
-// RUN: -mtgsplit 2>&1 | FileCheck %s -check-prefix=TGSPLIT
-// RUN: %clang -### --target=x86_64-linux-gnu -fgpu-rdc -nogpulib \
-// RUN: -nogpuinc --offload-arch=gfx1010 --no-offload-new-driver %s \
-// RUN: -mno-tgsplit 2>&1 | FileCheck %s -check-prefix=NOTTGSPLIT
-
-// TGSPLIT: {{.*}}clang{{.*}}"-target-feature" "+tgsplit"
-// NOTTGSPLIT: {{.*}}clang{{.*}}"-target-feature" "-tgsplit"
-// TGSPLIT: {{.*}}lld{{.*}} "-plugin-opt=-mattr=+tgsplit"
-// NOTTGSPLIT: {{.*}}lld{{.*}} "-plugin-opt=-mattr=-tgsplit"
-
-// RUN: %clang -### --target=x86_64-linux-gnu -fgpu-rdc -nogpulib \
-// RUN: -nogpuinc --offload-arch=gfx1010 --no-offload-new-driver %s \
-// RUN: -mcumode -mcumode -mno-cumode -mwavefrontsize64 -mcumode \
-// RUN: -mwavefrontsize64 -mno-wavefrontsize64 2>&1 \
-// RUN: | FileCheck %s -check-prefix=DUP
-// DUP: {{.*}}clang{{.*}} "-target-feature" "+cumode"
-// DUP-NOT: "-target-feature" "{{.*}}wavefrontsize16"
-// DUP-NOT: "-target-feature" "{{.*}}wavefrontsize32"
-// DUP-NOT: "-target-feature" "{{.*}}wavefrontsize64"
-// DUP: {{.*}}lld{{.*}} "-plugin-opt=-mattr=+cumode"
-
-// RUN: %clang -### --target=x86_64-linux-gnu -fgpu-rdc -nogpulib \
-// RUN: -nogpuinc --offload-arch=gfx1010 --no-offload-new-driver %s \
-// RUN: -mno-wavefrontsize64 -mwavefrontsize64 2>&1 \
-// RUN: | FileCheck %s -check-prefix=WAVE64
-// WAVE64: {{.*}}clang{{.*}} "-target-feature" "+wavefrontsize64"
-// WAVE64-NOT: "-target-feature" "{{.*}}wavefrontsize16"
-// WAVE64-NOT: "-target-feature" "{{.*}}wavefrontsize32"
-// WAVE64: {{.*}}lld{{.*}} "-plugin-opt=-mattr=+wavefrontsize64"
diff --git a/clang/test/Driver/hip-toolchain-no-rdc.hip b/clang/test/Driver/hip-toolchain-no-rdc.hip
index dde2dc867f011..5e19d6df00562 100644
--- a/clang/test/Driver/hip-toolchain-no-rdc.hip
+++ b/clang/test/Driver/hip-toolchain-no-rdc.hip
@@ -4,27 +4,7 @@
// RUN: --hip-device-lib=lib1.bc --hip-device-lib=lib2.bc \
// RUN: --hip-device-lib-path=%S/Inputs/hip_multiple_inputs/lib1 \
// RUN: --hip-device-lib-path=%S/Inputs/hip_multiple_inputs/lib2 \
-// RUN: -fuse-ld=lld -B%S/Inputs/lld -nogpuinc --no-offload-new-driver \
-// RUN: %S/Inputs/hip_multiple_inputs/a.cu \
-// RUN: %S/Inputs/hip_multiple_inputs/b.hip \
-// RUN: 2>&1 | FileCheck -check-prefixes=CHECK,LINK,OLD %s
-
-// RUN: %clang -### --target=x86_64-linux-gnu -fno-gpu-rdc \
-// RUN: -x hip --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 \
-// RUN: --hip-device-lib=lib1.bc --hip-device-lib=lib2.bc \
-// RUN: --hip-device-lib-path=%S/Inputs/hip_multiple_inputs/lib1 \
-// RUN: --hip-device-lib-path=%S/Inputs/hip_multiple_inputs/lib2 \
-// RUN: -fuse-ld=lld -B%S/Inputs/lld -nogpuinc -c --no-offload-new-driver \
-// RUN: %S/Inputs/hip_multiple_inputs/a.cu \
-// RUN: %S/Inputs/hip_multiple_inputs/b.hip \
-// RUN: 2>&1 | FileCheck -check-prefixes=CHECK,OLD %s
-
-// RUN: %clang -### --target=x86_64-linux-gnu -fno-gpu-rdc \
-// RUN: -x hip --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 \
-// RUN: --hip-device-lib=lib1.bc --hip-device-lib=lib2.bc \
-// RUN: --hip-device-lib-path=%S/Inputs/hip_multiple_inputs/lib1 \
-// RUN: --hip-device-lib-path=%S/Inputs/hip_multiple_inputs/lib2 \
-// RUN: -fuse-ld=lld -B%S/Inputs/lld -nogpuinc --offload-new-driver -c \
+// RUN: -fuse-ld=lld -B%S/Inputs/lld -nogpuinc -c \
// RUN: %S/Inputs/hip_multiple_inputs/a.cu \
// RUN: %S/Inputs/hip_multiple_inputs/b.hip \
// RUN: 2>&1 | FileCheck -check-prefixes=CHECK,NEW %s
@@ -36,12 +16,7 @@
// RUN: %t/a.o %t/b.o \
// RUN: 2>&1 | FileCheck -check-prefixes=LKONLY %s
-// RUN: %clang -### --target=x86_64-linux-gnu --no-offload-new-driver \
-// RUN: --offload-arch=amdgcnspirv --offload-arch=gfx900 -no-use-spirv-backend \
-// RUN: %s -nogpuinc -nogpulib \
-// RUN: 2>&1 | FileCheck -check-prefixes=AMDGCNSPIRV %s
-
-// RUN: %clang -### --target=x86_64-linux-gnu --offload-new-driver \
+// RUN: %clang -### --target=x86_64-linux-gnu \
// RUN: --offload-arch=amdgcnspirv --offload-arch=gfx900 -no-use-spirv-backend \
// RUN: %s -nogpuinc -nogpulib \
// RUN: 2>&1 | FileCheck -check-prefixes=AMDGCNSPIRV-NEW %s
@@ -52,7 +27,6 @@
// CHECK: [[CLANG:".*clang.*"]] "-cc1" "-triple" "amdgcn-amd-amdhsa"
// CHECK-SAME: "-aux-triple" "x86_64-unknown-linux-gnu"
-// OLD-SAME: "-emit-obj"
// NEW-SAME: "-emit-llvm-bc"
// CHECK-SAME: {{.*}} "-main-file-name" "a.cu"
// CHECK-SAME: "-fcuda-is-device" "-fno-threadsafe-statics" "-mllvm" "-amdgpu-internalize-symbols"
@@ -67,9 +41,6 @@
// CHECK-NOT: {{".*opt"}}
// CHECK-NOT: {{".*llc"}}
-// OLD: [[LLD: ".*lld.*"]] "-flavor" "gnu" "-m" "elf64_amdgpu" "--no-undefined" "-shared"
-// OLD-SAME: "-o" "[[IMG_DEV_A_803:.*out]]" "[[OBJ_DEV_A_803]]"
-
//
// Compile device code in a.cu to code object for gfx900.
//
@@ -90,18 +61,10 @@
// CHECK-NOT: {{".*opt"}}
// CHECK-NOT: {{".*llc"}}
-// OLD: [[LLD]] "-flavor" "gnu" "-m" "elf64_amdgpu" "--no-undefined" "-shared"
-// OLD-SAME: "-o" "[[IMG_DEV_A_900:.*out]]" "[[OBJ_DEV_A_900]]"
-
//
// Bundle and embed device code in host object for a.cu.
//
-// OLD: [[BUNDLER:".*clang-offload-bundler"]] "-type=o"
-// OLD-SAME: "-bundle-align=4096"
-// OLD-SAME: "-targets={{.*}},hipv4-amdgcn-amd-amdhsa--gfx803,hipv4-amdgcn-amd-amdhsa--gfx900"
-// OLD-SAME: "-input={{.*}}" "-input=[[IMG_DEV_A_803]]" "-input=[[IMG_DEV_A_900]]" "-output=[[BUNDLE_A:.*hipfb]]"
-
// NEW: [[PACKAGER:".*llvm-offload-binary"]] "-o" "[[PACKAGE_A:.*.out]]"
// NEW-SAME: "--image=file=[[OBJ_DEV_A_803]],triple=amdgcn-amd-amdhsa,arch=gfx803,kind=hip"
// NEW-SAME: "--image=file=[[OBJ_DEV_A_900]],triple=amdgcn-amd-amdhsa,arch=gfx900,kind=hip"
@@ -116,7 +79,6 @@
// CHECK-SAME: "-aux-triple" "amdgcn-amd-amdhsa"
// CHECK-SAME: "-emit-obj"
// CHECK-SAME: {{.*}} "-main-file-name" "a.cu"
-// OLD-SAME: {{.*}} "-fcuda-include-gpubinary" "[[BUNDLE_A]]"
// NEW-SAME: {{.*}} "-fcuda-include-gpubinary" "[[HIPFB_A]]"
// CHECK-SAME: {{.*}} "-o" [[A_OBJ_HOST:".*o"]] "-x" "hip"
// CHECK-SAME: {{.*}} [[A_SRC]]
@@ -141,9 +103,6 @@
// CHECK-NOT: {{".*opt"}}
// CHECK-NOT: {{".*llc"}}
-// OLD: [[LLD]] "-flavor" "gnu" "-m" "elf64_amdgpu" "--no-undefined" "-shared"
-// OLD-SAME: "-o" "[[IMG_DEV_B_803:.*out]]" "[[OBJ_DEV_B_803]]"
-
//
// Compile device code in b.hip to code object for gfx900.
//
@@ -164,18 +123,10 @@
// CHECK-NOT: {{".*opt"}}
// CHECK-NOT: {{".*llc"}}
-// OLD: [[LLD]] "-flavor" "gnu" "-m" "elf64_amdgpu" "--no-undefined" "-shared"
-// OLD-SAME: "-o" "[[IMG_DEV_B_900:.*out]]" "[[OBJ_DEV_B_900]]"
-
//
// Bundle and embed device code in host object for b.hip.
//
-// OLD: [[BUNDLER:".*clang-offload-bundler"]] "-type=o"
-// OLD-SAME: "-bundle-align=4096"
-// OLD-SAME: "-targets={{.*}},hipv4-amdgcn-amd-amdhsa--gfx803,hipv4-amdgcn-amd-amdhsa--gfx900"
-// OLD-SAME: "-input={{.*}}" "-input=[[IMG_DEV_B_803]]" "-input=[[IMG_DEV_B_900]]" "-output=[[BUNDLE_B:.*hipfb]]"
-
// NEW: [[PACKAGER:".*llvm-offload-binary"]] "-o" "[[PACKAGE_B:.*.out]]"
// NEW-SAME: "--image=file=[[OBJ_DEV_B_803]],triple=amdgcn-amd-amdhsa,arch=gfx803,kind=hip"
// NEW-SAME: "--image=file=[[OBJ_DEV_B_900]],triple=amdgcn-amd-amdhsa,arch=gfx900,kind=hip"
@@ -189,7 +140,6 @@
// CHECK-SAME: "-aux-triple" "amdgcn-amd-amdhsa"
// CHECK-SAME: "-emit-obj"
// CHECK-SAME: {{.*}} "-main-file-name" "b.hip"
-// OLD-SAME: {{.*}} "-fcuda-include-gpubinary" "[[BUNDLE_B]]"
// NEW-SAME: {{.*}} "-fcuda-include-gpubinary" "[[HIPFB_B]]"
// CHECK-SAME: {{.*}} "-o" [[B_OBJ_HOST:".*o"]] "-x" "hip"
// CHECK-SAME: {{.*}} [[B_SRC]]
@@ -198,12 +148,6 @@
// Link host objects.
//
-// LINK-NOT: {{".*/llvm-link"}}
-// LINK-NOT: {{".*/opt"}}
-// LINK-NOT: {{".*/llc"}}
-// LINK: [[LD:".*ld.*"]] {{.*}} [[A_OBJ_HOST]] [[B_OBJ_HOST]]
-// LINK-NOT: "-T" "{{.*}}.lk"
-
// LKONLY-NOT: {{".*/llvm-link"}}
// LKONLY-NOT: {{".*/opt"}}
// LKONLY-NOT: {{".*/llc"}}
@@ -214,19 +158,11 @@
// Check mixed AMDGCNSPIRV and concrete GPU arch.
//
-// AMDGCNSPIRV: "-cc1" "-triple" "amdgcn-amd-amdhsa" {{.*}}"-emit-obj" {{.*}} "-target-cpu" "gfx900"{{.*}} "-o" "[[GFX900_OBJ:.*o]]"
-// AMDGCNSPIRV: {{".*lld.*"}} {{.*}}"-plugin-opt=mcpu=gfx900" {{.*}} "-o" "[[GFX900_CO:.*out]]" {{.*}}"[[GFX900_OBJ]]"
-// AMDGCNSPIRV: "-cc1" "-triple" "spirv64-amd-amdhsa" {{.*}}"-emit-llvm-bc" {{.*}}"-flto=full"{{.*}} "-fembed-bitcode=marker" "-disable-llvm-optzns" {{.*}} "-o" "[[AMDGCNSPV_BC:.*bc]]"
-// AMDGCNSPIRV: {{".*llvm-link.*"}} "-o" "[[AMDGCNSPV_TMP:.*bc]]" "[[AMDGCNSPV_BC]]"
-// AMDGCNSPIRV: {{".*llvm-spirv.*"}} "--spirv-max-version=1.6" "--spirv-ext=+all" {{.*}} "[[AMDGCNSPV_TMP]]" {{.*}}"-o" "[[AMDGCNSPV_CO:.*out]]"
-// AMDGCNSPIRV: {{".*clang-offload-bundler.*"}} "-type=o"
-// AMDGCNSPIRV-SAME: "-targets={{.*}}hipv4-amdgcn-amd-amdhsa--gfx900,hipv4-spirv64-amd-amdhsa--amdgcnspirv"
-// AMDGCNSPIRV-SAME: "-input=[[GFX900_CO]]" "-input=[[AMDGCNSPV_CO]]"
// AMDGCNSPIRV-NEW: "-cc1" "-triple" "spirv64-amd-amdhsa" {{.*}}"-emit-llvm-bc" {{.*}} "-o" "[[AMDGCNSPV_BC:[^"]*]]"
// Check verbose printing with the new driver.
// RUN: %clang -### --target=x86_64-linux-gnu -fno-gpu-rdc -nogpulib -nogpuinc \
-// RUN: --offload-new-driver --offload-arch=gfx908 -v %s 2>&1 | FileCheck %s --check-prefix=VERBOSE
+// RUN: --offload-arch=gfx908 -v %s 2>&1 | FileCheck %s --check-prefix=VERBOSE
// VERBOSE: clang-linker-wrapper
// VERBOSE-NOT: --device-compiler=amdgcn-amd-amdhsa=-v {{.*}}-o {{.*}}.hipfb
// VERBOSE-NOT: --wrapper-verbose {{.*}}-o {{.*}}.hipfb
diff --git a/clang/test/Driver/hip-toolchain-rdc-flto-partitions.hip b/clang/test/Driver/hip-toolchain-rdc-flto-partitions.hip
deleted file mode 100644
index 455b294a6e277..0000000000000
--- a/clang/test/Driver/hip-toolchain-rdc-flto-partitions.hip
+++ /dev/null
@@ -1,35 +0,0 @@
-// RUN: %clang -### --target=x86_64-linux-gnu \
-// RUN: -x hip --cuda-gpu-arch=gfx803 -flto-partitions=42 \
-// RUN: --no-offload-new-driver --emit-static-lib -nogpulib \
-// RUN: -fuse-ld=lld -B%S/Inputs/lld -fgpu-rdc -nogpuinc \
-// RUN: %S/Inputs/hip_multiple_inputs/a.cu \
-// RUN: %S/Inputs/hip_multiple_inputs/b.hip \
-// RUN: 2>&1 | FileCheck %s --check-prefix=FIXED-PARTS
-
-// FIXED-PARTS-NOT: "*.llvm-link"
-// FIXED-PARTS-NOT: ".*opt"
-// FIXED-PARTS-NOT: ".*llc"
-// FIXED-PARTS: [[LLD: ".*lld.*"]] {{.*}} "-plugin-opt=-amdgpu-internalize-symbols"
-// FIXED-PARTS-SAME: "--lto-partitions=42"
-// FIXED-PARTS-SAME: "-plugin-opt=mcpu=gfx803"
-// FIXED-PARTS-SAME: "-o" "{{.*out}}" "{{.*o}}"
-
-// RUN: not %clang -### --target=x86_64-linux-gnu \
-// RUN: -x hip --cuda-gpu-arch=gfx803 -flto-partitions=a \
-// RUN: --no-offload-new-driver --emit-static-lib -nogpulib \
-// RUN: -fuse-ld=lld -B%S/Inputs/lld -fgpu-rdc -nogpuinc \
-// RUN: %S/Inputs/hip_multiple_inputs/a.cu \
-// RUN: %S/Inputs/hip_multiple_inputs/b.hip \
-// RUN: 2>&1 | FileCheck %s --check-prefix=LTO_PARTS_INV0
-
-// LTO_PARTS_INV0: clang: error: invalid integral value 'a' in '-flto-partitions=a'
-
-// RUN: not %clang -### --target=x86_64-linux-gnu \
-// RUN: -x hip --cuda-gpu-arch=gfx803 -flto-partitions=0 \
-// RUN: --no-offload-new-driver --emit-static-lib -nogpulib \
-// RUN: -fuse-ld=lld -B%S/Inputs/lld -fgpu-rdc -nogpuinc \
-// RUN: %S/Inputs/hip_multiple_inputs/a.cu \
-// RUN: %S/Inputs/hip_multiple_inputs/b.hip \
-// RUN: 2>&1 | FileCheck %s --check-prefix=LTO_PARTS_INV1
-
-// LTO_PARTS_INV1: clang: error: invalid integral value '0' in '-flto-partitions=0'
diff --git a/clang/test/Driver/hip-toolchain-rdc-separate.hip b/clang/test/Driver/hip-toolchain-rdc-separate.hip
deleted file mode 100644
index b515050b36305..0000000000000
--- a/clang/test/Driver/hip-toolchain-rdc-separate.hip
+++ /dev/null
@@ -1,157 +0,0 @@
-// RUN: rm -rf %t && mkdir %t
-// RUN: %clang -c -### --target=x86_64-linux-gnu \
-// RUN: -x hip --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 \
-// RUN: --hip-device-lib=lib1.bc --hip-device-lib=lib2.bc \
-// RUN: --hip-device-lib-path=%S/Inputs/hip_multiple_inputs/lib1 \
-// RUN: --hip-device-lib-path=%S/Inputs/hip_multiple_inputs/lib2 \
-// RUN: --no-offload-new-driver -fuse-ld=lld -B%S/Inputs/lld -fgpu-rdc -nogpuinc \
-// RUN: %S/Inputs/hip_multiple_inputs/a.cu \
-// RUN: %S/Inputs/hip_multiple_inputs/b.hip \
-// RUN: 2>&1 | FileCheck %s
-
-// CHECK: [[CLANG:".*clang.*"]] "-cc1" "-triple" "amdgcn-amd-amdhsa"
-// CHECK-SAME: "-aux-triple" "x86_64-unknown-linux-gnu"
-// CHECK-SAME: "-emit-llvm-bc"
-// CHECK-SAME: "-flto=full" "-flto-unit"
-// CHECK-SAME: {{.*}} "-main-file-name" "a.cu"
-// CHECK-SAME: "-fcuda-is-device" "-fno-threadsafe-statics" "-fvisibility=hidden"
-// CHECK-SAME: "-fapply-global-visibility-to-externs"
-// CHECK-SAME: "{{.*}}lib1.bc" "{{.*}}lib2.bc"
-// CHECK-SAME: "-target-cpu" "gfx803"
-// CHECK-SAME: "-fgpu-rdc"
-// CHECK-SAME: {{.*}} "-o" "[[A_BC1:.*o]]" "-x" "hip"
-// CHECK-SAME: {{.*}} [[A_SRC:".*a.cu"]]
-
-// CHECK: [[CLANG]] "-cc1" "-triple" "amdgcn-amd-amdhsa"
-// CHECK-SAME: "-aux-triple" "x86_64-unknown-linux-gnu"
-// CHECK-SAME: "-emit-llvm-bc"
-// CHECK-SAME: "-flto=full" "-flto-unit"
-// CHECK-SAME: {{.*}} "-main-file-name" "a.cu"
-// CHECK-SAME: "-fcuda-is-device"
-// CHECK-SAME: "{{.*}}lib1.bc" "{{.*}}lib2.bc"
-// CHECK-SAME: "-target-cpu" "gfx900"
-// CHECK-SAME: "-fgpu-rdc"
-// CHECK-SAME: {{.*}} "-o" "[[A_BC2:.*o]]" "-x" "hip"
-// CHECK-SAME: {{.*}} [[A_SRC]]
-
-// CHECK: [[CLANG]] "-cc1" "-triple" "x86_64-unknown-linux-gnu"
-// CHECK-SAME: "-aux-triple" "amdgcn-amd-amdhsa"
-// CHECK-SAME: "-emit-obj"
-// CHECK-SAME: {{.*}} "-main-file-name" "a.cu"
-// CHECK-SAME: "-fgpu-rdc"
-// CHECK-SAME: {{.*}} "-o" "[[A_OBJ_HOST:.*o]]" "-x" "hip"
-// CHECK-SAME: {{.*}} [[A_SRC]]
-
-// CHECK: [[BUNDLER:".*clang-offload-bundler"]] "-type=o"
-// CHECK-SAME: "-targets=hip-amdgcn-amd-amdhsa-unknown-gfx803,hip-amdgcn-amd-amdhsa-unknown-gfx900,host-x86_64-unknown-linux-gnu"
-// CHECK-SAME: "-output=[[A_O:.*a.o]]" "-input=[[A_BC1]]" "-input=[[A_BC2]]" "-input=[[A_OBJ_HOST]]"
-
-// CHECK: [[CLANG]] "-cc1" "-triple" "amdgcn-amd-amdhsa"
-// CHECK-SAME: "-aux-triple" "x86_64-unknown-linux-gnu"
-// CHECK-SAME: "-emit-llvm-bc"
-// CHECK-SAME: "-flto=full" "-flto-unit"
-// CHECK-SAME: {{.*}} "-main-file-name" "b.hip"
-// CHECK-SAME: "-fcuda-is-device" "-fno-threadsafe-statics" "-fvisibility=hidden"
-// CHECK-SAME: "-fapply-global-visibility-to-externs"
-// CHECK-SAME: "{{.*}}lib1.bc" "{{.*}}lib2.bc"
-// CHECK-SAME: "-target-cpu" "gfx803"
-// CHECK-SAME: "-fgpu-rdc"
-// CHECK-SAME: {{.*}} "-o" "[[B_BC1:.*o]]" "-x" "hip"
-// CHECK-SAME: {{.*}} [[B_SRC:".*b.hip"]]
-
-// CHECK: [[CLANG]] "-cc1" "-triple" "amdgcn-amd-amdhsa"
-// CHECK-SAME: "-aux-triple" "x86_64-unknown-linux-gnu"
-// CHECK-SAME: "-emit-llvm-bc"
-// CHECK-SAME: "-flto=full" "-flto-unit"
-// CHECK-SAME: {{.*}} "-main-file-name" "b.hip"
-// CHECK-SAME: "-fcuda-is-device"
-// CHECK-SAME: "{{.*}}lib1.bc" "{{.*}}lib2.bc"
-// CHECK-SAME: "-target-cpu" "gfx900"
-// CHECK-SAME: "-fgpu-rdc"
-// CHECK-SAME: {{.*}} "-o" "[[B_BC2:.*o]]" "-x" "hip"
-// CHECK-SAME: {{.*}} [[B_SRC]]
-
-// CHECK: [[CLANG]] "-cc1" "-triple" "x86_64-unknown-linux-gnu"
-// CHECK-SAME: "-aux-triple" "amdgcn-amd-amdhsa"
-// CHECK-SAME: "-emit-obj"
-// CHECK-SAME: {{.*}} "-main-file-name" "b.hip"
-// CHECK-SAME: "-fgpu-rdc"
-// CHECK-SAME: {{.*}} "-o" "[[B_OBJ_HOST:.*o]]" "-x" "hip"
-// CHECK-SAME: {{.*}} [[B_SRC]]
-
-// CHECK: [[BUNDLER:".*clang-offload-bundler"]] "-type=o"
-// CHECK-SAME: "-targets=hip-amdgcn-amd-amdhsa-unknown-gfx803,hip-amdgcn-amd-amdhsa-unknown-gfx900,host-x86_64-unknown-linux-gnu"
-// CHECK-SAME: "-output=[[B_O:.*b.o]]" "-input=[[B_BC1]]" "-input=[[B_BC2]]" "-input=[[B_OBJ_HOST]]"
-
-// RUN: touch %t/a.o %t/b.o
-// RUN: %clang --hip-link -### --target=x86_64-linux-gnu \
-// RUN: --no-offload-new-driver --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 \
-// RUN: -fuse-ld=lld -B%S/Inputs/lld -fgpu-rdc -nogpuinc \
-// RUN: %t/a.o %t/b.o \
-// RUN: 2>&1 | FileCheck -check-prefixes=LINK,LINK-HOST-UNBUNDLE,LLD-TMP,LINK-BUNDLE,LINK-EMBED %s
-
-// RUN: %clang --hip-link -### --target=x86_64-linux-gnu \
-// RUN: --no-offload-new-driver --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 \
-// RUN: -fuse-ld=lld -B%S/Inputs/lld -fgpu-rdc -nogpuinc \
-// RUN: %t/a.o %t/b.o --cuda-device-only \
-// RUN: 2>&1 | FileCheck -check-prefixes=LINK,LLD-TMP,LINK-BUNDLE,LINK-NOEMBED %s
-
-// RUN: %clang --hip-link -### --target=x86_64-linux-gnu \
-// RUN: --no-offload-new-driver --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 \
-// RUN: -fuse-ld=lld -B%S/Inputs/lld -fgpu-rdc -nogpuinc \
-// RUN: %t/a.o %t/b.o --cuda-device-only --no-gpu-bundle-output \
-// RUN: 2>&1 | FileCheck -check-prefixes=LINK,LLD-FIN,LINK-NOBUNDLE,LINK-NOEMBED %s
-
-// LINK-HOST-UNBUNDLE: [[BUNDLER:".*clang-offload-bundler"]] "-type=o"
-// LINK-HOST-UNBUNDLE-SAME: "-targets=host-x86_64-unknown-linux-gnu,hip-amdgcn-amd-amdhsa-unknown-gfx803,hip-amdgcn-amd-amdhsa-unknown-gfx900"
-// LINK-HOST-UNBUNDLE-SAME: "-input=[[A_O:.*a.o]]" "-output=[[A_OBJ_HOST:.*o]]" "-output={{.*o}}" "-output={{.*o}}"
-// LINK-HOST-UNBUNDLE: "-unbundle" "-allow-missing-bundles"
-
-// LINK-HOST-UNBUNDLE: [[BUNDLER:".*clang-offload-bundler"]] "-type=o"
-// LINK-HOST-UNBUNDLE-SAME: "-targets=host-x86_64-unknown-linux-gnu,hip-amdgcn-amd-amdhsa-unknown-gfx803,hip-amdgcn-amd-amdhsa-unknown-gfx900"
-// LINK-HOST-UNBUNDLE-SAME: "-input=[[B_O:.*b.o]]" "-output=[[B_OBJ_HOST:.*o]]" "-output={{.*o}}" "-output={{.*o}}"
-// LINK-HOST-UNBUNDLE: "-unbundle" "-allow-missing-bundles"
-
-// LINK: [[BUNDLER:".*clang-offload-bundler"]] "-type=o"
-// LINK-SAME: "-targets=host-x86_64-unknown-linux-gnu,hip-amdgcn-amd-amdhsa-unknown-gfx803,hip-amdgcn-amd-amdhsa-unknown-gfx900"
-// LINK-SAME: "-input=[[A_O:.*a.o]]" "-output={{.*o}}" "-output=[[A_BC1:.*o]]" "-output=[[A_BC2:.*o]]"
-// LINK-SAME: "-unbundle" "-allow-missing-bundles"
-
-// LINK: [[BUNDLER:".*clang-offload-bundler"]] "-type=o"
-// LINK-SAME: "-targets=host-x86_64-unknown-linux-gnu,hip-amdgcn-amd-amdhsa-unknown-gfx803,hip-amdgcn-amd-amdhsa-unknown-gfx900"
-// LINK-SAME: "-input=[[B_O:.*b.o]]" "-output={{.*o}}" "-output=[[B_BC1:.*o]]" "-output=[[B_BC2:.*o]]"
-// LINK-SAME: "-unbundle" "-allow-missing-bundles"
-
-// LINK-NOT: "*.llvm-link"
-// LINK-NOT: ".*opt"
-// LINK-NOT: ".*llc"
-// LINK: {{".*lld.*"}} {{.*}} "-plugin-opt=-amdgpu-internalize-symbols"
-// LINK-SAME: "-plugin-opt=mcpu=gfx803"
-// LINK-SAME: "--whole-archive"
-// LLD-TMP-SAME: "-o" "[[IMG_DEV1:.*.out]]"
-// LLD-FIN-SAME: "-o" "[[IMG_DEV1:a.out-.*gfx803]]"
-// LINK-SAME "[[A_BC1]]" "[[B_BC1]]"
-// LINK-SAME: "--no-whole-archive"
-
-// LINK-NOT: "*.llvm-link"
-// LINK-NOT: ".*opt"
-// LINK-NOT: ".*llc"
-// LINK: {{".*lld.*"}} {{.*}} "-plugin-opt=-amdgpu-internalize-symbols"
-// LINK-SAME: "-plugin-opt=mcpu=gfx900"
-// LINK-SAME: "--whole-archive"
-// LLD-TMP-SAME: "-o" "[[IMG_DEV2:.*.out]]"
-// LLD-FIN-SAME: "-o" "[[IMG_DEV1:a.out-.*gfx900]]"
-// LINK-SAME "[[A_BC2]]" "[[B_BC2]]"
-// LINK-SAME: "--no-whole-archive"
-
-// LINK-BUNDLE: [[BUNDLER:".*clang-offload-bundler"]] "-type=o"
-// LINK-BUNDLE-SAME: "-targets={{.*}},hipv4-amdgcn-amd-amdhsa--gfx803,hipv4-amdgcn-amd-amdhsa--gfx900"
-// LINK-BUNDLE-SAME: "-input={{.*}}" "-input=[[IMG_DEV1]]" "-input=[[IMG_DEV2]]" "-output=[[BUNDLE:.*]]"
-// LINK-NOBUNDLE-NOT: {{".*clang-offload-bundler"}} "-type=o"
-
-// LINK-EMBED: {{".*clang.*"}} "-o" "[[OBJBUNDLE:.*o]]" "{{.*}}.mcin"
-// LINK-NOEMBED-NOT: {{".*clang.*"}} "-o"
-
-// LINK-EMBED: [[LD:".*ld.*"]] {{.*}} "-o" "a.out" {{.*}} "[[A_OBJ_HOST]]"
-// LINK-EMBED-SAME: "[[B_OBJ_HOST]]" "[[OBJBUNDLE]]"
-// LINK-NOEMBED-NOT: {{".*ld.*"}} {{.*}} "-o" "a.out"
diff --git a/clang/test/Driver/hip-toolchain-rdc-static-lib.hip b/clang/test/Driver/hip-toolchain-rdc-static-lib.hip
deleted file mode 100644
index 71ac901b69299..0000000000000
--- a/clang/test/Driver/hip-toolchain-rdc-static-lib.hip
+++ /dev/null
@@ -1,98 +0,0 @@
-// RUN: %clang -### --target=x86_64-linux-gnu \
-// RUN: -x hip --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 \
-// RUN: --no-offload-new-driver --emit-static-lib -nogpulib \
-// RUN: -fuse-ld=lld -B%S/Inputs/lld -fgpu-rdc -nogpuinc \
-// RUN: -flto-partitions=8 \
-// RUN: %S/Inputs/hip_multiple_inputs/a.cu \
-// RUN: %S/Inputs/hip_multiple_inputs/b.hip \
-// RUN: 2>&1 | FileCheck %s
-
-// emit objects for host side path
-// CHECK: [[CLANG:".*clang.*"]] "-cc1" "-triple" "x86_64-unknown-linux-gnu"
-// CHECK-SAME: "-aux-triple" "amdgcn-amd-amdhsa"
-// CHECK-SAME: "-emit-obj"
-// CHECK-SAME: {{.*}} "-main-file-name" "a.cu"
-// CHECK-SAME: "-fgpu-rdc"
-// CHECK-SAME: {{.*}} "-o" [[A_OBJ_HOST:".*o"]] "-x" "hip"
-// CHECK-SAME: {{.*}} [[A_SRC:".*a.cu"]]
-
-// CHECK: [[CLANG]] "-cc1" "-triple" "x86_64-unknown-linux-gnu"
-// CHECK-SAME: "-aux-triple" "amdgcn-amd-amdhsa"
-// CHECK-SAME: "-emit-obj"
-// CHECK-SAME: {{.*}} "-main-file-name" "b.hip"
-// CHECK-SAME: "-fgpu-rdc"
-// CHECK-SAME: {{.*}} "-o" [[B_OBJ_HOST:".*o"]] "-x" "hip"
-// CHECK-SAME: {{.*}} [[B_SRC:".*b.hip"]]
-
-// generate image for device side path on gfx803
-// CHECK: [[CLANG]] "-cc1" "-triple" "amdgcn-amd-amdhsa"
-// CHECK-SAME: "-aux-triple" "x86_64-unknown-linux-gnu"
-// CHECK-SAME: "-emit-llvm-bc"
-// CHECK-SAME: "-flto=full" "-flto-unit"
-// CHECK-SAME: {{.*}} "-main-file-name" "a.cu"
-// CHECK-SAME: "-fcuda-is-device"
-// CHECK-SAME: "-target-cpu" "gfx803"
-// CHECK-SAME: "-fgpu-rdc"
-// CHECK-SAME: {{.*}} "-o" [[A_BC1:".*o"]] "-x" "hip"
-// CHECK-SAME: {{.*}} [[A_SRC]]
-
-// CHECK: [[CLANG]] "-cc1" "-triple" "amdgcn-amd-amdhsa"
-// CHECK-SAME: "-aux-triple" "x86_64-unknown-linux-gnu"
-// CHECK-SAME: "-emit-llvm-bc"
-// CHECK-SAME: "-flto=full" "-flto-unit"
-// CHECK-SAME: {{.*}} "-main-file-name" "b.hip"
-// CHECK-SAME: "-fcuda-is-device"
-// CHECK-SAME: "-target-cpu" "gfx803"
-// CHECK-SAME: "-fgpu-rdc"
-// CHECK-SAME: {{.*}} "-o" [[B_BC1:".*o"]] "-x" "hip"
-// CHECK-SAME: {{.*}} [[B_SRC]]
-
-// CHECK-NOT: "*.llvm-link"
-// CHECK-NOT: ".*opt"
-// CHECK-NOT: ".*llc"
-// CHECK: [[LLD: ".*lld.*"]] {{.*}} "-plugin-opt=-amdgpu-internalize-symbols"
-// CHECK-SAME: "--lto-partitions={{[0-9]+}}"
-// CHECK-SAME: "-plugin-opt=mcpu=gfx803"
-// CHECK-SAME: "-o" "[[IMG_DEV1:.*out]]" [[A_BC1]] [[B_BC1]]
-
-// generate image for device side path on gfx900
-// CHECK: [[CLANG]] "-cc1" "-triple" "amdgcn-amd-amdhsa"
-// CHECK-SAME: "-aux-triple" "x86_64-unknown-linux-gnu"
-// CHECK-SAME: "-emit-llvm-bc"
-// CHECK-SAME: "-flto=full" "-flto-unit"
-// CHECK-SAME: {{.*}} "-main-file-name" "a.cu"
-// CHECK-SAME: "-fcuda-is-device"
-// CHECK-SAME: "-target-cpu" "gfx900"
-// CHECK-SAME: "-fgpu-rdc"
-// CHECK-SAME: {{.*}} "-o" [[A_BC2:".*o"]] "-x" "hip"
-// CHECK-SAME: {{.*}} [[A_SRC]]
-
-// CHECK: [[CLANG]] "-cc1" "-triple" "amdgcn-amd-amdhsa"
-// CHECK-SAME: "-aux-triple" "x86_64-unknown-linux-gnu"
-// CHECK-SAME: "-emit-llvm-bc"
-// CHECK-SAME: "-flto=full" "-flto-unit"
-// CHECK-SAME: {{.*}} "-main-file-name" "b.hip"
-// CHECK-SAME: "-fcuda-is-device"
-// CHECK-SAME: "-target-cpu" "gfx900"
-// CHECK-SAME: "-fgpu-rdc"
-// CHECK-SAME: {{.*}} "-o" [[B_BC2:".*o"]] "-x" "hip"
-// CHECK-SAME: {{.*}} [[B_SRC]]
-
-// CHECK-NOT: "*.llvm-link"
-// CHECK-NOT: ".*opt"
-// CHECK-NOT: ".*llc"
-// CHECK: [[LLD]] {{.*}} "-plugin-opt=-amdgpu-internalize-symbols"
-// CHECK-SAME: "--lto-partitions={{[0-9]+}}"
-// CHECK-SAME: "-plugin-opt=mcpu=gfx900"
-// CHECK-SAME: "--whole-archive"
-// CHECK-SAME: "-o" "[[IMG_DEV2:.*out]]" [[A_BC2]] [[B_BC2]]
-// CHECK-SAME: "--no-whole-archive"
-
-// combine images generated into hip fat binary object
-// CHECK: [[BUNDLER:".*clang-offload-bundler"]] "-type=o"
-// CHECK-SAME: "-targets={{.*}},hipv4-amdgcn-amd-amdhsa--gfx803,hipv4-amdgcn-amd-amdhsa--gfx900"
-// CHECK-SAME: "-input=[[IMG_DEV1]]" "-input=[[IMG_DEV2]]" "-output=[[BUNDLE:.*hipfb]]"
-
-// CHECK: [[MC:".*clang.*"]] "-o" [[OBJBUNDLE:".*o"]] "{{.*}}.mcin"
-
-// CHECK: [[AR:".*llvm-ar.*"]] "rcsD" "{{.*}}.out" [[A_OBJ_HOST]] [[B_OBJ_HOST]] [[OBJBUNDLE]]
diff --git a/clang/test/Driver/hip-toolchain-rdc.hip b/clang/test/Driver/hip-toolchain-rdc.hip
index 7e100c521441d..d011fc046e48f 100644
--- a/clang/test/Driver/hip-toolchain-rdc.hip
+++ b/clang/test/Driver/hip-toolchain-rdc.hip
@@ -1,193 +1,6 @@
-// RUN: %clang -### --target=x86_64-linux-gnu -v \
-// RUN: -x hip --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 \
-// RUN: --hip-device-lib=lib1.bc --hip-device-lib=lib2.bc \
-// RUN: --hip-device-lib-path=%S/Inputs/hip_multiple_inputs/lib1 \
-// RUN: --hip-device-lib-path=%S/Inputs/hip_multiple_inputs/lib2 \
-// RUN: -fuse-ld=lld -B%S/Inputs/lld -fgpu-rdc -nogpuinc \
-// RUN: --no-offload-new-driver -fhip-dump-offload-linker-script \
-// RUN: -flto-partitions=8 \
-// RUN: %S/Inputs/hip_multiple_inputs/a.cu \
-// RUN: %S/Inputs/hip_multiple_inputs/b.hip \
-// RUN: 2>&1 | FileCheck -check-prefixes=CHECK,LNX %s
-
-// RUN: %clang -### --target=x86_64-pc-windows-msvc -v \
-// RUN: -x hip --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 \
-// RUN: --hip-device-lib=lib1.bc --hip-device-lib=lib2.bc \
-// RUN: --hip-device-lib-path=%S/Inputs/hip_multiple_inputs/lib1 \
-// RUN: --hip-device-lib-path=%S/Inputs/hip_multiple_inputs/lib2 \
-// RUN: -fuse-ld=lld -B%S/Inputs/lld -fgpu-rdc -nogpuinc \
-// RUN: --no-offload-new-driver -fhip-dump-offload-linker-script \
-// RUN: -flto-partitions=8 \
-// RUN: %S/Inputs/hip_multiple_inputs/a.cu \
-// RUN: %S/Inputs/hip_multiple_inputs/b.hip \
-// RUN: 2>&1 | FileCheck -check-prefixes=CHECK,MSVC %s
-
-// Test fatbin symbol search for -l libraries.
-
-// RUN: touch librdctest.a rdctest2.bin
-// RUN: %clang -### --target=x86_64-linux-gnu -v \
-// RUN: -fgpu-rdc -nogpuinc -nogpulib \
-// RUN: --no-offload-new-driver -L. -lrdctest -l:rdctest2.bin \
-// RUN: %s \
-// RUN: 2>&1 | FileCheck -check-prefixes=LIB,LNX-LIB %s
-// RUN: rm librdctest.a rdctest2.bin
-
-// RUN: touch rdctest.lib rdctest2.bin
-// RUN: %clang -### --target=x86_64-pc-windows-msvc -v \
-// RUN: -fgpu-rdc -nogpuinc -nogpulib \
-// RUN: --no-offload-new-driver -L. -lrdctest -l:rdctest2.bin \
-// RUN: %s \
-// RUN: 2>&1 | FileCheck -check-prefixes=LIB,MSVC-LIB %s
-// RUN: rm rdctest.lib rdctest2.bin
-
-// LIB: HIP fatbin symbol search uses library path: .
-// LIB: HIP fatbin symbol search found library: .{{/|\\}}rdctest2.bin
-// LNX-LIB: HIP fatbin symbol search found library: .{{/|\\}}librdctest.a
-// MSVC-LIB: HIP fatbin symbol search found library: .{{/|\\}}rdctest.lib
-
-// check HIP fatbin and gpubin handle symbols and code object alignment in dumped llvm-mc input
-// CHECK: Found undefined HIP fatbin symbol: __hip_fatbin_[[ID1:[0-9a-f]+]]
-// CHECK: Found undefined HIP fatbin symbol: __hip_fatbin_[[ID2:[0-9a-f]+]]
-// CHECK: Found undefined HIP gpubin handle symbol: __hip_gpubin_handle_[[ID1]]
-// CHECK: Found undefined HIP gpubin handle symbol: __hip_gpubin_handle_[[ID2]]
-// LNX: .protected __hip_gpubin_handle_[[ID1]]
-// LNX: .type __hip_gpubin_handle_[[ID1]]
-// LNX-LABEL: .section .hip_gpubin_handle,"aw"
-// MSVC-LABEL: .section .hip_gpubin_handle,"dw"
-// CHECK: .globl __hip_gpubin_handle_[[ID1]]
-// CHECK-NEXT: .p2align 3
-// CHECK-NEXT:__hip_gpubin_handle_[[ID1]]:
-// CHECK-NEXT: .zero 8
-// CHECK-NEXT: .globl __hip_gpubin_handle_[[ID2]]
-// CHECK-NEXT: .set __hip_gpubin_handle_[[ID2]],__hip_gpubin_handle_[[ID1]]
-// LNX: .protected __hip_fatbin_[[ID1]]
-// LNX: .type __hip_fatbin_[[ID1]], at object
-// LNX-LABEL: .section .hip_fatbin,"a", at progbits
-// MSVC-LABEL: .section .hip_fatbin,"dw"
-// CHECK: .globl __hip_fatbin_[[ID1]]
-// CHECK-NEXT: .p2align 12
-// CHECK-NEXT: .globl __hip_fatbin_[[ID2]]
-// CHECK-NEXT: .set __hip_fatbin_[[ID2]],__hip_fatbin_[[ID1]]
-// CHECK-NEXT: __hip_fatbin_[[ID1]]:
-// CHECK-NEXT: .incbin "[[BUNDLE:.*hipfb]]"
-// LNX: .section .note.GNU-stack, "", @progbits
-// MSVC-NOT: .note.GNU-stack
-
-// emit objects for host side path
-// CHECK: [[CLANG:".*clang.*"]] "-cc1" "-triple" [[HOST:"x86_64-[^"]+"]]
-// CHECK-SAME: "-aux-triple" "amdgcn-amd-amdhsa"
-// CHECK-SAME: "-emit-obj"
-// CHECK-SAME: {{.*}} "-main-file-name" "a.cu"
-// CHECK-SAME: "-fgpu-rdc"
-// CHECK-SAME: {{.*}} "-o" [[A_OBJ_HOST:".*o"]] "-x" "hip"
-// CHECK-SAME: {{.*}} [[A_SRC:".*a.cu"]]
-
-// CHECK: [[CLANG]] "-cc1" "-triple" [[HOST]]
-// CHECK-SAME: "-aux-triple" "amdgcn-amd-amdhsa"
-// CHECK-SAME: "-emit-obj"
-// CHECK-SAME: {{.*}} "-main-file-name" "b.hip"
-// CHECK-SAME: "-fgpu-rdc"
-// CHECK-SAME: {{.*}} "-o" [[B_OBJ_HOST:".*o"]] "-x" "hip"
-// CHECK-SAME: {{.*}} [[B_SRC:".*b.hip"]]
-
-// generate image for device side path on gfx803
-// CHECK: [[CLANG]] "-cc1" "-triple" "amdgcn-amd-amdhsa"
-// CHECK-SAME: "-aux-triple" [[HOST:"x86_64-[^"]+"]]
-// CHECK-SAME: "-emit-llvm-bc"
-// CHECK-SAME: "-flto=full" "-flto-unit"
-// CHECK-SAME: {{.*}} "-main-file-name" "a.cu"
-// CHECK-SAME: "-fcuda-is-device" "-fno-threadsafe-statics" "-fvisibility=hidden"
-// CHECK-SAME: "-fapply-global-visibility-to-externs"
-// CHECK-SAME: "{{.*}}lib1.bc" "{{.*}}lib2.bc"
-// CHECK-SAME: "-target-cpu" "gfx803"
-// CHECK-SAME: "-fgpu-rdc"
-// CHECK-SAME: {{.*}} "-o" [[A_BC1:".*o"]] "-x" "hip"
-// CHECK-SAME: {{.*}} [[A_SRC]]
-
-// CHECK: [[CLANG]] "-cc1" "-triple" "amdgcn-amd-amdhsa"
-// CHECK-SAME: "-aux-triple" [[HOST]]
-// CHECK-SAME: "-emit-llvm-bc"
-// CHECK-SAME: "-flto=full" "-flto-unit"
-// CHECK-SAME: {{.*}} "-main-file-name" "b.hip"
-// CHECK-SAME: "-fcuda-is-device" "-fno-threadsafe-statics" "-fvisibility=hidden"
-// CHECK-SAME: "-fapply-global-visibility-to-externs"
-// CHECK-SAME: "{{.*}}lib1.bc" "{{.*}}lib2.bc"
-// CHECK-SAME: "-target-cpu" "gfx803"
-// CHECK-SAME: "-fgpu-rdc"
-// CHECK-SAME: {{.*}} "-o" [[B_BC1:".*o"]] "-x" "hip"
-// CHECK-SAME: {{.*}} [[B_SRC]]
-
-// CHECK-NOT: "*.llvm-link"
-// CHECK-NOT: ".*opt"
-// CHECK-NOT: ".*llc"
-// CHECK: {{".*lld.*"}} {{.*}} "-plugin-opt=-amdgpu-internalize-symbols"
-// CHECK-SAME: "-plugin-opt=mcpu=gfx803"
-// CHECK-SAME: "-o" "[[IMG_DEV1:.*.out]]" [[A_BC1]] [[B_BC1]]
-
-// generate image for device side path on gfx900
-// CHECK: [[CLANG]] "-cc1" "-triple" "amdgcn-amd-amdhsa"
-// CHECK-SAME: "-aux-triple" [[HOST]]
-// CHECK-SAME: "-emit-llvm-bc"
-// CHECK-SAME: "-flto=full" "-flto-unit"
-// CHECK-SAME: {{.*}} "-main-file-name" "a.cu"
-// CHECK-SAME: "-fcuda-is-device"
-// CHECK-SAME: "{{.*}}lib1.bc" "{{.*}}lib2.bc"
-// CHECK-SAME: "-target-cpu" "gfx900"
-// CHECK-SAME: {{.*}} "-o" [[A_BC2:".*o"]] "-x" "hip"
-// CHECK-SAME: {{.*}} [[A_SRC]]
-
-// CHECK: [[CLANG]] "-cc1" "-triple" "amdgcn-amd-amdhsa"
-// CHECK-SAME: "-aux-triple" [[HOST]]
-// CHECK-SAME: "-emit-llvm-bc"
-// CHECK-SAME: "-flto=full" "-flto-unit"
-// CHECK-SAME: {{.*}} "-main-file-name" "b.hip"
-// CHECK-SAME: "-fcuda-is-device"
-// CHECK-SAME: "{{.*}}lib1.bc" "{{.*}}lib2.bc"
-// CHECK-SAME: "-target-cpu" "gfx900"
-// CHECK-SAME: "-fgpu-rdc"
-// CHECK-SAME: {{.*}} "-o" [[B_BC2:".*o"]] "-x" "hip"
-// CHECK-SAME: {{.*}} [[B_SRC]]
-
-// CHECK-NOT: "*.llvm-link"
-// CHECK-NOT: ".*opt"
-// CHECK-NOT: ".*llc"
-// CHECK: {{".*lld.*"}} {{.*}} "-plugin-opt=-amdgpu-internalize-symbols"
-// CHECK-SAME: "--lto-partitions={{[0-9]+}}"
-// CHECK-SAME: "-plugin-opt=mcpu=gfx900"
-// CHECK-SAME: "-o" "[[IMG_DEV2:.*.out]]" [[A_BC2]] [[B_BC2]]
-
-// combine images generated into hip fat binary object
-// CHECK: [[BUNDLER:".*clang-offload-bundler"]] "-type=o"
-// CHECK-SAME: "-bundle-align=4096"
-// CHECK-SAME: "-targets={{.*}},hipv4-amdgcn-amd-amdhsa--gfx803,hipv4-amdgcn-amd-amdhsa--gfx900"
-// CHECK-SAME: "-input={{.*}}" "-input=[[IMG_DEV1]]" "-input=[[IMG_DEV2]]" "-output=[[BUNDLE]]"
-
-// CHECK: [[MC:".*clang.*"]] "-target" [[HOST]] "-o" [[OBJBUNDLE:".*o"]] "{{.*}}.mcin"
-
-// output the executable
-// LNX: [[LD:".*ld.*"]] {{.*}}"-o" "a.out" {{.*}} [[A_OBJ_HOST]] [[B_OBJ_HOST]] [[OBJBUNDLE]]
-// MSVC: [[LD:".*lld-link.*"]] {{.*}}"-out:a.exe" {{.*}} [[A_OBJ_HOST]] [[B_OBJ_HOST]] [[OBJBUNDLE]]
-
// Check -flto-partitions
-// RUN: %clang -### -fgpu-rdc --offload-arch=gfx90a -nogpulib -nogpuinc --no-offload-new-driver \
-// RUN: -L. -foffload-lto %s 2>&1 | FileCheck -check-prefix=LTO_DEFAULT %s
-// LTO_DEFAULT: lld
-// LTO_DEFAULT-NOT: "--lto-partitions=
-
-// RUN: %clang -### -fgpu-rdc --offload-arch=gfx90a -nogpulib -nogpuinc --offload-new-driver \
+// RUN: %clang -### -fgpu-rdc --offload-arch=gfx90a -nogpulib -nogpuinc \
// RUN: -L. -foffload-lto %s 2>&1 | FileCheck -check-prefix=LTO_DEFAULT_NEW %s
// LTO_DEFAULT_NEW: clang-linker-wrapper
// LTO_DEFAULT_NEW-NOT: "--device-compiler=amdgcn-amd-amdhsa=-flto-partitions=
-
-// RUN: %clang -### -fgpu-rdc --offload-arch=gfx90a -nogpulib -nogpuinc --no-offload-new-driver \
-// RUN: -L. -foffload-lto -flto-partitions=42 %s 2>&1 | FileCheck -check-prefix=LTO_PARTS %s
-// LTO_PARTS: lld{{.*}}"--lto-partitions=42"
-
-// RUN: not %clang -### -fgpu-rdc --offload-arch=gfx90a -nogpulib -nogpuinc --no-offload-new-driver \
-// RUN: -L. -foffload-lto -flto-partitions=a %s 2>&1 | FileCheck -check-prefix=LTO_PARTS_INV0 %s
-// LTO_PARTS_INV0: clang: error: invalid integral value 'a' in '-flto-partitions=a'
-
-// RUN: not %clang -### -fgpu-rdc --offload-arch=gfx90a -nogpulib -nogpuinc --no-offload-new-driver \
-// RUN: -L. -foffload-lto -flto-partitions=0 %s 2>&1 | FileCheck -check-prefix=LTO_PARTS_INV1 %s
-// LTO_PARTS_INV1: clang: error: invalid integral value '0' in '-flto-partitions=0'
diff --git a/clang/test/Driver/hip-unbundle-preproc.hipi b/clang/test/Driver/hip-unbundle-preproc.hipi
deleted file mode 100644
index 2cbc0db59062a..0000000000000
--- a/clang/test/Driver/hip-unbundle-preproc.hipi
+++ /dev/null
@@ -1,27 +0,0 @@
-// RUN: %clang -### --target=x86_64-unknown-linux-gnu \
-// RUN: --no-offload-new-driver --offload-arch=gfx803 -nogpulib \
-// RUN: -x hip-cpp-output %s 2>&1 | FileCheck %s
-
-// RUN: %clang -### --target=x86_64-unknown-linux-gnu \
-// RUN: --no-offload-new-driver --offload-arch=gfx803 -nogpulib \
-// RUN: %s 2>&1 | FileCheck %s
-
-// CHECK: {{".*clang-offload-bundler.*"}} {{.*}}"-output=[[HOST_PP:.*hipi]]" "-output=[[DEV_PP:.*hipi]]" "-unbundle"
-// CHECK: {{".*clang.*"}} "-cc1" {{.*}}"-target-cpu" "gfx803" {{.*}}"-o" "[[DEV_O:[^"]*]]" {{.*}}"[[DEV_PP]]"
-// CHECK: {{".*lld.*"}} {{.*}}"-o" "[[DEV_ISA:.*]]" "[[DEV_O]]"
-// CHECK: {{".*clang-offload-bundler.*"}} {{.*}}"-input={{.*}}" "-input=[[DEV_ISA]]" "-output=[[FATBIN:.*]]"
-// CHECK: {{".*clang.*"}} {{.*}}"-triple" "x86_64-unknown-linux-gnu"{{.*}} "-fcuda-include-gpubinary" "[[FATBIN]]" {{.*}}"-o" "[[HOST_O:.*o]]" {{.*}}"[[HOST_PP]]"
-// CHECK: {{".*ld.*"}} {{.*}}"[[HOST_O]]"
-
-// RUN: %clang -### --target=x86_64-unknown-linux-gnu \
-// RUN: --no-offload-new-driver --offload-arch=gfx803 -nogpulib -fgpu-rdc \
-// RUN: %s 2>&1 | FileCheck -check-prefix=RDC %s
-
-// RDC: {{".*clang-offload-bundler.*"}} {{.*}}"-output=[[HOST_PP:.*hipi]]" "-output=[[DEV_PP:.*hipi]]" "-unbundle"
-// RDC: {{".*clang.*"}} {{.*}}"-triple" "x86_64-unknown-linux-gnu"{{.*}} "-o" "[[HOST_O:.*o]]" {{.*}}"[[HOST_PP]]"
-// RDC: {{".*clang-offload-bundler.*"}} {{.*}}"-output=[[HOST_PP:.*hipi]]" "-output=[[DEV_PP:.*hipi]]" "-unbundle"
-// RDC: {{".*clang.*"}} "-cc1" {{.*}}"-target-cpu" "gfx803" {{.*}}"-o" "[[DEV_BC:[^"]*]]" {{.*}}"[[DEV_PP]]"
-// RDC: {{".*lld.*"}} {{.*}}"-o" "[[DEV_ISA:.*]]" "[[DEV_BC]]"
-// RDC: {{".*clang-offload-bundler.*"}} {{.*}}"-input={{.*}}" "-input=[[DEV_ISA]]" "-output=[[FATBIN:.*]]"
-// RDC: {{".*clang.*"}} "-o" "[[FATBIN_O:.*o]]"
-// RDC: {{".*ld.*"}} {{.*}}"[[HOST_O]]" "[[FATBIN_O]]"
diff --git a/clang/test/Driver/hipspv-link-static-library.hip b/clang/test/Driver/hipspv-link-static-library.hip
index eb114ada49020..3637fbe3a61e5 100644
--- a/clang/test/Driver/hipspv-link-static-library.hip
+++ b/clang/test/Driver/hipspv-link-static-library.hip
@@ -4,23 +4,7 @@
// REQUIRES: spirv-registered-target
// UNSUPPORTED: system-windows
-// Create a dummy archive to test SDL linking
// RUN: rm -rf %t && mkdir %t
-// RUN: touch %t/dummy.bc
-// RUN: llvm-ar cr %t/libSDL.a %t/dummy.bc
-
-// Test that -l options are passed to llvm-link for --offload=spirv64
-// RUN: %clang -### --target=x86_64-linux-gnu --offload=spirv64 \
-// RUN: --hip-path=%S/Inputs/hipspv -nohipwrapperinc %s \
-// RUN: --no-offload-new-driver -L%t -lSDL \
-// RUN: 2>&1 | FileCheck -check-prefixes=SDL %s
-
-// Test that .a files are properly unbundled and passed to llvm-link
-// RUN: %clang -### --target=x86_64-linux-gnu --offload=spirv64 \
-// RUN: --hip-path=%S/Inputs/hipspv -nohipwrapperinc %s \
-// RUN: --no-offload-new-driver %t/libSDL.a \
-// RUN: 2>&1 | FileCheck -check-prefixes=SDL %s
-
// RUN: %clang -cc1 %s -triple spirv64-unknown-chipstar -emit-llvm-bc -o %t/dev.bc
// RUN: llvm-offload-binary -o %t/dev.out \
// RUN: --image=file=%t/dev.bc,kind=hip,triple=spirv64-unknown-chipstar,arch=generic
@@ -29,7 +13,7 @@
// RUN: cp %t/tu0.o %t/tu1.o
// RUN: llvm-ar cr %t/libSDL2.a %t/tu1.o
-// RUN: %clang -### --target=x86_64-linux-gnu --offload-new-driver -fgpu-rdc \
+// RUN: %clang -### --target=x86_64-linux-gnu --offload-link -fgpu-rdc \
// RUN: -Xoffload-compiler-spirv64-unknown-chipstar \
// RUN: --hip-path=%S/Inputs/hipspv -no-hip-rt %t/tu0.o %t/libSDL2.a \
// RUN: 2>&1 | FileCheck -check-prefixes=SDL-NEW %s -DHIP_PATH=%S/Inputs/hipspv
@@ -39,19 +23,10 @@
// RUN: --linker-path=/usr/bin/ld -o a.out %t/tu0.o %t/libSDL2.a \
// RUN: 2>&1 | FileCheck -check-prefixes=SDL-NEW-WRAPPER %s -DHIP_PATH=%S/Inputs/hipspv
-// Verify that the input files are added before the SDL files in llvm-link command
-// This tests the ordering fix to match HIPAMD behavior
-// SDL: "{{.*}}clang-offload-bundler" "-unbundle" "-type=a" "-input={{.*}}libSDL.a" "-targets=hip-spirv64-unknown-unknown-unknown-generic" "-output=[[SDL_A:.*\.a]]" "-allow-missing-bundles"
-// SDL: "{{.*}}llvm-link" "-o" "{{.*}}.bc" "{{.*}}.bc" "[[SDL_A]]"
// SDL-NEW: "{{.*}}clang-linker-wrapper"
// SDL-NEW-SAME: "--device-compiler=spirv64-unknown-chipstar=--hip-path=[[HIP_PATH]]"
// SDL-NEW-SAME: "{{.*}}/tu0.o" "{{.*}}/libSDL2.a"
-// DELETE-SDL-NEW: "{{.*}}llvm-link" "-o" "{{.*}}.bc" "{{.*}}.o" "{{.*}}.o"
// SDL-NEW-WRAPPER: clang{{.*}}" --no-default-config -o {{[^ ]*.img}}
// SDL-NEW-WRAPPER-SAME: {{[^ ]*.o}} {{[^ ]*.o}}
// SDL-NEW-WRAPPER-SAME: --hip-path=[[HIP_PATH]]
-
-// SDL: "{{.*}}opt"
-// SDL-SAME: "-load-pass-plugin" {{".*/hipspv/lib/libLLVMHipSpvPasses.so"}}
-// SDL-SAME: "-passes=hip-post-link-passes"
diff --git a/clang/test/Driver/hipspv-pass-plugin.hip b/clang/test/Driver/hipspv-pass-plugin.hip
index 3a0979ad6df01..1bee266d568bc 100644
--- a/clang/test/Driver/hipspv-pass-plugin.hip
+++ b/clang/test/Driver/hipspv-pass-plugin.hip
@@ -1,23 +1,5 @@
// UNSUPPORTED: system-windows
-// RUN: %clang -### -target x86_64-linux-gnu --offload=spirv64 \
-// RUN: --no-offload-new-driver --hip-path=%S/Inputs/hipspv -nogpuinc %s \
-// RUN: 2>&1 | FileCheck --check-prefixes=ALL,FROM-HIP-PATH %s
-
-// RUN: %clang -### -target x86_64-linux-gnu --offload=spirv64 \
-// RUN: --no-offload-new-driver -nogpuinc -nogpulib --hipspv-pass-plugin=%S/Inputs/pass-plugin.so %s \
-// RUN: 2>&1 | FileCheck --check-prefixes=ALL,FROM-OPTION %s
-
-// RUN: not %clang -### --target=x86_64-linux-gnu --offload=spirv64 \
-// RUN: --no-offload-new-driver -nogpuinc -nogpulib --hipspv-pass-plugin=foo.so %s \
-// RUN: 2>&1 | FileCheck --check-prefixes=ALL,FROM-OPTION-INVALID %s
-
-// RUN: %clang -### -target x86_64-linux-gnu --offload=spirv64 \
-// RUN: --no-offload-new-driver -nogpuinc -nogpulib %s \
-// RUN: 2>&1 | FileCheck --check-prefixes=ALL,NO-PLUGIN %s
-
-// Run commands for the new offload driver:
-
// RUN: touch %t.dummy.o
// RUN: %clang -### --no-default-config -o /dev/null --target=spirv64-unknown-chipstar \
// RUN: %t.dummy.o --hip-path=%S/Inputs/hipspv \
diff --git a/clang/test/Driver/hipspv-toolchain-rdc-separate.hip b/clang/test/Driver/hipspv-toolchain-rdc-separate.hip
index f4d71bfb8d631..41ea26d27cb06 100644
--- a/clang/test/Driver/hipspv-toolchain-rdc-separate.hip
+++ b/clang/test/Driver/hipspv-toolchain-rdc-separate.hip
@@ -1,7 +1,7 @@
// UNSUPPORTED: system-windows
// RUN: %clang -### -x hip -target x86_64-linux-gnu \
-// RUN: --offload=spirv64-unknown-chipstar --offload-new-driver -fgpu-rdc -c \
+// RUN: --offload=spirv64-unknown-chipstar -fgpu-rdc -c \
// RUN: --hip-path=%S/Inputs/hipspv -nohipwrapperinc \
// RUN: %S/Inputs/hip_multiple_inputs/a.cu \
// RUN: %S/Inputs/hip_multiple_inputs/b.hip \
@@ -51,7 +51,7 @@
// RUN: rm -rf %t && mkdir %t
// RUN: touch %t/a.o %t/b.o
-// RUN: %clang -### -target x86_64-linux-gnu --offload-new-driver -fgpu-rdc \
+// RUN: %clang -### -target x86_64-linux-gnu --offload-link -fgpu-rdc \
// RUN: -Xoffload-compiler-spirv64-unknown-chipstar \
// RUN: --hip-path=%S/Inputs/hipspv \
// RUN: -no-hip-rt %t/a.o %t/b.o \
diff --git a/clang/test/Driver/hipspv-toolchain-rdc.hip b/clang/test/Driver/hipspv-toolchain-rdc.hip
index 2745e61d7b28a..47f00955c4661 100644
--- a/clang/test/Driver/hipspv-toolchain-rdc.hip
+++ b/clang/test/Driver/hipspv-toolchain-rdc.hip
@@ -1,72 +1,13 @@
// UNSUPPORTED: system-windows
-// RUN: %clang -### -x hip -target x86_64-linux-gnu --offload=spirv64 \
-// RUN: --no-offload-new-driver -fgpu-rdc --hip-path=%S/Inputs/hipspv -nohipwrapperinc \
-// RUN: %S/Inputs/hip_multiple_inputs/a.cu \
-// RUN: %S/Inputs/hip_multiple_inputs/b.hip \
-// RUN: 2>&1 | FileCheck --check-prefix=OLD %s
-
// RUN: %clang -### -x hip -target x86_64-linux-gnu \
-// RUN: --offload=spirv64-unknown-chipstar --offload-new-driver -fgpu-rdc \
+// RUN: --offload=spirv64-unknown-chipstar -fgpu-rdc \
// RUN: --hip-path=%S/Inputs/hipspv -nohipwrapperinc -no-hip-rt \
// RUN: %S/Inputs/hip_multiple_inputs/a.cu \
// RUN: %S/Inputs/hip_multiple_inputs/b.hip \
// RUN: 2>&1 | FileCheck --check-prefix=NEW \
// RUN: -DOFFLOAD_TRIPLE=spirv64-unknown-chipstar -DHIP_PATH=%S/Inputs/hipspv %s
-// Emit objects for host side path
-// OLD: [[CLANG:".*clang.*"]] "-cc1" "-triple" "x86_64-unknown-linux-gnu"
-// OLD-SAME: "-aux-triple" "spirv64"
-// OLD-SAME: "-emit-obj"
-// OLD-SAME: "-fgpu-rdc"
-// OLD-SAME: {{.*}} "-o" [[A_OBJ_HOST:".*o"]] "-x" "hip"
-// OLD-SAME: {{.*}} [[A_SRC:".*a.cu"]]
-
-// OLD: [[CLANG]] "-cc1" "-triple" "x86_64-unknown-linux-gnu"
-// OLD-SAME: "-aux-triple" "spirv64"
-// OLD-SAME: "-emit-obj"
-// OLD-SAME: "-fgpu-rdc"
-// OLD-SAME: {{.*}} "-o" [[B_OBJ_HOST:".*o"]] "-x" "hip"
-// OLD-SAME: {{.*}} [[B_SRC:".*b.hip"]]
-
-// Emit code (LLVM BC) for device side path.
-// OLD: [[CLANG]] "-cc1" "-triple" "spirv64"
-// OLD-SAME: "-aux-triple" "x86_64-unknown-linux-gnu"
-// OLD-SAME: "-emit-obj"
-// OLD-SAME: "-fcuda-is-device"
-// OLD-SAME: "-fvisibility=hidden" "-fapply-global-visibility-to-externs"
-// OLD-SAME: "-fgpu-rdc"
-// OLD-SAME: {{.*}} "-o" [[A_BC1:".*o"]] "-x" "hip"
-// OLD-SAME: {{.*}} [[A_SRC]]
-
-// OLD: [[CLANG]] "-cc1" "-triple" "spirv64"
-// OLD-SAME: "-aux-triple" "x86_64-unknown-linux-gnu"
-// OLD-SAME: "-emit-obj"
-// OLD-SAME: "-fcuda-is-device"
-// OLD-SAME: "-fvisibility=hidden" "-fapply-global-visibility-to-externs"
-// OLD-SAME: "-fgpu-rdc"
-// OLD-SAME: {{.*}} "-o" [[B_BC1:".*o"]] "-x" "hip"
-// OLD-SAME: {{.*}} [[B_SRC]]
-
-// Link device code, lower it with HIPSPV passes and emit SPIR-V binary.
-// OLD: {{".*llvm-link.*"}} "-o" [[AB_LINK:".*bc"]] [[A_BC1]] [[B_BC1]]
-// OLD: {{".*opt.*"}} [[AB_LINK]] "-load-pass-plugin"
-// OLD-SAME: "{{.*}}/Inputs/hipspv/lib/libLLVMHipSpvPasses.so"
-// OLD-SAME: "-o" [[AB_LOWER:".*bc"]]
-// OLD: {{".*llvm-spirv"}} "--spirv-max-version=1.1" "--spirv-ext=+all"
-// OLD-SAME: [[AB_LOWER]] "-o" "[[AB_SPIRV:.*out]]"
-
-// Construct fat binary object.
-// OLD: [[BUNDLER:".*clang-offload-bundler"]] "-type=o" "-bundle-align=4096"
-// OLD-SAME: "-targets={{.*}},hip-spirv64----generic"
-// OLD-SAME: "-input=/dev/null" "-input=[[AB_SPIRV]]"
-// OLD-SAME: "-output=[[AB_FATBIN:.*hipfb]]"
-// OLD: {{".*clang.*"}} "-o" [[OBJBUNDLE:".*o"]] "{{.*}}.mcin"
-
-// Output the executable
-// OLD: {{".*ld.*"}} {{.*}}"-o" "a.out" {{.*}} [[A_OBJ_HOST]] [[B_OBJ_HOST]]
-// OLD-SAME: [[OBJBUNDLE]]
-
// NEW: [[CLANG:".*clang[^ ]*"]] "-cc1" "-triple" "[[OFFLOAD_TRIPLE]]"
// NEW-SAME: "-aux-triple" "[[HOST_TRIPLE:[^ ]*]]"
// NEW-SAME: "-emit-llvm-bc"
diff --git a/clang/test/Driver/hipspv-toolchain.hip b/clang/test/Driver/hipspv-toolchain.hip
index 64d5d22a11d39..9d39f23d63b83 100644
--- a/clang/test/Driver/hipspv-toolchain.hip
+++ b/clang/test/Driver/hipspv-toolchain.hip
@@ -1,14 +1,9 @@
// REQUIRES: spirv-registered-target
// UNSUPPORTED: system-windows, system-cygwin
-// RUN: %clang -### -target x86_64-linux-gnu --offload=spirv64 \
-// RUN: --no-offload-new-driver --hip-path=%S/Inputs/hipspv -nohipwrapperinc %s \
-// RUN: 2>&1 | FileCheck --check-prefixes=CHECK,OLD \
-// RUN: -DTRIPLE=spirv64 %s
-
// RUN: %clang -### -target x86_64-linux-gnu \
// RUN: --offload=spirv64-unknown-chipstar \
-// RUN: --offload-new-driver --hip-path=%S/Inputs/hipspv -nohipwrapperinc %s \
+// RUN: --hip-path=%S/Inputs/hipspv -nohipwrapperinc %s \
// RUN: 2>&1 | FileCheck --check-prefixes=CHECK,NEW \
// RUN: -DTRIPLE=spirv64-unknown-chipstar -DHIP_PATH=%S/Inputs/hipspv %s
@@ -21,19 +16,6 @@
// CHECK-SAME: "-o" "[[OBJ_DEV:.*(o|bc)]]"
// CHECK-SAME: "-x" "hip"
-// OLD: {{".*llvm-link"}} "-o" [[LINK_BC:".*bc"]] "[[OBJ_DEV]]"
-
-// OLD: {{".*opt"}} [[LINK_BC]] "-load-pass-plugin"
-// OLD-SAME: {{".*/hipspv/lib/libLLVMHipSpvPasses.so"}}
-// OLD-SAME: "-passes=hip-post-link-passes" "-o" [[LOWER_BC:".*bc"]]
-
-// OLD: {{".*llvm-spirv"}} "--spirv-max-version=1.1" "--spirv-ext=+all"
-// OLD-SAME: [[LOWER_BC]] "-o" "[[SPIRV_OUT:.*out]]"
-
-// OLD: {{".*clang-offload-bundler"}} "-type=o" "-bundle-align=4096"
-// OLD-SAME: "-targets=host-x86_64-unknown-linux-gnu,hip-spirv64----generic"
-// OLD-SAME: "-input={{.*}}" "-input=[[SPIRV_OUT]]" "-output=[[BUNDLE:.*hipfb]]"
-
// NEW: {{".*llvm-offload-binary"}} "-o" "[[PACKAGE:.*.out]]"
// NEW-SAME: "--image=file=[[OBJ_DEV]],triple=[[TRIPLE]],arch=generic,kind=hip"
@@ -46,8 +28,6 @@
// CHECK-SAME: "-fcuda-include-gpubinary" "[[BUNDLE]]"
// CHECK-SAME: "-o" [[OBJ_HOST:".*o"]] "-x" "hip"
-// OLD: {{".*ld.*"}} {{.*}}[[OBJ_HOST]]
-
// NEW: {{".*clang-linker-wrapper"}}
// NEW-SAME: "--linker-path={{.*ld.*}}" "-o" "a.out"
// NEW-SAME: [[OBJ_HOST]]
@@ -117,12 +97,6 @@
// RUN: mkdir -p %t/versioned
// RUN: touch %t/versioned/llvm-spirv-%llvm-version-major \
// RUN: && chmod +x %t/versioned/llvm-spirv-%llvm-version-major
-// RUN: env "PATH=%t/versioned" %clang -### -target x86_64-linux-gnu \
-// RUN: --offload=spirv64 --hip-path=%S/Inputs/hipspv -nohipwrapperinc \
-// RUN: --no-offload-new-driver %s 2>&1 \
-// RUN: | FileCheck -DVERSION=%llvm-version-major \
-// RUN: --check-prefix=VERSIONED %s
-
// RUN: env "PATH=%t/versioned" %clang -### --no-default-config \
// RUN: -o %t.dummy.img --target=spirv64-unknown-chipstar %t.dummy.o \
// RUN: --hip-path="%S/Inputs/hipspv" -o /dev/null 2>&1 \
diff --git a/clang/test/Driver/lto.cu b/clang/test/Driver/lto.cu
deleted file mode 100644
index 596e6cfe07379..0000000000000
--- a/clang/test/Driver/lto.cu
+++ /dev/null
@@ -1,71 +0,0 @@
-// -flto causes a switch to llvm-bc object files.
-// RUN: %clangxx --target=x86_64-unknown-linux-gnu --no-offload-new-driver -nocudainc -nocudalib -ccc-print-phases -c %s -flto 2> %t
-// RUN: FileCheck -check-prefix=CHECK-COMPILE-ACTIONS < %t %s
-//
-// CHECK-COMPILE-ACTIONS: 2: compiler, {1}, ir, (host-cuda)
-// CHECK-COMPILE-ACTIONS-NOT: lto-bc
-// CHECK-COMPILE-ACTIONS: 12: backend, {11}, lto-bc, (host-cuda)
-
-// RUN: %clangxx --target=x86_64-unknown-linux-gnu --no-offload-new-driver -nocudainc -nocudalib -ccc-print-phases %s -flto 2> %t
-// RUN: FileCheck -check-prefix=CHECK-COMPILELINK-ACTIONS < %t %s
-//
-// CHECK-COMPILELINK-ACTIONS: 0: input, "{{.*}}lto.cu", cuda, (host-cuda)
-// CHECK-COMPILELINK-ACTIONS: 1: preprocessor, {0}, cuda-cpp-output
-// CHECK-COMPILELINK-ACTIONS: 2: compiler, {1}, ir, (host-cuda)
-// CHECK-COMPILELINK-ACTIONS: 3: input, "{{.*}}lto.cu", cuda, (device-cuda, sm_{{.*}})
-// CHECK-COMPILELINK-ACTIONS: 4: preprocessor, {3}, cuda-cpp-output, (device-cuda, sm_{{.*}})
-// CHECK-COMPILELINK-ACTIONS: 5: compiler, {4}, ir, (device-cuda, sm_{{.*}})
-// CHECK-COMPILELINK-ACTIONS: 6: backend, {5}, assembler, (device-cuda, sm_{{.*}})
-// CHECK-COMPILELINK-ACTIONS: 7: assembler, {6}, object, (device-cuda, sm_{{.*}})
-// CHECK-COMPILELINK-ACTIONS: 8: offload, "device-cuda (nvptx{{.*}}-nvidia-cuda:sm_{{.*}})" {7}, object
-// CHECK-COMPILELINK-ACTIONS: 9: offload, "device-cuda (nvptx{{.*}}-nvidia-cuda:sm_{{.*}})" {6}, assembler
-// CHECK-COMPILELINK-ACTIONS: 10: linker, {8, 9}, cuda-fatbin, (device-cuda)
-// CHECK-COMPILELINK-ACTIONS: 11: offload, "host-cuda {{.*}}" {2}, "device-cuda{{.*}}" {10}, ir
-// CHECK-COMPILELINK-ACTIONS: 12: backend, {11}, lto-bc, (host-cuda)
-// CHECK-COMPILELINK-ACTIONS: 13: linker, {12}, image, (host-cuda)
-
-// llvm-bc and llvm-ll outputs need to match regular suffixes
-// (unfortunately).
-// RUN: %clangxx %s --target=x86_64-unknown-linux-gnu --no-offload-new-driver -nocudainc -nocudalib -flto -save-temps --cuda-path=%S/Inputs/CUDA_80/usr/local/cuda -### 2> %t
-// RUN: FileCheck -check-prefix=CHECK-COMPILELINK-SUFFIXES < %t %s
-//
-// CHECK-COMPILELINK-SUFFIXES: "-o" "[[CPP:.*lto-host.*\.cui]]" "-x" "cuda" "{{.*}}lto.cu"
-// CHECK-COMPILELINK-SUFFIXES: "-o" "[[BC:.*lto-host.*\.bc]]" {{.*}}[[CPP]]"
-// CHECK-COMPILELINK-SUFFIXES: "-o" "[[OBJ:.*lto-host.*\.o]]" {{.*}}[[BC]]"
-// CHECK-COMPILELINK-SUFFIXES: "{{.*}}a.{{(out|exe)}}" {{.*}}[[OBJ]]"
-
-// RUN: %clangxx --target=x86_64-unknown-linux-gnu %s --no-offload-new-driver -nocudainc -nocudalib -flto -S -### 2> %t
-// RUN: FileCheck -check-prefix=CHECK-COMPILE-SUFFIXES < %t %s
-//
-// CHECK-COMPILE-SUFFIXES: "-o" "{{.*}}lto.s" "-x" "cuda" "{{.*}}lto.cu"
-
-// RUN: not %clangxx --target=x86_64-unknown-linux-gnu --no-offload-new-driver -nocudainc -nocudalib %s -emit-llvm 2>&1 \
-// RUN: | FileCheck --check-prefix=LLVM-LINK %s
-// LLVM-LINK: -emit-llvm cannot be used when linking
-
-/// With ld.bfd or gold, link against LLVMgold.
-// RUN: %clangxx -nocudainc -nocudalib --target=x86_64-unknown-linux-gnu --offload-arch=sm_52 --sysroot=%S/Inputs/basic_cross_linux_tree %s \
-// RUN: --no-offload-new-driver -fuse-ld=bfd -flto=thin -### 2>&1 | FileCheck --check-prefix=LLVMGOLD %s
-// RUN: %clangxx -nocudainc -nocudalib --target=x86_64-unknown-linux-gnu --offload-arch=sm_52 --sysroot=%S/Inputs/basic_cross_linux_tree %s \
-// RUN: --no-offload-new-driver -fuse-ld=gold -flto=full -### 2>&1 | FileCheck --check-prefix=LLVMGOLD %s
-//
-// LLVMGOLD: "-plugin" "{{.*}}{{[/\\]}}LLVMgold.{{dll|dylib|so}}"
-
-/// lld does not need LLVMgold.
-// RUN: %clangxx -nocudainc -nocudalib --target=x86_64-unknown-linux-gnu --offload-arch=sm_52 --sysroot=%S/Inputs/basic_cross_linux_tree %s \
-// RUN: --no-offload-new-driver -fuse-ld=lld -flto=full -### 2>&1 | FileCheck --check-prefix=NO-LLVMGOLD %s
-// RUN: %clangxx -nocudainc -nocudalib --target=x86_64-unknown-linux-gnu --offload-arch=sm_52 --sysroot=%S/Inputs/basic_cross_linux_tree %s \
-// RUN: --no-offload-new-driver -fuse-ld=gold -flto=full -fno-lto -### 2>&1 | FileCheck --check-prefix=NO-LLVMGOLD %s
-//
-// NO-LLVMGOLD-NOT: "-plugin" "{{.*}}{{[/\\]}}LLVMgold.{{dll|dylib|so}}"
-
-// -flto passes along an explicit debugger tuning argument.
-// RUN: %clangxx -nocudainc -nocudalib --no-offload-new-driver \
-// RUN: --target=x86_64-unknown-linux -### %s -flto -glldb --offload-arch=sm_52 --cuda-path=%S/Inputs/CUDA_80/usr/local/cuda 2> %t
-// RUN: FileCheck -check-prefix=CHECK-TUNING-LLDB < %t %s
-// RUN: %clangxx -nocudainc -nocudalib --no-offload-new-driver \
-// RUN: --target=x86_64-unknown-linux -### %s -flto -g --offload-arch=sm_52 --cuda-path=%S/Inputs/CUDA_80/usr/local/cuda 2> %t
-// RUN: FileCheck -check-prefix=CHECK-NO-TUNING < %t %s
-//
-// CHECK-TUNING-LLDB: "-plugin-opt=-debugger-tune=lldb"
-// CHECK-NO-TUNING-NOT: "-plugin-opt=-debugger-tune
diff --git a/clang/test/Driver/nvptx-cuda-system-arch.c b/clang/test/Driver/nvptx-cuda-system-arch.c
index 675d15bf22cc0..dd6c064627210 100644
--- a/clang/test/Driver/nvptx-cuda-system-arch.c
+++ b/clang/test/Driver/nvptx-cuda-system-arch.c
@@ -14,22 +14,16 @@
// case when nvptx-arch returns nothing or fails
// RUN: not %clang -### --target=x86_64-unknown-linux-gnu -nogpulib --offload-arch=native --nvptx-arch-tool=%t/nvptx_arch_fail -x cuda %s 2>&1 \
// RUN: | FileCheck %s --check-prefix=NO-OUTPUT-ERROR
-// RUN: not %clang -### --target=x86_64-unknown-linux-gnu -nogpulib --offload-new-driver --offload-arch=native --nvptx-arch-tool=%t/nvptx_arch_fail -x cuda %s 2>&1 \
-// RUN: | FileCheck %s --check-prefix=NO-OUTPUT-ERROR
// NO-OUTPUT-ERROR: error: cannot determine cuda architecture{{.*}}; consider passing it via '--offload-arch'
// case when nvptx-arch does not return anything with successful execution
// RUN: not %clang -### --target=x86_64-unknown-linux-gnu -nogpulib --offload-arch=native --nvptx-arch-tool=%t/nvptx_arch_empty -x cuda %s 2>&1 \
// RUN: | FileCheck %s --check-prefix=EMPTY-OUTPUT
-// RUN: not %clang -### --target=x86_64-unknown-linux-gnu -nogpulib --offload-new-driver --offload-arch=native --nvptx-arch-tool=%t/nvptx_arch_empty -x cuda %s 2>&1 \
-// RUN: | FileCheck %s --check-prefix=EMPTY-OUTPUT
// EMPTY-OUTPUT: error: cannot determine cuda architecture: No GPU detected in the system; consider passing it via '--offload-arch'
// case when nvptx-arch does not return anything with successful execution
// RUN: %clang -### --target=x86_64-unknown-linux-gnu -nogpulib --offload-arch=native --nvptx-arch-tool=%t/nvptx_arch_sm_70 -x cuda --cuda-path=%S/Inputs/CUDA_102/usr/local/cuda %s 2>&1 \
// RUN: | FileCheck %s --check-prefix=ARCH-sm_70
-// RUN: %clang -### --target=x86_64-unknown-linux-gnu -nogpulib --offload-arch=native --offload-new-driver --nvptx-arch-tool=%t/nvptx_arch_sm_70 -x cuda --cuda-path=%S/Inputs/CUDA_102/usr/local/cuda %s 2>&1 \
-// RUN: | FileCheck %s --check-prefix=ARCH-sm_70
// ARCH-sm_70: "-cc1" "-triple" "nvptx64-nvidia-cuda"{{.*}}"-target-cpu" "sm_70"
// case when nvptx-arch is used via '-march=native'
diff --git a/clang/test/Driver/offload-new-driver-deprecated.c b/clang/test/Driver/offload-new-driver-deprecated.c
new file mode 100644
index 0000000000000..2d5da4222b0fc
--- /dev/null
+++ b/clang/test/Driver/offload-new-driver-deprecated.c
@@ -0,0 +1,21 @@
+// Verify that the legacy offloading driver toggles are accepted as no-ops and
+// that '--no-offload-new-driver' emits a single deprecation warning.
+
+// RUN: %clang -### --target=x86_64-linux-gnu --no-offload-new-driver -c %s 2>&1 \
+// RUN: | FileCheck --check-prefix=WARN %s
+// WARN: warning: argument '--no-offload-new-driver' is deprecated, the legacy offloading driver has been removed
+// WARN-NOT: warning: argument '--no-offload-new-driver' is deprecated
+
+// Passing the flag more than once still only warns once.
+// RUN: %clang -### --target=x86_64-linux-gnu --no-offload-new-driver \
+// RUN: --no-offload-new-driver -c %s 2>&1 | FileCheck --check-prefix=WARN %s
+
+// The legacy alias behaves the same way.
+// RUN: %clang -### --target=x86_64-linux-gnu -fno-openmp-new-driver -c %s 2>&1 \
+// RUN: | FileCheck --check-prefix=ALIAS %s
+// ALIAS: warning: argument '-fno-openmp-new-driver' is deprecated, the legacy offloading driver has been removed
+
+// The affirmative toggle is silently accepted.
+// RUN: %clang -### --target=x86_64-linux-gnu --offload-new-driver -c %s 2>&1 \
+// RUN: | FileCheck --check-prefix=QUIET %s
+// QUIET-NOT: warning:
diff --git a/clang/test/Driver/sycl-offload-jit.cpp b/clang/test/Driver/sycl-offload-jit.cpp
index c8eff1a4dd28f..83118b70a62e6 100644
--- a/clang/test/Driver/sycl-offload-jit.cpp
+++ b/clang/test/Driver/sycl-offload-jit.cpp
@@ -88,6 +88,6 @@
/// Check for option incompatibility with -fsycl
// RUN: not %clang -### -fsycl -ffreestanding %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHK-INCOMPATIBILITY %s -DINCOMPATOPT=-ffreestanding
-// RUN: not %clang -### -fsycl --offload-new-driver -static-libstdc++ %s 2>&1 \
+// RUN: not %clang -### -fsycl -static-libstdc++ %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHK-INCOMPATIBILITY %s -DINCOMPATOPT=-static-libstdc++
// CHK-INCOMPATIBILITY: error: invalid argument '[[INCOMPATOPT]]' not allowed with '-fsycl'
diff --git a/clang/test/Driver/thinlto.cu b/clang/test/Driver/thinlto.cu
deleted file mode 100644
index 604a872786f70..0000000000000
--- a/clang/test/Driver/thinlto.cu
+++ /dev/null
@@ -1,25 +0,0 @@
-// -flto=thin causes a switch to llvm-bc object files.
-// RUN: %clangxx -ccc-print-phases --no-offload-new-driver -nocudainc -nocudalib -c %s -flto=thin 2> %t
-// RUN: FileCheck -check-prefix=CHECK-COMPILE-ACTIONS < %t %s
-//
-// CHECK-COMPILE-ACTIONS: 2: compiler, {1}, ir, (host-cuda)
-// CHECK-COMPILE-ACTIONS-NOT: lto-bc
-// CHECK-COMPILE-ACTIONS: 12: backend, {11}, lto-bc, (host-cuda)
-
-// RUN: %clangxx -ccc-print-phases %if target={{.*-windows-msvc.*}} %{ -fuse-ld=lld %} --no-offload-new-driver -nocudainc -nocudalib %s -flto=thin 2> %t
-// RUN: FileCheck -check-prefix=CHECK-COMPILELINK-ACTIONS < %t %s
-//
-// CHECK-COMPILELINK-ACTIONS: 0: input, "{{.*}}thinlto.cu", cuda, (host-cuda)
-// CHECK-COMPILELINK-ACTIONS: 1: preprocessor, {0}, cuda-cpp-output
-// CHECK-COMPILELINK-ACTIONS: 2: compiler, {1}, ir, (host-cuda)
-// CHECK-COMPILELINK-ACTIONS: 3: input, "{{.*}}thinlto.cu", cuda, (device-cuda, sm_{{.*}})
-// CHECK-COMPILELINK-ACTIONS: 4: preprocessor, {3}, cuda-cpp-output, (device-cuda, sm_{{.*}})
-// CHECK-COMPILELINK-ACTIONS: 5: compiler, {4}, ir, (device-cuda, sm_{{.*}})
-// CHECK-COMPILELINK-ACTIONS: 6: backend, {5}, assembler, (device-cuda, sm_{{.*}})
-// CHECK-COMPILELINK-ACTIONS: 7: assembler, {6}, object, (device-cuda, sm_{{.*}})
-// CHECK-COMPILELINK-ACTIONS: 8: offload, "device-cuda (nvptx{{.*}}-nvidia-cuda:sm_{{.*}})" {7}, object
-// CHECK-COMPILELINK-ACTIONS: 9: offload, "device-cuda (nvptx{{.*}}-nvidia-cuda:sm_{{.*}})" {6}, assembler
-// CHECK-COMPILELINK-ACTIONS: 10: linker, {8, 9}, cuda-fatbin, (device-cuda)
-// CHECK-COMPILELINK-ACTIONS: 11: offload, "host-cuda {{.*}}" {2}, "device-cuda{{.*}}" {10}, ir
-// CHECK-COMPILELINK-ACTIONS: 12: backend, {11}, lto-bc, (host-cuda)
-// CHECK-COMPILELINK-ACTIONS: 13: linker, {12}, image, (host-cuda)
diff --git a/clang/test/OpenMP/openmp_offload_weak_vtables.cpp b/clang/test/OpenMP/openmp_offload_weak_vtables.cpp
index 283c7f6fd8f88..66895a695582d 100644
--- a/clang/test/OpenMP/openmp_offload_weak_vtables.cpp
+++ b/clang/test/OpenMP/openmp_offload_weak_vtables.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -aux-triple amdgcn-amd-amdhsa -emit-llvm -disable-free -clear-ast-before-backend -main-file-name bigscience.i -mrelocation-model static -mframe-pointer=all -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -debug-info-kind=constructor -dwarf-version=5 -debugger-tuning=gdb -Wno-openmp-mapping -fdeprecated-macro -ferror-limit 19 -fmessage-length=190 -fopenmp --offload-new-driver -fgnuc-version=4.2.1 -fskip-odr-check-in-gmf -fcxx-exceptions -fexceptions -fcolor-diagnostics --offload-targets=amdgcn-amd-amdhsa -faddrsig -fdwarf2-cfi-asm -o - -x c++-cpp-output %s | FileCheck %s
+// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -aux-triple amdgcn-amd-amdhsa -emit-llvm -disable-free -clear-ast-before-backend -main-file-name bigscience.i -mrelocation-model static -mframe-pointer=all -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -debug-info-kind=constructor -dwarf-version=5 -debugger-tuning=gdb -Wno-openmp-mapping -fdeprecated-macro -ferror-limit 19 -fmessage-length=190 -fopenmp -fgnuc-version=4.2.1 -fskip-odr-check-in-gmf -fcxx-exceptions -fexceptions -fcolor-diagnostics --offload-targets=amdgcn-amd-amdhsa -faddrsig -fdwarf2-cfi-asm -o - -x c++-cpp-output %s | FileCheck %s
// CHECK: weak_odr
class Science
diff --git a/clang/unittests/Tooling/ToolingTest.cpp b/clang/unittests/Tooling/ToolingTest.cpp
index 9b638c2d6c4ee..11a5491dd35fb 100644
--- a/clang/unittests/Tooling/ToolingTest.cpp
+++ b/clang/unittests/Tooling/ToolingTest.cpp
@@ -459,9 +459,9 @@ TEST_F(CommandLineExtractorTest, AcceptOffloadingCompile) {
TEST_F(CommandLineExtractorTest, AcceptOffloadingSyntaxOnly) {
addFile("test.c", "int main() {}\n");
const char *Args[] = {
- "clang", "-target", "arm64-apple-macosx11.0.0", "-fsyntax-only",
- "-x", "hip", "--no-offload-new-driver", "test.c",
- "-nogpulib", "-nogpuinc"};
+ "clang", "-target", "arm64-apple-macosx11.0.0",
+ "-fsyntax-only", "-x", "hip",
+ "test.c", "-nogpulib", "-nogpuinc"};
EXPECT_NE(extractCC1Arguments(Args), nullptr);
}
diff --git a/libc/docs/gpu/using.rst b/libc/docs/gpu/using.rst
index 856bdea170a9a..7e831b973499a 100644
--- a/libc/docs/gpu/using.rst
+++ b/libc/docs/gpu/using.rst
@@ -27,8 +27,8 @@ file for both the host target and a list of offloading devices. In order to
support standard compilation flows, the ``clang`` driver uses fat binaries,
described in the `clang documentation
<https://clang.llvm.org/docs/OffloadingDesign.html>`_. This linking mode is used
-by the OpenMP toolchain, but is currently opt-in for the CUDA and HIP toolchains
-through the ``--offload-new-driver``` and ``-fgpu-rdc`` flags.
+by the OpenMP toolchain, and is used for the CUDA and HIP toolchains when
+compiling with the ``-fgpu-rdc`` flag.
In order to link the GPU runtime, we simply pass this library to the embedded
device linker job. This can be done using the ``-Xoffload-linker`` option, which
@@ -39,8 +39,8 @@ this shouldn't be necessary.
.. code-block:: sh
$> clang openmp.c -fopenmp --offload-arch=gfx90a -Xoffload-linker -lc
- $> clang cuda.cu --offload-arch=sm_80 --offload-new-driver -fgpu-rdc -Xoffload-linker -lc
- $> clang hip.hip --offload-arch=gfx942 --offload-new-driver -fgpu-rdc -Xoffload-linker -lc
+ $> clang cuda.cu --offload-arch=sm_80 -fgpu-rdc -Xoffload-linker -lc
+ $> clang hip.hip --offload-arch=gfx942 -fgpu-rdc -Xoffload-linker -lc
This will automatically link in the needed function definitions if they were
required by the user's application. Normally using the ``-fgpu-rdc`` option
diff --git a/openmp/docs/CommandLineArgumentReference.rst b/openmp/docs/CommandLineArgumentReference.rst
index 8c50482ca8e08..06d568263d868 100644
--- a/openmp/docs/CommandLineArgumentReference.rst
+++ b/openmp/docs/CommandLineArgumentReference.rst
@@ -166,8 +166,8 @@ The debugging instructions list the supported debugging arguments.
``--offload-new-driver``
^^^^^^^^^^^^^^^^^^^^^^^^
-In upstream LLVM, OpenMP only uses the new driver. However, enabling this
-option for experimental linking with CUDA or HIP files is necessary.
+Deprecated and accepted as a no-op. The new offloading driver is always used for
+offloading compilation; the legacy driver has been removed.
``--offload-link``
^^^^^^^^^^^^^^^^^^
diff --git a/openmp/docs/SupportAndFAQ.rst b/openmp/docs/SupportAndFAQ.rst
index 952de1185f846..3ee7a75dc3d2e 100644
--- a/openmp/docs/SupportAndFAQ.rst
+++ b/openmp/docs/SupportAndFAQ.rst
@@ -259,15 +259,13 @@ However, the global state will be distinct between the two images at runtime.
This means any global variables will potentially have different values when
queried from OpenMP or CUDA.
-Linking CUDA and HIP currently requires enabling a different compilation mode
-for CUDA / HIP with ``--offload-new-driver`` and to link using
-``--offload-link``. Additionally, ``-fgpu-rdc`` must be used to create a
-linkable device image.
+Linking CUDA and HIP currently requires linking using ``--offload-link``.
+Additionally, ``-fgpu-rdc`` must be used to create a linkable device image.
.. code-block:: shell
clang++ openmp.cpp -fopenmp --offload-arch=sm_80 -c
- clang++ cuda.cu --offload-new-driver --offload-arch=sm_80 -fgpu-rdc -c
+ clang++ cuda.cu --offload-arch=sm_80 -fgpu-rdc -c
clang++ openmp.o cuda.o --offload-link -o app
Q: Are libomptarget and plugins backward compatible?
More information about the cfe-commits
mailing list