[PATCH] D108147: [SamplePGO][NFC] Dump function profiles in order
Wenlei He via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Aug 16 10:52:49 PDT 2021
wenlei added inline comments.
================
Comment at: llvm/lib/ProfileData/SampleProfReader.cpp:69-82
+ // Sort the ProfileMap by total samples.
+ typedef std::pair<StringRef, const FunctionSamples *> NameFunctionSamples;
+ std::vector<NameFunctionSamples> V;
+ for (const auto &I : Profiles) {
+ assert(I.getKey() == I.second.getNameWithContext() &&
+ "Inconsistent profile map");
+ V.push_back(std::make_pair(I.second.getNameWithContext(), &I.second));
----------------
This is duplicated of the sorting in `SampleProfileWriter::writeFuncProfiles`. Can we make a standalone helper in SampleProf.h to avoid duplicate?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D108147/new/
https://reviews.llvm.org/D108147
More information about the llvm-commits
mailing list