This is an archive of the discontinued LLVM Phabricator instance.

[OpenMP] Fix --libomptarget-nvptx-bc-path in tests
ClosedPublic

Authored by jdenny on Jun 8 2023, 11:05 AM.

Details

Summary

After D151324, which landed as 349c0aacb380, many libomptarget non-LTO
nvptx64 tests fail with errors like:

clang: error: bitcode library '/tmp/llvm-project/build/runtimes/runtimes-bins/openmp/libomptarget/libomptarget-nvptx-sm_70.bc' does not exist

This patch updates the bc path.

Diff Detail

Event Timeline

jdenny created this revision.Jun 8 2023, 11:05 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 8 2023, 11:05 AM
jdenny requested review of this revision.Jun 8 2023, 11:05 AM
jhuber6 accepted this revision.Jun 8 2023, 11:07 AM

I'm surprised that patch caused the path to change.

This revision is now accepted and ready to land.Jun 8 2023, 11:07 AM

It seems to have just stopped it from copying .bc files out of DeviceRTL to its parent directory.

This revision was automatically updated to reflect the committed changes.

This is moderately interesting. I think the bc-path flag lets one specify either a specific library or a directory to look for a library in, and I'm guessing we're using the directory form so we guess the right lib based on architecture name. Something like

llvm/runtimes/runtimes-bins/openmp/libomptarget/DeviceRTL/packaged_libomptarget-nvptx-sm_75.bc

but I can't think of a reason why this should be nvptx specific, and I think we introduced this because otherwise the test suite runs with whatever bitcode file it found on disk with the right sort of name as opposed to the bitcode file we just built and would like to test.

https://reviews.llvm.org/D142491 (or probably a fix following it) dropped the line specifying the bitcode library to use in favour of a static archive chosen by clang.

I think that's pretty suspect - maybe something forces the clang running the tests to pick the right static archive, but I haven't found it. Seems likely it's running using the same static libary that clang would find outside of the test harness, which is not especially likely to be the one just built.