[PATCH] D127026: [CSSPGO][llvm-profgen] Reimplement computeSummaryAndThreshold using context trie

Hongtao Yu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 9 22:15:20 PDT 2022


hoy added inline comments.


================
Comment at: llvm/tools/llvm-profgen/ProfileGenerator.cpp:442
 
+void ProfileGenerator::collectPFForLLVMSampleProfile(
+    std::unordered_set<const BinaryFunction *> &ProfiledFunctions) {
----------------
Sorry for not making it clear. Can we do something like below? Basically keep the original `collectProfiledFunctions` as is and add a new override for CSProfileGenerator.


```
void ProfileGeneratorBase::collectProfiledFunctions() {
  std::unordered_set<const BinaryFunction *> ProfiledFunctions;
  if (SampleCounters) {
     ....
  } else if (!ProfileMap.empty())
     ....
  }
  Binary->setProfiledFunctions(ProfiledFunctions);
}

void CSProfileGenerator::collectProfiledFunctions() {
  deal with ContextTrieNode;
  Binary->setProfiledFunctions(ProfiledFunctions);
}
```




Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D127026



More information about the llvm-commits mailing list