[PATCH] D127031: [CSSPGO][llvm-profgen] Reimplement SampleContextTracker using context trie

Hongtao Yu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 6 10:50:07 PDT 2022


hoy added a comment.

Would be good to have some numbers for build time and memory usage in the summary.



================
Comment at: llvm/include/llvm/ProfileData/SampleProf.h:701
+  // by the path from root to this node.
+  ContextTrieNode *ContextNode;
   // State of the associated sample profile
----------------
The field is only useful during context manipulation. Is it possible to store the link in an auxiliary map whereever it is used?


================
Comment at: llvm/lib/Transforms/IPO/SampleContextTracker.cpp:93
       FSamples->getContext().setState(SyntheticContext);
-      LLVM_DEBUG(dbgs() << "  Context promoted to: "
-                        << FSamples->getContext().toString() << "\n");
----------------
may still be helpful to keep the debug dump?


================
Comment at: llvm/lib/Transforms/IPO/SampleContextTracker.cpp:209
     NewNode->setFunctionSamples(FSamples);
+    FSamples->setContextNode(NewNode);
+  }
----------------
Is this also done in `populateFuncToCtxtMap`?


================
Comment at: llvm/lib/Transforms/IPO/SampleContextTracker.cpp:470
+SampleContextTracker::getContextString(ContextTrieNode *Node) const {
+  SmallVector<SampleContextFrame, 10> Res;
+  if (Node == &RootContext)
----------------
nit: use SampleContextFrameVector


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D127031



More information about the llvm-commits mailing list