Author: hliao Date: Tue Oct 8 11:06:51 2019 New Revision: 374097 URL: http://llvm.org/viewvc/llvm-project?rev=374097&view=rev Log: [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 Added: cfe/trunk/test/Driver/hip-syntax-only.hip Modified: cfe/trunk/lib/Driver/Driver.cpp Modified: cfe/trunk/lib/Driver/Driver.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Driver.cpp?rev=374097&r1=374096&r2=374097&view=diff ============================================================================== --- cfe/trunk/lib/Driver/Driver.cpp (original) +++ cfe/trunk/lib/Driver/Driver.cpp Tue Oct 8 11:06:51 2019 @@ -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); Added: cfe/trunk/test/Driver/hip-syntax-only.hip URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/hip-syntax-only.hip?rev=374097&view=auto ============================================================================== --- cfe/trunk/test/Driver/hip-syntax-only.hip (added) +++ cfe/trunk/test/Driver/hip-syntax-only.hip Tue Oct 8 11:06:51 2019 @@ -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" _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits