[PATCH] D31950: SamplePGO: convert callsite samples map key from callsite_location to callsite_location+callee_name

Dehao Chen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 13 10:02:14 PDT 2017


danielcdh marked an inline comment as done.
danielcdh added inline comments.


================
Comment at: include/llvm/ProfileData/SampleProf.h:281
+    const FunctionSamples *R = nullptr;
+    for (const auto &NameFS : iter->second)
+      if (NameFS.second.getTotalSamples() >= MaxTotalSamples) {
----------------
davidxl wrote:
> What does this loop do?
If we cannot find exact match, use the FS with the max total count. Updated the code to add the comment. And also updated the function level comment.


================
Comment at: lib/Transforms/IPO/SampleProfile.cpp:597
+
+  if (const FunctionSamplesMap *M = FS->findFunctionSamplesMapAt(
+          LineLocation(getOffset(DIL), DIL->getBaseDiscriminator()))) {
----------------
davidxl wrote:
> early return when M == null.
Do you mean M->size() == 0? early return added for that condition.


https://reviews.llvm.org/D31950





More information about the llvm-commits mailing list