diff options
author | Mingming Liu <mingmingl@google.com> | 2024-09-06 16:38:17 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-06 16:38:17 -0700 |
commit | d4ddf06b0c7f38612f334db71ef1d7a58a3cc8e0 (patch) | |
tree | d2a2858eb6caa0fa9ae46e6cda80994bf92ee158 /llvm/lib/Bitcode/Writer/BitcodeWriter.cpp | |
parent | 3a13c5a2862fdc957d751a7679581d5da151efc2 (diff) | |
download | llvm-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/Bitcode/Writer/BitcodeWriter.cpp')
-rw-r--r-- | llvm/lib/Bitcode/Writer/BitcodeWriter.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp index bf2eea5..1aeaf095 100644 --- a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp +++ b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp @@ -4740,7 +4740,8 @@ void IndexBitcodeWriter::writeCombinedGlobalValueSummary() { getEncodedGVSummaryFlags(FS->flags(), shouldImportValueAsDecl(FS))); NameVals.push_back(FS->instCount()); NameVals.push_back(getEncodedFFlags(FS->fflags())); - NameVals.push_back(FS->entryCount()); + // TODO: Stop writing entry count and bump bitcode version. + NameVals.push_back(0 /* EntryCount */); // Fill in below NameVals.push_back(0); // numrefs |