[PATCH] D47394: [OpenMP][Clang][NVPTX] Replace bundling with partial linking for the OpenMP NVPTX device offloading toolchain

2018-05-29 Thread Guansong Zhang via Phabricator via cfe-commits
guansong added a comment.

I am not quite familiar with Clang driver set up, I will add Greg for more 
comments. But I have hacked one the latest YKT tree to support simple AMDGCN 
path the same way as NVPTX. The last patch is here

https://github.com/ROCm-Developer-Tools/hcc2-clang/commit/8c1cce0d39717c9e40ea70aea91e280673de756e

It is not upstreamed but we can compile the same binary for both nvptx and 
amdgcn cards as we designed.

If I understand this correctly, we are now switching nvlink as the default host 
linker whenever nvptx is involved. I am concerned that this may cause trouble 
for integration with other platforms. Maybe this path should be under a special 
option even for nvptx?


Repository:
  rC Clang

https://reviews.llvm.org/D47394



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


[PATCH] D40977: [OpenMP] NVPTX: Set default/minimum compute capability to sm_35

2017-12-07 Thread Guansong Zhang via Phabricator via cfe-commits
guansong added a comment.

LGTM.


Repository:
  rC Clang

https://reviews.llvm.org/D40977



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


[PATCH] D30743: enable -save-temps with -finclude-defult-header

2017-03-15 Thread Guansong Zhang via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL297890: enable -save-temps with -finclude-defult-header 
(authored by guansong).

Changed prior to commit:
  https://reviews.llvm.org/D30743?vs=91718&id=91935#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D30743

Files:
  cfe/trunk/lib/Driver/ToolChains/Clang.cpp
  cfe/trunk/test/Driver/include-default-header.cl


Index: cfe/trunk/test/Driver/include-default-header.cl
===
--- cfe/trunk/test/Driver/include-default-header.cl
+++ cfe/trunk/test/Driver/include-default-header.cl
@@ -0,0 +1,4 @@
+// RUN: %clang -v -save-temps -x cl -Xclang -cl-std=CL2.0 -Xclang 
-finclude-default-header -target amdgcn -S -c %s
+
+void test() {}
+
Index: cfe/trunk/lib/Driver/ToolChains/Clang.cpp
===
--- cfe/trunk/lib/Driver/ToolChains/Clang.cpp
+++ cfe/trunk/lib/Driver/ToolChains/Clang.cpp
@@ -4268,7 +4268,19 @@
 
   // Forward -Xclang arguments to -cc1, and -mllvm arguments to the LLVM option
   // parser.
-  Args.AddAllArgValues(CmdArgs, options::OPT_Xclang);
+  // -finclude-default-header flag is for preprocessor,
+  // do not pass it to other cc1 commands when save-temps is enabled
+  if (C.getDriver().isSaveTempsEnabled() &&
+  !isa(JA)) {
+for (auto Arg : Args.filtered(options::OPT_Xclang)) {
+  Arg->claim();
+  if (StringRef(Arg->getValue()) != "-finclude-default-header")
+CmdArgs.push_back(Arg->getValue());
+}
+  }
+  else {
+Args.AddAllArgValues(CmdArgs, options::OPT_Xclang);
+  }
   for (const Arg *A : Args.filtered(options::OPT_mllvm)) {
 A->claim();
 


Index: cfe/trunk/test/Driver/include-default-header.cl
===
--- cfe/trunk/test/Driver/include-default-header.cl
+++ cfe/trunk/test/Driver/include-default-header.cl
@@ -0,0 +1,4 @@
+// RUN: %clang -v -save-temps -x cl -Xclang -cl-std=CL2.0 -Xclang -finclude-default-header -target amdgcn -S -c %s
+
+void test() {}
+
Index: cfe/trunk/lib/Driver/ToolChains/Clang.cpp
===
--- cfe/trunk/lib/Driver/ToolChains/Clang.cpp
+++ cfe/trunk/lib/Driver/ToolChains/Clang.cpp
@@ -4268,7 +4268,19 @@
 
   // Forward -Xclang arguments to -cc1, and -mllvm arguments to the LLVM option
   // parser.
-  Args.AddAllArgValues(CmdArgs, options::OPT_Xclang);
+  // -finclude-default-header flag is for preprocessor,
+  // do not pass it to other cc1 commands when save-temps is enabled
+  if (C.getDriver().isSaveTempsEnabled() &&
+  !isa(JA)) {
+for (auto Arg : Args.filtered(options::OPT_Xclang)) {
+  Arg->claim();
+  if (StringRef(Arg->getValue()) != "-finclude-default-header")
+CmdArgs.push_back(Arg->getValue());
+}
+  }
+  else {
+Args.AddAllArgValues(CmdArgs, options::OPT_Xclang);
+  }
   for (const Arg *A : Args.filtered(options::OPT_mllvm)) {
 A->claim();
 
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D30743: enable -save-temps with -finclude-defult-header

2017-03-13 Thread Guansong Zhang via Phabricator via cfe-commits
guansong updated this revision to Diff 91600.

https://reviews.llvm.org/D30743

Files:
  lib/Driver/Tools.cpp
  test/Driver/include-default-header.cl


Index: test/Driver/include-default-header.cl
===
--- /dev/null
+++ test/Driver/include-default-header.cl
@@ -0,0 +1,4 @@
+// RUN: %clang -v -save-temps -x cl -Xclang -cl-std=CL2.0 -Xclang 
-finclude-default-header -target amdgcn -S -c %s
+
+void test() {}
+
Index: lib/Driver/Tools.cpp
===
--- lib/Driver/Tools.cpp
+++ lib/Driver/Tools.cpp
@@ -5285,7 +5285,20 @@
 
   // Forward -Xclang arguments to -cc1, and -mllvm arguments to the LLVM option
   // parser.
-  Args.AddAllArgValues(CmdArgs, options::OPT_Xclang);
+  if (C.getDriver().isSaveTempsEnabled() &&
+  !isa(JA)) {
+// -finclude-default-header flag is for preprocessor,
+// do not pass it to other cc1 commands when save-temps is enabled
+for (auto Arg : Args.filtered(options::OPT_Xclang)) {
+  Arg->claim();
+  if (StringRef(Arg->getValue()) != "-finclude-default-header")
+CmdArgs.push_back(Arg->getValue());
+}
+  }
+  else {
+Args.AddAllArgValues(CmdArgs, options::OPT_Xclang);
+  }
+
   for (const Arg *A : Args.filtered(options::OPT_mllvm)) {
 A->claim();
 


Index: test/Driver/include-default-header.cl
===
--- /dev/null
+++ test/Driver/include-default-header.cl
@@ -0,0 +1,4 @@
+// RUN: %clang -v -save-temps -x cl -Xclang -cl-std=CL2.0 -Xclang -finclude-default-header -target amdgcn -S -c %s
+
+void test() {}
+
Index: lib/Driver/Tools.cpp
===
--- lib/Driver/Tools.cpp
+++ lib/Driver/Tools.cpp
@@ -5285,7 +5285,20 @@
 
   // Forward -Xclang arguments to -cc1, and -mllvm arguments to the LLVM option
   // parser.
-  Args.AddAllArgValues(CmdArgs, options::OPT_Xclang);
+  if (C.getDriver().isSaveTempsEnabled() &&
+  !isa(JA)) {
+// -finclude-default-header flag is for preprocessor,
+// do not pass it to other cc1 commands when save-temps is enabled
+for (auto Arg : Args.filtered(options::OPT_Xclang)) {
+  Arg->claim();
+  if (StringRef(Arg->getValue()) != "-finclude-default-header")
+CmdArgs.push_back(Arg->getValue());
+}
+  }
+  else {
+Args.AddAllArgValues(CmdArgs, options::OPT_Xclang);
+  }
+
   for (const Arg *A : Args.filtered(options::OPT_mllvm)) {
 A->claim();
 
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D30743: enable -save-temps with -finclude-defult-header

2017-03-14 Thread Guansong Zhang via Phabricator via cfe-commits
guansong updated this revision to Diff 91718.
guansong added a comment.

Thanks, update as suggested.


https://reviews.llvm.org/D30743

Files:
  lib/Driver/Tools.cpp
  test/Driver/include-default-header.cl


Index: test/Driver/include-default-header.cl
===
--- /dev/null
+++ test/Driver/include-default-header.cl
@@ -0,0 +1,4 @@
+// RUN: %clang -v -save-temps -x cl -Xclang -cl-std=CL2.0 -Xclang 
-finclude-default-header -target amdgcn -S -c %s
+
+void test() {}
+
Index: lib/Driver/Tools.cpp
===
--- lib/Driver/Tools.cpp
+++ lib/Driver/Tools.cpp
@@ -5285,7 +5285,20 @@
 
   // Forward -Xclang arguments to -cc1, and -mllvm arguments to the LLVM option
   // parser.
-  Args.AddAllArgValues(CmdArgs, options::OPT_Xclang);
+  // -finclude-default-header flag is for preprocessor,
+  // do not pass it to other cc1 commands when save-temps is enabled
+  if (C.getDriver().isSaveTempsEnabled() &&
+  !isa(JA)) {
+for (auto Arg : Args.filtered(options::OPT_Xclang)) {
+  Arg->claim();
+  if (StringRef(Arg->getValue()) != "-finclude-default-header")
+CmdArgs.push_back(Arg->getValue());
+}
+  }
+  else {
+Args.AddAllArgValues(CmdArgs, options::OPT_Xclang);
+  }
+
   for (const Arg *A : Args.filtered(options::OPT_mllvm)) {
 A->claim();
 


Index: test/Driver/include-default-header.cl
===
--- /dev/null
+++ test/Driver/include-default-header.cl
@@ -0,0 +1,4 @@
+// RUN: %clang -v -save-temps -x cl -Xclang -cl-std=CL2.0 -Xclang -finclude-default-header -target amdgcn -S -c %s
+
+void test() {}
+
Index: lib/Driver/Tools.cpp
===
--- lib/Driver/Tools.cpp
+++ lib/Driver/Tools.cpp
@@ -5285,7 +5285,20 @@
 
   // Forward -Xclang arguments to -cc1, and -mllvm arguments to the LLVM option
   // parser.
-  Args.AddAllArgValues(CmdArgs, options::OPT_Xclang);
+  // -finclude-default-header flag is for preprocessor,
+  // do not pass it to other cc1 commands when save-temps is enabled
+  if (C.getDriver().isSaveTempsEnabled() &&
+  !isa(JA)) {
+for (auto Arg : Args.filtered(options::OPT_Xclang)) {
+  Arg->claim();
+  if (StringRef(Arg->getValue()) != "-finclude-default-header")
+CmdArgs.push_back(Arg->getValue());
+}
+  }
+  else {
+Args.AddAllArgValues(CmdArgs, options::OPT_Xclang);
+  }
+
   for (const Arg *A : Args.filtered(options::OPT_mllvm)) {
 A->claim();
 
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits