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

David Li via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 19 16:51:05 PST 2016


davidxl added inline comments.

================
Comment at: include/llvm/ProfileData/ProfileCommon.h:73
@@ +72,3 @@
+  // \brief Returns true if profile is available.
+  static bool hasProfile();
+  // \brief Returns true if F is a hot function.
----------------
If it is used to indicate profile availability at program level, it should take Module as argument.

================
Comment at: lib/ProfileData/ProfileSummary.cpp:99
@@ +98,3 @@
+  if (!F->getEntryCount()) {
+    return true;
+  }
----------------
Should return false -- as we don't know (no profile data)

================
Comment at: lib/ProfileData/ProfileSummary.cpp:102
@@ +101,3 @@
+  // FIXME: update when summary data is stored in module's metadata.
+  return (*F->getEntryCount()) == 0;
+}
----------------
This will work well for instr profile but may produce false positive for sampleFDO -- this will be fixed when summary based computation is used.


http://reviews.llvm.org/D17460





More information about the llvm-commits mailing list