[PATCH] D110864: [llvm-profgen] Ignore branch count against outline function

Lei Wang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 1 13:01:11 PDT 2021


wlei added inline comments.


================
Comment at: llvm/tools/llvm-profgen/ProfileGenerator.cpp:404
+    return false;
+  return CalleeName.find(".") != StringRef::npos;
+}
----------------
wlei wrote:
> hoy wrote:
> > Check against specific suffix here so that we don't overlook cases we are not aware of?
> So I guess you mean we can't assume here it covers all the outlined function case, right? I was thinking all the non-outlined cases are all handled by `getCanonicalFnName`.
If we have an outlined function here, say it's name is `foo.cold`, it's function body code is still count against `foo` because we use the name from debug table. so all the body samples are collected into `foo` 's FunctionSamples. This is the right way.

But for the head samples, here we used the name from symbol table, so if we count this, we will have a sample line like 
```
foo.cold:0:100
```
means the total_samples is zero and head samples is not.

So I'm wondering if we don't do anything for `populateBoundarySamples` and we have a post-process to trim all the FunctionSamples that headsamples is non-zero but total_samples is zero.

With this, I guess we won't overlook any cases. what do you think?




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

https://reviews.llvm.org/D110864



More information about the llvm-commits mailing list