This is an archive of the discontinued LLVM Phabricator instance.

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

Authored by hjyamauchi 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

hjyamauchi created this revision.May 21 2020, 1:35 PM

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?

hjyamauchi 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.