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

Easwaran Raman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 10 17:51:28 PDT 2017


eraman added inline comments.


================
Comment at: lib/Analysis/ProfileSummaryInfo.cpp:80
          "We can only get profile count for call/invoke instruction.");
-  // Check if there is a profile metadata on the instruction. If it is present,
-  // determine hotness solely based on that.
-  uint64_t TotalCount;
-  if (Inst->extractProfTotalWeight(TotalCount))
-    return TotalCount;
+  if (Summary->getKind() == ProfileSummary::PSK_Sample) {
+    // In sample PGO mode, check if there is a profile metadata on the
----------------
I wonder if we should check if Summary is non-null and then the summary kind is PSK_Sample. There is one test case down below (inliner count update) where you had to attach the summary to the test case. Is there any reason the summary has to be present to get the count based on entry count and block frequency?


https://reviews.llvm.org/D32877





More information about the llvm-commits mailing list