Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions clang/lib/Driver/Driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4384,15 +4384,9 @@ void Driver::BuildActions(Compilation &C, DerivedArgList &Args,
void Driver::BuildDefaultActions(Compilation &C, DerivedArgList &Args,
const InputList &Inputs,
ActionList &Actions) const {

bool UseNewOffloadingDriver =
C.isOffloadingHostKind(Action::OFK_OpenMP) ||
C.isOffloadingHostKind(Action::OFK_SYCL) ||
Args.hasFlag(options::OPT_foffload_via_llvm,
options::OPT_fno_offload_via_llvm, false) ||
Args.hasFlag(options::OPT_offload_new_driver,
options::OPT_no_offload_new_driver,
C.isOffloadingHostKind(Action::OFK_Cuda));
bool UseNewOffloadingDriver = Args.hasFlag(
options::OPT_offload_new_driver, options::OPT_no_offload_new_driver,
C.getActiveOffloadKinds() != Action::OFK_None);

bool HIPNoRDC =
C.isOffloadingHostKind(Action::OFK_HIP) &&
Expand Down Expand Up @@ -5017,8 +5011,8 @@ Action *Driver::BuildOffloadingActions(Compilation &C,
bool ShouldBundleHIP =
Args.hasFlag(options::OPT_gpu_bundle_output,
options::OPT_no_gpu_bundle_output, false) ||
(HIPNoRDC && offloadDeviceOnly() &&
llvm::none_of(OffloadActions, [](Action *A) {
(!Args.getLastArg(options::OPT_no_gpu_bundle_output) && HIPNoRDC &&
offloadDeviceOnly() && llvm::none_of(OffloadActions, [](Action *A) {
return A->getType() != types::TY_Image;
}));

Expand Down Expand Up @@ -5191,8 +5185,13 @@ Action *Driver::ConstructPhaseAction(
Args.hasArg(options::OPT_S) ? types::TY_LTO_IR : types::TY_LTO_BC;
return C.MakeAction<BackendJobAction>(Input, Output);
}

bool IsAMDGCNSPIRV = Input->getOffloadingToolChain() &&
Input->getOffloadingToolChain()->getTriple().getOS() ==
llvm::Triple::OSType::AMDHSA &&
Input->getOffloadingToolChain()->getTriple().isSPIRV();
if (Args.hasArg(options::OPT_emit_llvm) ||
TargetDeviceOffloadKind == Action::OFK_SYCL ||
TargetDeviceOffloadKind == Action::OFK_SYCL || IsAMDGCNSPIRV ||
(((Input->getOffloadingToolChain() &&
Input->getOffloadingToolChain()->getTriple().isAMDGPU()) ||
TargetDeviceOffloadKind == Action::OFK_HIP) &&
Expand All @@ -5212,7 +5211,8 @@ Action *Driver::ConstructPhaseAction(
(TargetDeviceOffloadKind == Action::OFK_HIP &&
!Args.hasFlag(options::OPT_offload_new_driver,
options::OPT_no_offload_new_driver,
C.isOffloadingHostKind(Action::OFK_Cuda))))
C.getActiveOffloadKinds() !=
Action::OFK_None)))
? types::TY_LLVM_IR
: types::TY_LLVM_BC;
return C.MakeAction<BackendJobAction>(Input, Output);
Expand Down
7 changes: 4 additions & 3 deletions clang/lib/Driver/ToolChains/Clang.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4864,7 +4864,7 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
(JA.isHostOffloading(C.getActiveOffloadKinds()) &&
Args.hasFlag(options::OPT_offload_new_driver,
options::OPT_no_offload_new_driver,
C.isOffloadingHostKind(Action::OFK_Cuda)));
C.getActiveOffloadKinds() != Action::OFK_None));

bool IsRDCMode =
Args.hasFlag(options::OPT_fgpu_rdc, options::OPT_fno_gpu_rdc, false);
Expand Down Expand Up @@ -5229,7 +5229,7 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
if (IsDeviceOffloadAction && !JA.isDeviceOffloading(Action::OFK_OpenMP) &&
!Args.hasFlag(options::OPT_offload_new_driver,
options::OPT_no_offload_new_driver,
C.isOffloadingHostKind(Action::OFK_Cuda)) &&
C.getActiveOffloadKinds() != Action::OFK_None) &&
!Triple.isAMDGPU()) {
D.Diag(diag::err_drv_unsupported_opt_for_target)
<< Args.getLastArg(options::OPT_foffload_lto,
Expand Down Expand Up @@ -6704,7 +6704,7 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
CmdArgs.append({"--offload-new-driver", "-foffload-via-llvm"});
} else if (Args.hasFlag(options::OPT_offload_new_driver,
options::OPT_no_offload_new_driver,
C.isOffloadingHostKind(Action::OFK_Cuda))) {
C.getActiveOffloadKinds() != Action::OFK_None)) {
CmdArgs.push_back("--offload-new-driver");
}

Expand Down Expand Up @@ -9101,6 +9101,7 @@ void LinkerWrapper::ConstructJob(Compilation &C, const JobAction &JA,
OPT_fno_lto,
OPT_flto,
OPT_flto_partitions_EQ,
OPT_hipspv_pass_plugin_EQ,
OPT_flto_EQ};
const llvm::DenseSet<unsigned> LinkerOptions{OPT_mllvm, OPT_Zlinker_input};
auto ShouldForwardForToolChain = [&](Arg *A, const ToolChain &TC) {
Expand Down
4 changes: 3 additions & 1 deletion clang/lib/Driver/ToolChains/Darwin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,9 @@ void darwin::Linker::ConstructJob(Compilation &C, const JobAction &JA,
const InputInfoList &Inputs,
const ArgList &Args,
const char *LinkingOutput) const {
assert(Output.getType() == types::TY_Image && "Invalid linker output type.");
assert((Output.getType() == types::TY_Image ||
Output.getType() == types::TY_Object) &&
"Invalid linker output type.");

// If the number of arguments surpasses the system limits, we will encode the
// input files in a separate file, shortening the command line. To this end,
Expand Down
5 changes: 2 additions & 3 deletions clang/test/Driver/cl-offload.cu
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,10 @@
// CUDA-SAME: "-Weverything"
// CUDA: link

// HIP: "-cc1" "-triple" "x86_64-pc-windows-msvc{{.*}}" "-aux-triple" "amdgcn-amd-amdhsa"
// HIP-SAME: "-Weverything"
// HIP: "-cc1" "-triple" "amdgcn-amd-amdhsa" "-aux-triple" "x86_64-pc-windows-msvc"
// HIP-SAME: "-Weverything"
// HIP: {{lld.* "-flavor" "gnu" "-m" "elf64_amdgpu"}}
// HIP: "-cc1" "-triple" "x86_64-pc-windows-msvc{{.*}}" "-aux-triple" "amdgcn-amd-amdhsa"
// HIP-SAME: "-Weverything"
// HIP: {{link.* "amdhip64.lib"}}

// CMake uses this option when finding packages for HIP, so
Expand Down
36 changes: 18 additions & 18 deletions clang/test/Driver/cuda-arch-translation.cu
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
// CUDA-SAME: -m64
// CUDA: fatbinary

// HIP: clang-offload-bundler
// HIP: clang-offload-packager

// SM20:--image3=kind=elf,sm=20{{.*}}
// SM21:--image3=kind=elf,sm=21{{.*}}
Expand All @@ -81,20 +81,20 @@
// SM61:--image3=kind=elf,sm=61{{.*}}
// SM62:--image3=kind=elf,sm=62{{.*}}
// SM70:--image3=kind=elf,sm=70{{.*}}
// GFX600:-targets=host-x86_64-unknown-linux-gnu,hipv4-amdgcn-amd-amdhsa--gfx600
// GFX601:-targets=host-x86_64-unknown-linux-gnu,hipv4-amdgcn-amd-amdhsa--gfx601
// GFX602:-targets=host-x86_64-unknown-linux-gnu,hipv4-amdgcn-amd-amdhsa--gfx602
// GFX700:-targets=host-x86_64-unknown-linux-gnu,hipv4-amdgcn-amd-amdhsa--gfx700
// GFX701:-targets=host-x86_64-unknown-linux-gnu,hipv4-amdgcn-amd-amdhsa--gfx701
// GFX702:-targets=host-x86_64-unknown-linux-gnu,hipv4-amdgcn-amd-amdhsa--gfx702
// GFX703:-targets=host-x86_64-unknown-linux-gnu,hipv4-amdgcn-amd-amdhsa--gfx703
// GFX704:-targets=host-x86_64-unknown-linux-gnu,hipv4-amdgcn-amd-amdhsa--gfx704
// GFX705:-targets=host-x86_64-unknown-linux-gnu,hipv4-amdgcn-amd-amdhsa--gfx705
// GFX801:-targets=host-x86_64-unknown-linux-gnu,hipv4-amdgcn-amd-amdhsa--gfx801
// GFX802:-targets=host-x86_64-unknown-linux-gnu,hipv4-amdgcn-amd-amdhsa--gfx802
// GFX803:-targets=host-x86_64-unknown-linux-gnu,hipv4-amdgcn-amd-amdhsa--gfx803
// GFX805:-targets=host-x86_64-unknown-linux-gnu,hipv4-amdgcn-amd-amdhsa--gfx805
// GFX810:-targets=host-x86_64-unknown-linux-gnu,hipv4-amdgcn-amd-amdhsa--gfx810
// GFX900:-targets=host-x86_64-unknown-linux-gnu,hipv4-amdgcn-amd-amdhsa--gfx900
// GFX902:-targets=host-x86_64-unknown-linux-gnu,hipv4-amdgcn-amd-amdhsa--gfx902
// SPIRV:-targets=host-x86_64-unknown-linux-gnu,hip-spirv64-amd-amdhsa--amdgcnspirv
// GFX600:triple=amdgcn-amd-amdhsa,arch=gfx600
// GFX601:triple=amdgcn-amd-amdhsa,arch=gfx601
// GFX602:triple=amdgcn-amd-amdhsa,arch=gfx602
// GFX700:triple=amdgcn-amd-amdhsa,arch=gfx700
// GFX701:triple=amdgcn-amd-amdhsa,arch=gfx701
// GFX702:triple=amdgcn-amd-amdhsa,arch=gfx702
// GFX703:triple=amdgcn-amd-amdhsa,arch=gfx703
// GFX704:triple=amdgcn-amd-amdhsa,arch=gfx704
// GFX705:triple=amdgcn-amd-amdhsa,arch=gfx705
// GFX801:triple=amdgcn-amd-amdhsa,arch=gfx801
// GFX802:triple=amdgcn-amd-amdhsa,arch=gfx802
// GFX803:triple=amdgcn-amd-amdhsa,arch=gfx803
// GFX805:triple=amdgcn-amd-amdhsa,arch=gfx805
// GFX810:triple=amdgcn-amd-amdhsa,arch=gfx810
// GFX900:triple=amdgcn-amd-amdhsa,arch=gfx900
// GFX902:triple=amdgcn-amd-amdhsa,arch=gfx902
// SPIRV:triple=spirv64-amd-amdhsa,arch=amdgcnspirv
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
// RUN: %clang -### -nogpuinc -nogpulib --offload-arch=gfx1030 --offload-arch=gfx1100 --offload-arch=gfx1101 --target=x86_64-linux-gnu -MD -MF tmp.d %s 2>&1 | FileCheck %s

// CHECK-NOT: {{.*}}clang{{.*}}"-target-cpu" "gfx1030"{{.*}}"-dependency-file" "tmp.d"
// CHECK: {{.*}}lld{{.*}}"-plugin-opt=mcpu=gfx1030"
// CHECK-NOT: {{.*}}clang{{.*}}"-target-cpu" "gfx1100"{{.*}}"-dependency-file" "tmp.d"
// CHECK: {{.*}}lld{{.*}}"-plugin-opt=mcpu=gfx1100"
// CHECK-NOT: {{.*}}clang{{.*}}"-target-cpu" "gfx1101"{{.*}}"-dependency-file" "tmp.d"
// CHECK: {{.*}}lld{{.*}}"-plugin-opt=mcpu=gfx1101"
// CHECK: {{.*}}clang-offload-bundler
// CHECK: {{.*}}clang-offload-packager
// CHECK: {{.*}}clang{{.*}}"-target-cpu"{{.*}}"-dependency-file" "tmp.d"

void main(){}
5 changes: 1 addition & 4 deletions clang/test/Driver/hip-code-object-version.hip
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

// V4: "-mcode-object-version=4"
// V4: "-mllvm" "--amdhsa-code-object-version=4"
// V4: "-targets=host-x86_64-unknown-linux-gnu,hipv4-amdgcn-amd-amdhsa--gfx906"

// Check bundle ID for code object version 5.

Expand All @@ -18,7 +17,6 @@

// V5: "-mcode-object-version=5"
// V5: "-mllvm" "--amdhsa-code-object-version=5"
// V5: "-targets=host-x86_64-unknown-linux-gnu,hipv4-amdgcn-amd-amdhsa--gfx906"

// Check bundle ID for code object version 6.

Expand All @@ -29,11 +27,10 @@

// V6: "-mcode-object-version=6"
// V6: "-mllvm" "--amdhsa-code-object-version=6"
// V6: "-targets=host-x86_64-unknown-linux-gnu,hipv4-amdgcn-amd-amdhsa--gfx906"

// Check bundle ID for code object version default

// RUN: %clang -### --target=x86_64-linux-gnu \
// 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

Expand Down
7 changes: 3 additions & 4 deletions clang/test/Driver/hip-gz-options.hip
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
// REQUIRES: zlib

// RUN: %clang -### --target=x86_64-unknown-linux-gnu \
// RUN: --offload-arch=gfx906 %s -nogpulib -nogpuinc \
// RUN: --offload-arch=gfx906 %s -nogpulib -nogpuinc \
// RUN: -ggdb -gz=zlib 2>&1 | FileCheck %s

// RUN: %clang -### --target=x86_64-unknown-linux-gnu \
// RUN: -fgpu-rdc --offload-arch=gfx906 %s -nogpulib -nogpuinc \
// RUN: -ggdb -gz=zlib 2>&1 | FileCheck %s

// CHECK-DAG: {{".*clang(-[0-9]+)?(.exe)?" .* "--compress-debug-sections=zlib"}}
// CHECK-DAG: {{".*lld(.exe)?" .* "--compress-debug-sections=zlib"}}
// CHECK-DAG: {{".*clang(-[0-9]+)?(.exe)?" .* "--compress-debug-sections=zlib"}}
// CHECK-DAG: {{".*clang(-[0-9]+)?(.exe)?" .* "-triple" "amdgcn-amd-amdhsa" .* "--compress-debug-sections=zlib"}}
// CHECK-DAG: {{".*clang(-[0-9]+)?(.exe)?" .* "-triple" "x86_64-unknown-linux-gnu".* "--compress-debug-sections=zlib"}}
// CHECK: "--compress-debug-sections=zlib"
3 changes: 0 additions & 3 deletions clang/test/Driver/hip-macros.hip
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,6 @@
// RUN: %clang -E -dM --offload-arch=gfx942 --cuda-device-only -nogpuinc -nogpulib \
// RUN: %s 2>&1 | FileCheck --check-prefixes=NOPTS %s
// PTS-DAG: #define __HIP_API_PER_THREAD_DEFAULT_STREAM__ 1
// PTS-DAG: #define __HIP_API_PER_THREAD_DEFAULT_STREAM__ 1
// PTS-DAG: #define HIP_API_PER_THREAD_DEFAULT_STREAM 1
// PTS-DAG: #define HIP_API_PER_THREAD_DEFAULT_STREAM 1
// NOPTS-NOT: #define __HIP_API_PER_THREAD_DEFAULT_STREAM__
// NOPTS-NOT: #define HIP_API_PER_THREAD_DEFAULT_STREAM
Expand All @@ -89,4 +87,3 @@
// RUN: %s 2>&1 | FileCheck --check-prefix=APPROX %s
// NOAPPROX-NOT: #define __CLANG_GPU_APPROX_TRANSCENDENTALS__
// APPROX: #define __CLANG_GPU_APPROX_TRANSCENDENTALS__ 1
// APPROX: #define __CLANG_GPU_APPROX_TRANSCENDENTALS__ 1
4 changes: 2 additions & 2 deletions clang/test/Driver/hip-offload-arch.hip
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
// RUN: -nogpuinc -nogpulib \
// RUN: %s 2>&1 | FileCheck %s

// CHECK: {{"[^"]*clang[^"]*".* "-target-cpu" "gfx1030"}}
// CHECK: {{"[^"]*clang[^"]*".* "-target-cpu" "gfx1031"}}
// CHECK: "-cc1" "-triple" "amdgcn-amd-amdhsa"{{.*}}"-target-cpu" "gfx1030"
// CHECK: "-cc1" "-triple" "amdgcn-amd-amdhsa"{{.*}}"-target-cpu" "gfx1031"
11 changes: 2 additions & 9 deletions clang/test/Driver/hip-options.hip
Original file line number Diff line number Diff line change
Expand Up @@ -83,16 +83,12 @@
// RUN: --cuda-gpu-arch=gfx906 -foffload-lto=thin -fwhole-program-vtables %s 2>&1 \
// RUN: | FileCheck -check-prefix=HIPTHINLTO %s

// RUN: %clang -### --target=x86_64-unknown-linux-gnu -nogpuinc -nogpulib \
// RUN: --cuda-gpu-arch=gfx906 -fgpu-rdc -foffload-lto=thin -fwhole-program-vtables %s 2>&1 \
// RUN: | FileCheck -check-prefix=HIPTHINLTO %s

// Ensure we don't error about -fwhole-program-vtables for the non-device offload compile.
// HIPTHINLTO-NOT: error: invalid argument '-fwhole-program-vtables' only allowed with '-flto'
// HIPTHINLTO-NOT: "-cc1"{{.*}} "-triple" "x86_64-unknown-linux-gnu" {{.*}} "-flto-unit"
// HIPTHINLTO: "-cc1"{{.*}} "-triple" "amdgcn-amd-amdhsa" {{.*}} "-flto=thin" "-flto-unit" {{.*}} "-fwhole-program-vtables"
// HIPTHINLTO-NOT: "-cc1"{{.*}} "-triple" "x86_64-unknown-linux-gnu" {{.*}} "-flto-unit"
// HIPTHINLTO: lld{{.*}}"-plugin-opt=mcpu=gfx906" "-plugin-opt=thinlto" "-plugin-opt=-force-import-all"
// HIPTHINLTO: clang-linker-wrapper{{.*}} "--device-compiler=amdgcn-amd-amdhsa=-flto=thin"

// Check that -flto=thin is handled correctly, particularly with -fwhole-program-vtables.
//
Expand Down Expand Up @@ -120,10 +116,7 @@
// RUN: %clang -### --target=x86_64-unknown-linux-gnu -nogpuinc -nogpulib \
// RUN: --cuda-gpu-arch=gfx906 -fgpu-rdc -Xoffload-linker --build-id=md5 %s 2>&1 \
// RUN: | FileCheck -check-prefix=OFL-LINK %s
// RUN: %clang -### --target=x86_64-unknown-linux-gnu -nogpuinc -nogpulib \
// RUN: --cuda-gpu-arch=gfx906 -Xoffload-linker --build-id=md5 %s 2>&1 \
// RUN: | FileCheck -check-prefix=OFL-LINK %s
// OFL-LINK: lld{{.*}}"--build-id=md5"
// OFL-LINK: clang-linker-wrapper{{.*}}"--device-linker=--build-id=md5"

// RUN: %clang -### --target=x86_64-unknown-linux-gnu -nogpuinc -nogpulib \
// RUN: --offload-arch=gfx906 -fhip-kernel-arg-name %s 2>&1 \
Expand Down
2 changes: 1 addition & 1 deletion clang/test/Driver/hip-sanitize-options.hip
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@
// NORDC-NOT: {{"[^"]*lld(\.exe){0,1}".*}} "[[OUT]]" {{".*asanrtl.bc" ".*hip.bc"}}
// NORDC: {{"[^"]*clang[^"]*".* "-triple" "x86_64-unknown-linux-gnu".* "-fsanitize=address"}}

// RDC: {{"[^"]*clang[^"]*".* "-triple" "x86_64-unknown-linux-gnu".* "-fsanitize=address"}}
// RDC: {{"[^"]*clang[^"]*".* "-emit-llvm-bc".* "-fcuda-is-device".* "-mlink-bitcode-file" ".*asanrtl.bc".* "-fsanitize=address".*}} "-o" "[[OUT:[^"]*.bc]]"
// RDC: {{"[^"]*clang[^"]*".* "-triple" "x86_64-unknown-linux-gnu".* "-fsanitize=address"}}
// RDC-NOT: {{"[^"]*lld(\.exe){0,1}".*}} "[[OUT]]" {{".*asanrtl.bc" ".*hip.bc"}}

// FAIL: error: cannot find ROCm device library for ABI version 5; provide its path via '--rocm-path' or '--rocm-device-lib-path', or pass '-nogpulib' to build without ROCm device library
Expand Down
12 changes: 6 additions & 6 deletions clang/test/Driver/hip-save-temps.hip
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
// -fno-gpu-rdc without -o with -c
// RUN: %clang -### --target=x86_64-linux-gnu -nogpulib -save-temps \
// RUN: -nogpuinc --offload-arch=gfx900 -c %s 2>&1 | \
// 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: -nogpuinc --offload-arch=gfx900 %s 2>&1 | \
// 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: -nogpuinc -o executable --offload-arch=gfx900 %s 2>&1 | \
// 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: -nogpuinc -fgpu-rdc --offload-arch=gfx900 -c %s 2>&1 | \
// 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: -nogpuinc -fgpu-rdc --offload-arch=gfx900 %s 2>&1 | \
// 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: -nogpuinc -o executable -fgpu-rdc --offload-arch=gfx900 %s 2>&1 | \
// 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
Expand Down
8 changes: 4 additions & 4 deletions clang/test/Driver/hip-thinlto.hip
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// RUN: %clang -foffload-lto=thin -nogpulib -nogpuinc %s -### 2>&1 | FileCheck %s

// CHECK: -plugin-opt=thinlto
// CHECK-SAME: -plugin-opt=-force-import-all
// CHECK-SAME: -plugin-opt=-avail-extern-to-local
// CHECK-SAME: -plugin-opt=-avail-extern-gv-in-addrspace-to-local=3
// CHECK: "--device-compiler=amdgcn-amd-amdhsa=-flto=thin"
// CHECK-SAME: "--device-linker=amdgcn-amd-amdhsa=-plugin-opt=-force-import-all"
// CHECK-SAME: "--device-linker=amdgcn-amd-amdhsa=-plugin-opt=-avail-extern-to-local"
// CHECK-SAME: "--device-linker=amdgcn-amd-amdhsa=-plugin-opt=-avail-extern-gv-in-addrspace-to-local=3"
int main(int, char *[]) {
return 0;
}
4 changes: 0 additions & 4 deletions clang/test/Driver/hip-toolchain-device-only.hip
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,3 @@

// CHECK: [[LLD]] "-flavor" "gnu" "-m" "elf64_amdgpu" "--no-undefined" "-shared"
// CHECK-SAME: "-o" "[[IMG_DEV_A_900:.*out]]" [[OBJ_DEV_A_900]]

// CHECK: [[BUNDLER:".*clang-offload-bundler"]] "-type=o"
// CHECK-SAME: "-targets={{.*}},hip{{.*}}-amdgcn-amd-amdhsa--gfx803,hip{{.*}}-amdgcn-amd-amdhsa--gfx900"
// CHECK-SAME: "-input={{.*}}" "-input=[[IMG_DEV_A_803]]" "-input=[[IMG_DEV_A_900]]" "-output=[[BUNDLE_A:.*hipfb]]"
2 changes: 0 additions & 2 deletions clang/test/Driver/hip-toolchain-mllvm.hip
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,11 @@
// CHECK-SAME: "-aux-triple" "x86_64-unknown-linux-gnu"
// CHECK-SAME: {{.*}} "-target-cpu" "gfx803"
// CHECK-SAME: {{.*}} "-mllvm" "-unroll-count=10" {{.*}}
// CHECK: [[LLD:".*lld.*"]] {{.*}}"-m" "elf64_amdgpu"{{.*}} "-plugin-opt=-unroll-count=10"{{.*}} "-plugin-opt=-inline-threshold=100"

// CHECK: [[CLANG]] "-cc1" "-triple" "amdgcn-amd-amdhsa"
// CHECK-SAME: "-aux-triple" "x86_64-unknown-linux-gnu"
// CHECK-SAME: {{.*}} "-target-cpu" "gfx900"
// CHECK-SAME: {{.*}} "-mllvm" "-unroll-count=10" {{.*}}
// CHECK: [[LLD:".*lld.*"]] {{.*}} "-plugin-opt=-unroll-count=10"{{.*}} "-plugin-opt=-inline-threshold=100"

// NEG-NOT: {{".*opt"}}
// NEG-NOT: {{".*llc"}}
Expand Down
Loading
Loading