From: Michael Liao Date: Tue, 8 Oct 2019 18:06:51 +0000 (+0000) Subject: [driver][hip] Skip bundler if host action is nothing. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=65bb9cbdc850a3a557a70b7654aa57317a5b46a6;p=clang [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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@374097 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Driver/Driver.cpp b/lib/Driver/Driver.cpp index 5b72b4aeec..df3e82b85e 100644 --- a/lib/Driver/Driver.cpp +++ b/lib/Driver/Driver.cpp @@ -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); diff --git a/test/Driver/hip-syntax-only.hip b/test/Driver/hip-syntax-only.hip new file mode 100644 index 0000000000..051c3c6896 --- /dev/null +++ b/test/Driver/hip-syntax-only.hip @@ -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"