Page MenuHomePhabricator

[ThinLTO] Add optional import message and statistics

Authored by tejohnson on Mar 25 2016, 7:43 PM.



Add a statistic to count the number of imported functions. Also, add a
new -print-imports option to emit a trace of imported functions, that
works even for an NDEBUG build.

Note that emitOptimizationRemark does not work for the above printing as
it expects a Function object and DebugLoc, neither of which we will have
particularly when we move to summary-based importing.

Diff Detail


Event Timeline

tejohnson updated this revision to Diff 51706.Mar 25 2016, 7:43 PM
tejohnson retitled this revision from to [ThinLTO] Add optional import message and statistics.
tejohnson updated this object.
tejohnson added a reviewer: mehdi_amini.
tejohnson added a subscriber: llvm-commits.
tejohnson updated this revision to Diff 51726.Mar 26 2016, 9:25 PM
tejohnson edited edge metadata.

Rebase on D18343/r264503.

Also, with r264503, aliases are now being added to the GlobalsToImport set even
when their aliasees can't be imported due to their linkage type. While the
importing worked correctly (the aliases imported as declarations) due to the
logic in FunctionImportGlobalProcessing::doImportAsDefinition, there is no
point to adding them to the GlobalsToImport set and it was resulting in
incorrectly printing a message indicating that the alias was imported.
To avoid this, delay adding aliases to the GlobalsToImport set until after
the linkage type of the aliasee is checked.

mehdi_amini accepted this revision.Mar 26 2016, 9:32 PM
mehdi_amini edited edge metadata.

LGTM, but please commit separately if possible: first the change about the aliases and then the changes related to the new debug.

This revision is now accepted and ready to land.Mar 26 2016, 9:32 PM
This revision was automatically updated to reflect the committed changes.