[PATCH] D146452: [AutoFDO] Use flattened profiles for profile staleness metrics

Hongtao Yu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 21 18:03:42 PDT 2023


hoy added inline comments.


================
Comment at: llvm/include/llvm/ProfileData/SampleProf.h:1288
+  ProfileConverter(SampleProfileMap &Profiles);
+  // CSProfileConverter converts a full context-sensitive flat sample profile
+  // into a nested context-sensitive sample profile.
----------------
davidxl wrote:
> Remove 'CS'
Update the comment correspondingly.


================
Comment at: llvm/include/llvm/ProfileData/SampleProf.h:1290
+  // into a nested context-sensitive sample profile.
   void convertProfiles();
   struct FrameNode {
----------------
nit: name it `convertCSProfiles` .


================
Comment at: llvm/include/llvm/ProfileData/SampleProf.h:1316
+
+  static void flattenProfile(SampleProfileMap &OutputProfiles,
+                             const SampleProfileMap &InputProfiles) {
----------------
nit: swap the parameter declarations


================
Comment at: llvm/lib/Transforms/IPO/SampleProfile.cpp:461
+
+  FunctionSamples *getSamplesFromFlatProfiles(const Function &F) {
+    StringRef CanonFName = FunctionSamples::getCanonicalFnName(F);
----------------
nit: name it `getFlattenedSamples`?


================
Comment at: llvm/lib/Transforms/IPO/SampleProfile.cpp:2088
+
+  if (FunctionSamples::ProfileIsCS) {
+    for (const auto &I : Reader.getProfiles())
----------------
Does it make sense to incorporate the CS path into `ProfileConverter::flattenProfile`?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D146452/new/

https://reviews.llvm.org/D146452



More information about the llvm-commits mailing list