[PATCH] D98823: [CSSPGO] Add attribute metadata for context profile

Hongtao Yu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 18 09:38:36 PDT 2021


hoy added a comment.

Thanks for working on this. This gets us closer to a global inlining decision making for thinLTO.



================
Comment at: llvm/lib/ProfileData/SampleProfReader.cpp:91
 ///     !CFGChecksum: 12345
 /// Stores the FunctionHash (a.k.a. CFG Checksum) into \p FunctionHash.
+static bool parseMetadata(const StringRef &Input, uint64_t &FunctionHash,
----------------
Please update comment here and also the format comment at the beginning of SampleProfReader.h .


================
Comment at: llvm/tools/llvm-profgen/ProfileGenerator.cpp:556
         FunctionSamples &CallerProfile =
-            getFunctionProfileForContext(CallerContextId);
+            getFunctionProfileForContext(CallerContextId, true);
         CallerProfile.setFunctionHash(InlinerDesc->FuncHash);
----------------
Should caller profile be marked inlined? The callee was inlined into the caller, but the caller may not be inlined into caller's caller.


================
Comment at: llvm/tools/llvm-profgen/ProfileGenerator.cpp:630
+  return getFunctionProfileForLeafProbe(ContextStrStackCopy, FuncDesc,
+                                        WasLeafInlined);
 }
----------------
I'm wondering this should also be done for non-probe CS profile generation.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D98823



More information about the llvm-commits mailing list