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

Hal Finkel via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 21 18:31:53 PDT 2017

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<std::string, 8> 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?



More information about the cfe-commits mailing list