[PATCH] D23149: Printing imported functions size

Teresa Johnson via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 5 07:45:36 PDT 2016


tejohnson added a comment.

In https://reviews.llvm.org/D23149#506403, @mehdi_amini wrote:

> In https://reviews.llvm.org/D23149#506379, @tejohnson wrote:
>
> > Right, I was originally thinking about suggesting an alternative which is to pass the index into the inliner so the info could simply be queried directly out of the index. However, it makes dumping these stats via something like "llvm-link -thinlto-action=import | opt -O2" impossible unless we pass the combined index in to opt as well, for passing to the inliner.
>
>
> Could be a new optional `cl::opt` for `ImportedFunctionsInliningStatistics` providing the path to the index? 
>  Otherwise it can also be that the printed statistics have to be passed to a third party tool to produce a report (with a flow similar to how code-coverage reporting works somehow).


Would be nice to avoid requiring a third-party tool to munge the stats if possible.

The suggestion of passing the index would work, but would require re-parsing the index when we already have it in the case where we came through the compiler (and not opt). Using the in-memory copy when already available would require a couple of changes:

- Stop gating the enabling of the function import pass in the pass manager based on the ModuleSummary in the pass manager being non-null (add a separate bool for that), then always set the ModuleSummary on the pass manager and pass it into the inliner
- In the opt tool, change the existing module-summary option to emit-module-summary, and add a new module-summary that takes an existing summary index file, reads it, and passes it into the inliner when it is created.


https://reviews.llvm.org/D23149





More information about the llvm-commits mailing list