This is an archive of the discontinued LLVM Phabricator instance.

[LTO] Print time-passes information at conclusion of LTO codegen
ClosedPublic

Authored by jhenderson on May 3 2017, 6:40 AM.

Details

Summary

The information collected when requested by -time-passes is only printed when llvm_shutdown is called at the moment. This means that when linking against the LTO library dynamically and using the C interface, it is not possible to see the timing information, because llvm_shutdown cannot be called. This changes modifies the LTO code generation functions for both regular LTO and thin LTO to explicitly print and reset the timing information.

I have tested that this works with our proprietary linker. However, as this relies on a specific method of building and linking against the LTO library, I'm not sure how or if this can be tested in the LLVM testsuite. Any suggestions would be appreciated.

Diff Detail

Repository
rL LLVM

Event Timeline

jhenderson created this revision.May 3 2017, 6:40 AM
jhenderson updated this revision to Diff 97626.May 3 2017, 6:45 AM

Minor improvement to reportTimings to get rid of unnecessary check.

mehdi_amini added inline comments.May 11 2017, 10:39 AM
include/llvm/IR/LegacyPassManager.h
101 ↗(On Diff #97626)

Doxygen

Also the name does not carry the fact that timers are reset.

lib/IR/LegacyPassManager.cpp
15 ↗(On Diff #97626)

Why this?

jhenderson updated this revision to Diff 98966.May 15 2017, 2:56 AM
jhenderson marked an inline comment as done.

Renamed function and added doxygen comment.

jhenderson added inline comments.May 15 2017, 2:56 AM
lib/IR/LegacyPassManager.cpp
15 ↗(On Diff #97626)

The new print() method of the TimingInfo class calls CreateInfoOutputFile to get a stream to print to, which is declared in that header.

mehdi_amini accepted this revision.May 15 2017, 7:59 AM

LGTM, thanks.

This revision is now accepted and ready to land.May 15 2017, 7:59 AM
This revision was automatically updated to reflect the committed changes.