[PATCH] D17460: Add prefix based function layout when profile is available.

Dehao Chen via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 19 17:09:01 PST 2016


danielcdh marked an inline comment as done.

================
Comment at: lib/ProfileData/ProfileSummary.cpp:99
@@ +98,3 @@
+  if (!F->getEntryCount()) {
+    return true;
+  }
----------------
davidxl wrote:
> Should return false -- as we don't know (no profile data)
For AutoFDO, F->setEntryCount() is only called when there is sample in that function. So for those 0-sampled functions, F->getEntryCount() will be false.

================
Comment at: lib/ProfileData/ProfileSummary.cpp:102
@@ +101,3 @@
+  // FIXME: update when summary data is stored in module's metadata.
+  return (*F->getEntryCount()) == 0;
+}
----------------
davidxl wrote:
> This will work well for instr profile but may produce false positive for sampleFDO -- this will be fixed when summary based computation is used.
Yes, but we can always set entry-count as no less than 1 if the function has profile. Otherwise we have no way to calculate bb counts.


http://reviews.llvm.org/D17460





More information about the llvm-commits mailing list