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

2019-10-08 Thread Artem Belevich via Phabricator via cfe-commits
tra added inline comments.



Comment at: clang/test/Driver/hip-syntax-only.hip:7
+
+// CHECK-DAG: clang{{.*}}" "-cc1" {{.*}} "-fcuda-is-device"
+// CHECK-DAG: clang{{.*}}" "-cc1" "-triple" "x86_64"

hliao wrote:
> tra wrote:
> > I'd include `-target ` and a comment describing that we're making sure 
> > that both host and device compilations are still executed.
> won't -fcuda-is-device be sufficient? that's option specific to device-side 
> compilation.
It's sufficient, but we're currently comparing sort of apples 
(`-fcuda-is-device`) and oranges (`-triple FOO`) on these two lines. Changing 
it into `-triple GPU  -fcuda-is-device` vs. `-triple HOST` would make it easier 
to understand what's the intent here.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D68652/new/

https://reviews.llvm.org/D68652



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


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

2019-10-08 Thread Michael Liao via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rG6334a59454ef: [driver][hip] Skip bundler if host action is 
nothing. (authored by hliao).

Changed prior to commit:
  https://reviews.llvm.org/D68652?vs=223890=223905#toc

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D68652/new/

https://reviews.llvm.org/D68652

Files:
  clang/lib/Driver/Driver.cpp
  clang/test/Driver/hip-syntax-only.hip


Index: clang/test/Driver/hip-syntax-only.hip
===
--- /dev/null
+++ clang/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"
Index: clang/lib/Driver/Driver.cpp
===
--- clang/lib/Driver/Driver.cpp
+++ clang/lib/Driver/Driver.cpp
@@ -3108,7 +3108,8 @@
 // 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);
 


Index: clang/test/Driver/hip-syntax-only.hip
===
--- /dev/null
+++ clang/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"
Index: clang/lib/Driver/Driver.cpp
===
--- clang/lib/Driver/Driver.cpp
+++ clang/lib/Driver/Driver.cpp
@@ -3108,7 +3108,8 @@
 // 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);
 
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


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

2019-10-08 Thread Artem Belevich via Phabricator via cfe-commits
tra accepted this revision.
tra added inline comments.
This revision is now accepted and ready to land.



Comment at: clang/test/Driver/hip-syntax-only.hip:7
+
+// CHECK-DAG: clang{{.*}}" "-cc1" {{.*}} "-fcuda-is-device"
+// CHECK-DAG: clang{{.*}}" "-cc1" "-triple" "x86_64"

I'd include `-target ` and a comment describing that we're making sure 
that both host and device compilations are still executed.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D68652/new/

https://reviews.llvm.org/D68652



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


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

2019-10-08 Thread Michael Liao via Phabricator via cfe-commits
hliao created this revision.
hliao added reviewers: sfantao, tra, yaxunl.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D68652

Files:
  clang/lib/Driver/Driver.cpp
  clang/test/Driver/hip-syntax-only.hip


Index: clang/test/Driver/hip-syntax-only.hip
===
--- /dev/null
+++ clang/test/Driver/hip-syntax-only.hip
@@ -0,0 +1,9 @@
+// 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-DAG: clang{{.*}}" "-cc1" {{.*}} "-fcuda-is-device"
+// CHECK-DAG: clang{{.*}}" "-cc1" "-triple" "x86_64"
+// CHECK-NOT: clang-offload-bundler"
Index: clang/lib/Driver/Driver.cpp
===
--- clang/lib/Driver/Driver.cpp
+++ clang/lib/Driver/Driver.cpp
@@ -3105,7 +3105,8 @@
 // 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);
 


Index: clang/test/Driver/hip-syntax-only.hip
===
--- /dev/null
+++ clang/test/Driver/hip-syntax-only.hip
@@ -0,0 +1,9 @@
+// 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-DAG: clang{{.*}}" "-cc1" {{.*}} "-fcuda-is-device"
+// CHECK-DAG: clang{{.*}}" "-cc1" "-triple" "x86_64"
+// CHECK-NOT: clang-offload-bundler"
Index: clang/lib/Driver/Driver.cpp
===
--- clang/lib/Driver/Driver.cpp
+++ clang/lib/Driver/Driver.cpp
@@ -3105,7 +3105,8 @@
 // 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);
 
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits