[PATCH] D29651: [OpenMP] Consider LIBRARY_PATH when selecting library paths for NVPTX targets in OpenMP mode.

2017-06-28 Thread Gheorghe-Teodor Bercea via Phabricator via cfe-commits
gtbercea abandoned this revision.
gtbercea added a comment.

Not needed.
These changes are related to looking up the .bc library for inlining purposes. 
I believe @arpith-jacob has already handled this in trunk. Therefore this is 
obsolete code.


Repository:
  rL LLVM

https://reviews.llvm.org/D29651



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


[PATCH] D29651: [OpenMP] Consider LIBRARY_PATH when selecting library paths for NVPTX targets in OpenMP mode.

2017-06-21 Thread Hal Finkel via Phabricator via cfe-commits
hfinkel added a comment.

In https://reviews.llvm.org/D29651#720179, @tstellar wrote:

> Why is this necessary?


To put it another way, what is special about LIBRARY_PATH in this regard? Do we 
already pass paths specified with `-L`? I'm also slightly concerned here with 
the custom parsing code. Can the logic from tools::addDirectoryList not be 
reused here?




Comment at: lib/Driver/ToolChains/Cuda.cpp:405
+
+  if (DeviceOffloadingKind == Action::OFK_OpenMP) {
+SmallVector LibraryPaths;

A comment is needed here explaining why this is necessary/desirable.



Comment at: lib/Driver/ToolChains/Cuda.cpp:412
+CompilerPath.split(llvm::sys::EnvPathSeparator);
+LibraryPaths.push_back(Split.first);
+CompilerPath = Split.second;

Is this the only use of this variable? How is this not dead code?



Comment at: test/Driver/openmp-offload.c:626
+// CHK-LIB-PATH: ld{{.*}}.o" "-L/a/b/c/lib"
+// CHK-LIB-PATH: ld{{.*}}.o" "-L/a/b/c/lib"

Can this be a little more specific so that you actually make sure you're 
getting the offloading linking step here?



Repository:
  rL LLVM

https://reviews.llvm.org/D29651



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


[PATCH] D29651: [OpenMP] Consider LIBRARY_PATH when selecting library paths for NVPTX targets in OpenMP mode.

2017-04-06 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added inline comments.



Comment at: test/Driver/openmp-offload.c:622
+/// Check that the lib folder pointed to by the LIBRARY_PATH is correctly 
passsed to the loader script.
+// RUN:   LIBRARY_PATH=/a/b/c/lib %clang -### -fopenmp=libomp 
-fopenmp-targets=powerpc64le-ibm-linux-gnu -save-temps -no-canonical-prefixes 
%s 2>&1 \
+// RUN:   | FileCheck -check-prefix=CHK-LIB-PATH %s

Will it work on Windows?


Repository:
  rL LLVM

https://reviews.llvm.org/D29651



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


[PATCH] D29651: [OpenMP] Consider LIBRARY_PATH when selecting library paths for NVPTX targets in OpenMP mode.

2017-04-06 Thread Tom Stellard via Phabricator via cfe-commits
tstellar added a comment.

Why is this necessary?


Repository:
  rL LLVM

https://reviews.llvm.org/D29651



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


[PATCH] D29651: [OpenMP] Consider LIBRARY_PATH when selecting library paths for NVPTX targets in OpenMP mode.

2017-03-27 Thread Gheorghe-Teodor Bercea via Phabricator via cfe-commits
gtbercea updated this revision to Diff 93188.
gtbercea added a comment.
Herald added a subscriber: rengolin.

Update patch to reflect latest source code changes.


Repository:
  rL LLVM

https://reviews.llvm.org/D29651

Files:
  lib/Driver/ToolChains/Cuda.cpp
  test/Driver/openmp-offload.c


Index: test/Driver/openmp-offload.c
===
--- test/Driver/openmp-offload.c
+++ test/Driver/openmp-offload.c
@@ -615,3 +615,12 @@
 // CHK-FOPENMP-IS-DEVICE: clang{{.*}}.i" {{.*}}" "-fopenmp-is-device"
 // CHK-FOPENMP-IS-DEVICE-NEXT: clang{{.*}}.bc" {{.*}}.i" "-fopenmp-is-device" 
"-fopenmp-host-ir-file-path"
 // CHK-FOPENMP-IS-DEVICE-NEXT: clang{{.*}}.s" {{.*}}.bc" "-fopenmp-is-device"
+
+/// ###
+
+/// Check that the lib folder pointed to by the LIBRARY_PATH is correctly 
passsed to the loader script.
+// RUN:   LIBRARY_PATH=/a/b/c/lib %clang -### -fopenmp=libomp 
-fopenmp-targets=powerpc64le-ibm-linux-gnu -save-temps -no-canonical-prefixes 
%s 2>&1 \
+// RUN:   | FileCheck -check-prefix=CHK-LIB-PATH %s
+
+// CHK-LIB-PATH: ld{{.*}}.o" "-L/a/b/c/lib"
+// CHK-LIB-PATH: ld{{.*}}.o" "-L/a/b/c/lib"
Index: lib/Driver/ToolChains/Cuda.cpp
===
--- lib/Driver/ToolChains/Cuda.cpp
+++ lib/Driver/ToolChains/Cuda.cpp
@@ -401,6 +401,19 @@
   // came with CUDA-7.0.
   CC1Args.push_back("-target-feature");
   CC1Args.push_back("+ptx42");
+
+  if (DeviceOffloadingKind == Action::OFK_OpenMP) {
+SmallVector LibraryPaths;
+if (char *Env = ::getenv("LIBRARY_PATH")) {
+  StringRef CompilerPath = Env;
+  while (!CompilerPath.empty()) {
+std::pair Split =
+CompilerPath.split(llvm::sys::EnvPathSeparator);
+LibraryPaths.push_back(Split.first);
+CompilerPath = Split.second;
+  }
+}
+  }
 }
 
 void CudaToolChain::AddCudaIncludeArgs(const ArgList ,


Index: test/Driver/openmp-offload.c
===
--- test/Driver/openmp-offload.c
+++ test/Driver/openmp-offload.c
@@ -615,3 +615,12 @@
 // CHK-FOPENMP-IS-DEVICE: clang{{.*}}.i" {{.*}}" "-fopenmp-is-device"
 // CHK-FOPENMP-IS-DEVICE-NEXT: clang{{.*}}.bc" {{.*}}.i" "-fopenmp-is-device" "-fopenmp-host-ir-file-path"
 // CHK-FOPENMP-IS-DEVICE-NEXT: clang{{.*}}.s" {{.*}}.bc" "-fopenmp-is-device"
+
+/// ###
+
+/// Check that the lib folder pointed to by the LIBRARY_PATH is correctly passsed to the loader script.
+// RUN:   LIBRARY_PATH=/a/b/c/lib %clang -### -fopenmp=libomp -fopenmp-targets=powerpc64le-ibm-linux-gnu -save-temps -no-canonical-prefixes %s 2>&1 \
+// RUN:   | FileCheck -check-prefix=CHK-LIB-PATH %s
+
+// CHK-LIB-PATH: ld{{.*}}.o" "-L/a/b/c/lib"
+// CHK-LIB-PATH: ld{{.*}}.o" "-L/a/b/c/lib"
Index: lib/Driver/ToolChains/Cuda.cpp
===
--- lib/Driver/ToolChains/Cuda.cpp
+++ lib/Driver/ToolChains/Cuda.cpp
@@ -401,6 +401,19 @@
   // came with CUDA-7.0.
   CC1Args.push_back("-target-feature");
   CC1Args.push_back("+ptx42");
+
+  if (DeviceOffloadingKind == Action::OFK_OpenMP) {
+SmallVector LibraryPaths;
+if (char *Env = ::getenv("LIBRARY_PATH")) {
+  StringRef CompilerPath = Env;
+  while (!CompilerPath.empty()) {
+std::pair Split =
+CompilerPath.split(llvm::sys::EnvPathSeparator);
+LibraryPaths.push_back(Split.first);
+CompilerPath = Split.second;
+  }
+}
+  }
 }
 
 void CudaToolChain::AddCudaIncludeArgs(const ArgList ,
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits