From d4ddf06b0c7f38612f334db71ef1d7a58a3cc8e0 Mon Sep 17 00:00:00 2001 From: Mingming Liu Date: Fri, 6 Sep 2024 16:38:17 -0700 Subject: [NFCI]Remove EntryCount from FunctionSummary and clean up surrounding synthetic count passes. (#107471) The primary motivation is to remove `EntryCount` from `FunctionSummary`. This frees 8 bytes out of `sizeof(FunctionSummary)` (136 bytes as of https://github.com/llvm/llvm-project/commit/64498c54831bed9cf069e0923b9b73678c6451d8). While I'm at it, this PR clean up {SummaryBasedOptimizations, SyntheticCountsPropagation} since they were not used and there are no plans to further invest on them. With this patch, bitcode writer writes a placeholder 0 at the byte offset of `EntryCount` and bitcode reader can parse the function entry count at the correct byte offset. Added a TODO to stop writing `EntryCount` and bump bitcode version --- llvm/lib/Bitcode/Reader/BitcodeReader.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'llvm/lib/Bitcode/Reader/BitcodeReader.cpp') diff --git a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp index e52757f..250ba42 100644 --- a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp +++ b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp @@ -7686,8 +7686,8 @@ Error ModuleSummaryIndexBitcodeReader::parseEntireSummary(unsigned ID) { PendingAllocs.clear(); } auto FS = std::make_unique( - Flags, InstCount, getDecodedFFlags(RawFunFlags), /*EntryCount=*/0, - std::move(Refs), std::move(Calls), std::move(PendingTypeTests), + Flags, InstCount, getDecodedFFlags(RawFunFlags), std::move(Refs), + std::move(Calls), std::move(PendingTypeTests), std::move(PendingTypeTestAssumeVCalls), std::move(PendingTypeCheckedLoadVCalls), std::move(PendingTypeTestAssumeConstVCalls), @@ -7832,8 +7832,8 @@ Error ModuleSummaryIndexBitcodeReader::parseEntireSummary(unsigned ID) { ValueInfo VI = std::get<0>(getValueInfoFromValueId(ValueID)); setSpecialRefs(Refs, NumRORefs, NumWORefs); auto FS = std::make_unique( - Flags, InstCount, getDecodedFFlags(RawFunFlags), EntryCount, - std::move(Refs), std::move(Edges), std::move(PendingTypeTests), + Flags, InstCount, getDecodedFFlags(RawFunFlags), std::move(Refs), + std::move(Edges), std::move(PendingTypeTests), std::move(PendingTypeTestAssumeVCalls), std::move(PendingTypeCheckedLoadVCalls), std::move(PendingTypeTestAssumeConstVCalls), -- cgit v1.1