[PATCH] D95547: [CSSPGO] Support of CS profiles in extended binary format.

Wei Mi via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 27 16:08:44 PST 2021


wmi added inline comments.


================
Comment at: llvm/include/llvm/ProfileData/SampleProf.h:442
   bool isBaseContext() const { return CallingContext.empty(); }
   StringRef getName() const { return Name; }
   StringRef getCallingContext() const { return CallingContext; }
----------------
Nit: I feel getNameWithoutContext is more straightforward.


================
Comment at: llvm/include/llvm/ProfileData/SampleProf.h:685-686
       GUIDToFuncNameMap = Other.GUIDToFuncNameMap;
-
+    if (Context.getNameWithContext(true).empty())
+      Context = Other.getContext();
     if (FunctionHash == 0) {
----------------
Is it possible for the two FunctionSamples candidates to have different non empty contexts?


================
Comment at: llvm/lib/ProfileData/SampleProfReader.cpp:547
+  SampleContext FContext(*FName);
+  Profiles[FContext] = FunctionSamples();
+  FunctionSamples &FProfile = Profiles[FContext];
----------------
This is unnecessary. The next statement will create the default entry if the key doesn't exist in the map.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D95547



More information about the llvm-commits mailing list