This is an archive of the discontinued LLVM Phabricator instance.

[OpenMP] Prevent OpenMPOpt from internalizing uncalled functions
ClosedPublic

Authored by jhuber6 on Jun 24 2021, 5:45 PM.

Details

Summary

Currently OpenMPOpt will only check if a function is a kernel before deciding not to internalize it. Any uncalled function that gets internalized will be trivially dead in the module so this is unnnecessary.

Depends on D102423

Diff Detail

Event Timeline

jhuber6 created this revision.Jun 24 2021, 5:45 PM
jhuber6 requested review of this revision.Jun 24 2021, 5:45 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 24 2021, 5:45 PM
jdoerfert added inline comments.Jun 25 2021, 10:31 PM
llvm/lib/Transforms/IPO/OpenMPOpt.cpp
2655

Up to this point it makes sense. (clang-tidy/format!)

2661

This change is what irritates me. We basically won't emit a remark anymore, nor will we try hard to optimize a function, but we should. The user now doesn't know that we kinda ignored "unsued" below even though it can be very much used from outside the translation unit. We still didn't run H2S on it or reported that globalization was left. Instead, we should report there is a external version of a function (regardless of the internalization) and we should report if the external version has leftover globalization, for example.

jhuber6 updated this revision to Diff 354858.Jun 28 2021, 5:44 AM

Adding uncalled functions to SCC. This will make the module pass actually run on uncalled functions.

This revision is now accepted and ready to land.Jun 28 2021, 10:52 AM
This revision was landed with ongoing or failed builds.Jun 28 2021, 1:48 PM
This revision was automatically updated to reflect the committed changes.