This is an archive of the discontinued LLVM Phabricator instance.

[libomptarget] Revert all improvements to support
ClosedPublic

Authored by JonChesterfield on Nov 6 2019, 2:51 AM.

Details

Summary

[libomptarget] Revert all improvements to support

The change to unity build for nvcc has broken the build for some developers.
This patch reverts to a known-working state.

There has been some confusion over exactly how the build broke. I think we
have reached a common understanding that the disappearing symbols are from
the bitcode library built by clang. The static archive built by nvcc may show the
same problem. Some of the confusion arose from building the deviceRTL twice
and using one or the other library based on various environmental factors.

I'm pretty sure the problem is clang expanding __forceinline__ into both __inline__
and attribute(("always_inline")). The __inline__ attribute resolves to linkonce_odr
which is not safe for exporting symbols from translation units.

"always_inline" is the desired semantic for small functions defined in one translation
unit that are intended to be inlined at link time. "inline" is not.

This therefore reintroduces the dependency hazard of supporti.h and some code
duplication, and blocks progress separating deviceRTL into reusable components.

See also D69857, D69859 for attempts at a fix instead of a revert.

Event Timeline

JonChesterfield created this revision.Nov 6 2019, 2:51 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 6 2019, 2:51 AM
  • include build files
Harbormaster completed remote builds in B40568: Diff 228032.
ABataev accepted this revision.Nov 6 2019, 7:12 AM

I test it and it works for me.

This revision is now accepted and ready to land.Nov 6 2019, 7:12 AM

I test it and it works for me.

Thanks. The commit message is nonsense so I'll fix that with the understanding from the openmp call, then commit this.

JonChesterfield edited the summary of this revision. (Show Details)Nov 6 2019, 7:41 AM
This revision was automatically updated to reflect the committed changes.
openmp/libomptarget/deviceRTLs/nvptx/src/target_impl.h