diff options
author | Aaron Ballman <aaron@aaronballman.com> | 2023-07-28 09:39:08 -0400 |
---|---|---|
committer | Aaron Ballman <aaron@aaronballman.com> | 2023-07-28 09:41:38 -0400 |
commit | 1a53b5c367b5ebf7d7f34afaa653ea337982f1d6 (patch) | |
tree | ab1cdc76af3ead1292fc8587669700271952b431 /llvm/lib/ProfileData/SampleProfWriter.cpp | |
parent | 7ca6b7693433955ab28cbc5225bcb16a19fd53f4 (diff) | |
download | llvm-1a53b5c367b5ebf7d7f34afaa653ea337982f1d6.zip llvm-1a53b5c367b5ebf7d7f34afaa653ea337982f1d6.tar.gz llvm-1a53b5c367b5ebf7d7f34afaa653ea337982f1d6.tar.bz2 |
Revert "[llvm-profdata] Refactoring Sample Profile Reader to increase FDO build speed using MD5 as key to Sample Profile map"
This reverts commit 66ba71d913df7f7cd75e92c0c4265932b7c93292.
Addressing issues found by:
https://lab.llvm.org/buildbot/#/builders/245/builds/11732
https://lab.llvm.org/buildbot/#/builders/187/builds/12251
https://lab.llvm.org/buildbot/#/builders/186/builds/11099
https://lab.llvm.org/buildbot/#/builders/182/builds/6976
Diffstat (limited to 'llvm/lib/ProfileData/SampleProfWriter.cpp')
-rw-r--r-- | llvm/lib/ProfileData/SampleProfWriter.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/ProfileData/SampleProfWriter.cpp b/llvm/lib/ProfileData/SampleProfWriter.cpp index f418dbe..0873093 100644 --- a/llvm/lib/ProfileData/SampleProfWriter.cpp +++ b/llvm/lib/ProfileData/SampleProfWriter.cpp @@ -357,13 +357,14 @@ std::error_code SampleProfileWriterExtBinaryBase::writeNameTable() { encodeULEB128(NameTable.size(), OS); support::endian::Writer Writer(OS, support::little); for (auto N : V) - Writer.write(hashFuncName(N)); + Writer.write(MD5Hash(N)); return sampleprof_error::success; } std::error_code SampleProfileWriterExtBinaryBase::writeNameTableSection( const SampleProfileMap &ProfileMap) { for (const auto &I : ProfileMap) { + assert(I.first == I.second.getContext() && "Inconsistent profile map"); addContext(I.second.getContext()); addNames(I.second); } @@ -725,7 +726,8 @@ SampleProfileWriterBinary::writeHeader(const SampleProfileMap &ProfileMap) { // Generate the name table for all the functions referenced in the profile. for (const auto &I : ProfileMap) { - addContext(I.second.getContext()); + assert(I.first == I.second.getContext() && "Inconsistent profile map"); + addContext(I.first); addNames(I.second); } |