Page MenuHomePhabricator

[ThinLTO] Compute the basic block count across modules.
ClosedPublic

Authored by yamauchi on May 21 2020, 1:35 PM.

Details

Summary

Count the per-module number of basic blocks when the module summary is computed
and sum them up during Thin LTO indexing.

This is used to estimate the working set size under the partial sample PGO.

This is split off of D79831.

Diff Detail

Event Timeline

yamauchi created this revision.May 21 2020, 1:35 PM
Herald added a project: Restricted Project. · View Herald Transcript
yamauchi updated this revision to Diff 266282.May 26 2020, 11:33 AM

Address comment (from D79831).

tejohnson added inline comments.May 27 2020, 8:37 AM
llvm/include/llvm/IR/ModuleSummaryIndex.h
1010

Also specify that this would be the total number of bbs in the LTO unit in the combined index (it is the total in the module in the per-module summary).

1034

I'm not convinced a version bump is required. Isn't the lack of a block count record handled naturally ( i.e. the count stays at 0 in the index)?

llvm/lib/Bitcode/Reader/BitcodeReader.cpp
6244

Remove commented out line. Presumably this uses addBlockCount instead of setBlockCount so that it gets merged properly when building the combined index?

yamauchi updated this revision to Diff 266603.May 27 2020, 10:55 AM
yamauchi marked 6 inline comments as done.

Address comments.

llvm/include/llvm/IR/ModuleSummaryIndex.h
1010

Done.

1034

Yes, apparently bumping wasn't necessary. Done.

llvm/lib/Bitcode/Reader/BitcodeReader.cpp
6244

Yes. Done.

This revision is now accepted and ready to land.May 27 2020, 12:04 PM
This revision was automatically updated to reflect the committed changes.