This is an archive of the discontinued LLVM Phabricator instance.

[OpenMP] Improve search for libomptarget-nvptx
ClosedPublic

Authored by Hahnfeld on Sep 5 2018, 8:12 AM.

Details

Summary

When looking for the bclib Clang considered the default library
path first while it preferred directories in LIBRARY_PATH when
constructing the invocation of nvlink. The latter actually makes
more sense because during development it allows using a non-default
runtime library. So change the search for the bclib to start
looking in directories given by LIBRARY_PATH.
Additionally add a new option --libomptarget-nvptx-path= which
will be searched first. This will be handy for testing purposes.

Diff Detail

Repository
rC Clang

Event Timeline

Hahnfeld created this revision.Sep 5 2018, 8:12 AM
ABataev added inline comments.Sep 26 2018, 12:45 PM
lib/Driver/ToolChains/Cuda.cpp
517

const Arg *A

656

const Arg *

670

You're changing the order of the lookup for the paths. Is this intended? If so, you need the test for this.

Hahnfeld added inline comments.Sep 26 2018, 12:52 PM
lib/Driver/ToolChains/Cuda.cpp
670

Yes, that's explained in the summary.

I'll try to see if there is a way to test this, even if we can't expect libomptarget-nvptx to be built together with Clang. At the moment I think only LIBRARY_PATH is tested, I'm adding some for the new --libomptarget-nvptx-path.

Hahnfeld updated this revision to Diff 167250.Sep 27 2018, 2:03 AM
Hahnfeld marked 2 inline comments as done.

Add const per review comments.

lib/Driver/ToolChains/Cuda.cpp
670

After some thoughts it seems impossible to reliably test this code path because the user can set CLANG_LIBDIR_SUFFIX.

This revision is now accepted and ready to land.Sep 27 2018, 6:13 AM
This revision was automatically updated to reflect the committed changes.