[driver][hip] Skip bundler if host action is nothing.

Reviewers: sfantao, tra, yaxunl

Subscribers: cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D68652

llvm-svn: 374097
This commit is contained in:
Michael Liao 2019-10-08 18:06:51 +00:00
parent 065d34dbe1
commit 6334a59454
2 changed files with 13 additions and 1 deletions

View File

@ -3108,7 +3108,8 @@ public:
// 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 && HostAction && !OffloadAL.empty()) {
if (CanUseBundler && 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);

View File

@ -0,0 +1,11 @@
// REQUIRES: clang-driver
// REQUIRES: x86-registered-target
// REQUIRES: amdgpu-registered-target
// RUN: %clang -### -x hip -nogpulib -target x86_64 -fsyntax-only %s 2>&1 | FileCheck %s
// Check that there are commands for both host- and device-side compilations.
//
// CHECK-DAG: clang{{.*}}" "-cc1" {{.*}} "-fcuda-is-device"
// CHECK-DAG: clang{{.*}}" "-cc1" "-triple" "x86_64"
// CHECK-NOT: clang-offload-bundler"