[PATCH] D32877: Restrict call metadata based hotness detection to Sample PGO mode

Dehao Chen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 5 15:23:42 PDT 2017


danielcdh added a comment.

In https://reviews.llvm.org/D32877#747667, @tejohnson wrote:

> In https://reviews.llvm.org/D32877#747647, @eraman wrote:
>
> > I feel the underlying problem here is the use of VP metadata to get counts in sample PGO mode.  Dehao, even when VP metadata is available, can we add branch_weights to the call? Then, only sample PGO will annotate branch weights to calls and that won't affect instrumented PGO.
>
>
> That sounds like potentially a good longer term change. But I'd still like for this to go in as an immediate fix for the issue, which is causing a noticeable impact on instrumentation PGO performance, and because there is no reason AFAIK for anything other than Sample PGO to need to look at call metadata for determining hotness.


Just to confirm, with https://reviews.llvm.org/D32773, we should have recovered all the instrumented PGO performance, isn't it?



================
Comment at: lib/Analysis/ProfileSummaryInfo.cpp:88
+  else if (auto Kind = getKind(Inst->getModule()))
+    IsSamplePGO = Kind.getValue() == ProfileSummary::PSK_Sample;
+  if (IsSamplePGO) {
----------------
Looks like you can always get the Kind from Inst, why would you want to pass in the Summary?


https://reviews.llvm.org/D32877





More information about the llvm-commits mailing list