[PATCH] D100090: [CSSPGO] Fix dangling context strings and improve profile order consistency and error handling

Wenlei He via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 8 10:35:22 PDT 2021


wenlei added inline comments.


================
Comment at: llvm/lib/ProfileData/SampleProf.cpp:385
+    assert(Ret.second && "Conext conflict during canonicalization");
+    FProfile = Ret.first->second;
+
----------------
hoy wrote:
> For a profile whose key is different from the profile name string, are there other profiles merged into it, or is it merged into other profiles? A comment could be helpful.
It could be a profile from context merging, see line 358. For pre-inliner, it could also be promoted context profile without merging. Will add comment.


================
Comment at: llvm/lib/ProfileData/SampleProfWriter.cpp:503
   for (auto N : V) {
     OS << N;
     encodeULEB128(0, OS);
----------------
hoy wrote:
> Can brackets be output here instead of adding it to name table and looking it up there?
Not every name needs bracket. One example is the call target name for call sites. If we do it here, we can't differentiate between such cases and the full context names used in profile header. 


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D100090



More information about the llvm-commits mailing list