This is an archive of the discontinued LLVM Phabricator instance.

[Libomptarget] Only export needed definitions in the BC library
ClosedPublic

Authored by jhuber6 on Jul 21 2022, 12:28 PM.

Details

Summary

This patch adds the use of the -internalize-public-api-file option in
the internalization pass to internalize any definition that isn't
explicitly needed for the interface. This will allow us to perform more
optimizations on the file that normally would not have been possible
with functions internal to the library not being internal.

Depends on D130293

Diff Detail

Event Timeline

jhuber6 created this revision.Jul 21 2022, 12:28 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 21 2022, 12:28 PM
Herald added a subscriber: mgorny. · View Herald Transcript
jhuber6 requested review of this revision.Jul 21 2022, 12:28 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 21 2022, 12:28 PM

can't we do __kmpc* and omp_* and llvm_* instead?

can't we do __kmpc* and omp_* and llvm_* instead?

The internalize patch just takes full names. It would definitely be better to use wildcards. I could set up a patch to make it accept those as well, but it would take some extra time to get reviewed.

jdoerfert accepted this revision.Jul 21 2022, 2:56 PM

can't we do __kmpc* and omp_* and llvm_* instead?

The internalize patch just takes full names. It would definitely be better to use wildcards. I could set up a patch to make it accept those as well, but it would take some extra time to get reviewed.

Add a TODO somewhere. LG Otherwise

This revision is now accepted and ready to land.Jul 21 2022, 2:56 PM

Tempting to generate the exports file with nm | grep but probably not worth it. Thanks!

jhuber6 updated this revision to Diff 446679.Jul 21 2022, 6:21 PM

Changing to use globs after making a patch to update internalize to accept them.

This revision was landed with ongoing or failed builds.Jul 22 2022, 5:24 AM
This revision was automatically updated to reflect the committed changes.