This is an archive of the discontinued LLVM Phabricator instance.

[libomptarget-nvptx] Test bitcode compiler flags and enable by default
ClosedPublic

Authored by Hahnfeld on May 15 2018, 1:19 PM.

Details

Summary

Move all logic related to selecting the bitcode compiler and linker
into a new file and dynamically test required compiler flags. This
also adds -fcuda-rdc for Clang trunk as previously attempted in D44992
which fixes the build.

As a result this change also enables building the library by default
if all prerequisites are met.

Diff Detail

Repository
rL LLVM

Event Timeline

Hahnfeld created this revision.May 15 2018, 1:19 PM
Hahnfeld added inline comments.May 15 2018, 1:22 PM
libomptarget/deviceRTLs/nvptx/CMakeLists.txt
137–142 ↗(On Diff #146903)
gtbercea added inline comments.May 16 2018, 6:17 AM
README.rst
264 ↗(On Diff #146903)

When I use the latest Clang/LLVM to build an older version of the compiler the CMAKE_C_COMPILER compiler would be used to compile the BCLIB. I've seen that I cannot successfully inline a bclib built with a newer version of LLVM. In the past (i.e. a few months ago) I got an error complaining about the LLVM version.

libomptarget/deviceRTLs/nvptx/CMakeLists.txt
148 ↗(On Diff #146903)

Can we make the just-built compiler the default compiler if no other compiler has been provided by the user? This is always the compiler I want to use for the BCLIB compilation.

@gtbercea I'd like to keep that discussion in D46842. Short answer: It's working for me.

grokos accepted this revision.May 16 2018, 8:29 AM

Looks good! Thanks for taking care of it!

This revision is now accepted and ready to land.May 16 2018, 8:29 AM
gtbercea accepted this revision.May 16 2018, 8:32 AM

@gtbercea I'd like to keep that discussion in D46842. Short answer: It's working for me.

Sure. Let's talk about this in the other thread!

LG

This revision was automatically updated to reflect the committed changes.