aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Analysis/ModuleSummaryAnalysis.cpp
diff options
context:
space:
mode:
authorMingming Liu <mingmingl@google.com>2024-09-06 16:38:17 -0700
committerGitHub <noreply@github.com>2024-09-06 16:38:17 -0700
commitd4ddf06b0c7f38612f334db71ef1d7a58a3cc8e0 (patch)
treed2a2858eb6caa0fa9ae46e6cda80994bf92ee158 /llvm/lib/Analysis/ModuleSummaryAnalysis.cpp
parent3a13c5a2862fdc957d751a7679581d5da151efc2 (diff)
downloadllvm-d4ddf06b0c7f38612f334db71ef1d7a58a3cc8e0.zip
llvm-d4ddf06b0c7f38612f334db71ef1d7a58a3cc8e0.tar.gz
llvm-d4ddf06b0c7f38612f334db71ef1d7a58a3cc8e0.tar.bz2
[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
Diffstat (limited to 'llvm/lib/Analysis/ModuleSummaryAnalysis.cpp')
-rw-r--r--llvm/lib/Analysis/ModuleSummaryAnalysis.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/Analysis/ModuleSummaryAnalysis.cpp b/llvm/lib/Analysis/ModuleSummaryAnalysis.cpp
index 39e7926..95ef97a 100644
--- a/llvm/lib/Analysis/ModuleSummaryAnalysis.cpp
+++ b/llvm/lib/Analysis/ModuleSummaryAnalysis.cpp
@@ -673,9 +673,9 @@ static void computeFunctionSummary(
if (auto *SSI = GetSSICallback(F))
ParamAccesses = SSI->getParamAccesses(Index);
auto FuncSummary = std::make_unique<FunctionSummary>(
- Flags, NumInsts, FunFlags, /*EntryCount=*/0, std::move(Refs),
- CallGraphEdges.takeVector(), TypeTests.takeVector(),
- TypeTestAssumeVCalls.takeVector(), TypeCheckedLoadVCalls.takeVector(),
+ Flags, NumInsts, FunFlags, std::move(Refs), CallGraphEdges.takeVector(),
+ TypeTests.takeVector(), TypeTestAssumeVCalls.takeVector(),
+ TypeCheckedLoadVCalls.takeVector(),
TypeTestAssumeConstVCalls.takeVector(),
TypeCheckedLoadConstVCalls.takeVector(), std::move(ParamAccesses),
std::move(Callsites), std::move(Allocs));
@@ -963,7 +963,7 @@ ModuleSummaryIndex llvm::buildModuleSummaryIndex(
/* MayThrow */ true,
/* HasUnknownCall */ true,
/* MustBeUnreachable */ false},
- /*EntryCount=*/0, SmallVector<ValueInfo, 0>{},
+ SmallVector<ValueInfo, 0>{},
ArrayRef<FunctionSummary::EdgeTy>{},
ArrayRef<GlobalValue::GUID>{},
ArrayRef<FunctionSummary::VFuncId>{},