This is an archive of the discontinued LLVM Phabricator instance.

[LTO] Support Statistics
ClosedPublic

Authored by anemet on Feb 16 2016, 12:09 PM.

Details

Summary

I thought -Xlinker -mllvm -Xlinker -stats worked at some point but maybe
it never did.

For clang, I believe that stats are printed from cc1_main. This patch
also prints them for LTO, specifically right after codegen happens.

I only looked at the C API for LTO briefly to see if this is a good
place. Probably there are still cases where this wouldn't be printed
but it seems to be working for the common case. I also experimented
putting this in the LTOCodeGenerator destructor but that didn't trigger
for me.

Diff Detail

Event Timeline

anemet updated this revision to Diff 48094.Feb 16 2016, 12:09 PM
anemet retitled this revision from to [LTO] Support Statistics.
anemet updated this object.
anemet added reviewers: dexonsmith, mehdi_amini.
anemet added a subscriber: llvm-commits.
mehdi_amini accepted this revision.Feb 16 2016, 12:12 PM
mehdi_amini edited edge metadata.

LGTM.

(Note that ld64 is not destroying the LTOCodeGenerator)

This revision is now accepted and ready to land.Feb 16 2016, 12:12 PM

Can you add a test to test/tools/lto?

Good idea, will add a test.

This revision was automatically updated to reflect the committed changes.