[llvm] r283852 - Tune isHotFunction/isColdFunction

Dehao Chen via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 10 22:19:00 PDT 2016


Author: dehao
Date: Tue Oct 11 00:19:00 2016
New Revision: 283852

URL: http://llvm.org/viewvc/llvm-project?rev=283852&view=rev
Log:
Tune isHotFunction/isColdFunction

Summary: This patch sets function as hot if function's entry count is hot/cold.

Reviewers: eraman, davidxl

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D25048

Modified:
    llvm/trunk/lib/Analysis/ProfileSummaryInfo.cpp

Modified: llvm/trunk/lib/Analysis/ProfileSummaryInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ProfileSummaryInfo.cpp?rev=283852&r1=283851&r2=283852&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/ProfileSummaryInfo.cpp (original)
+++ llvm/trunk/lib/Analysis/ProfileSummaryInfo.cpp Tue Oct 11 00:19:00 2016
@@ -74,9 +74,7 @@ bool ProfileSummaryInfo::isFunctionEntry
   // FIXME: The heuristic used below for determining hotness is based on
   // preliminary SPEC tuning for inliner. This will eventually be a
   // convenience method that calls isHotCount.
-  return (FunctionCount &&
-          FunctionCount.getValue() >=
-              (uint64_t)(0.3 * (double)Summary->getMaxFunctionCount()));
+  return FunctionCount && isHotCount(FunctionCount.getValue());
 }
 
 /// Returns true if the function's entry is a cold. If it returns false, it
@@ -95,9 +93,7 @@ bool ProfileSummaryInfo::isFunctionEntry
   // FIXME: The heuristic used below for determining coldness is based on
   // preliminary SPEC tuning for inliner. This will eventually be a
   // convenience method that calls isHotCount.
-  return (FunctionCount &&
-          FunctionCount.getValue() <=
-              (uint64_t)(0.01 * (double)Summary->getMaxFunctionCount()));
+  return FunctionCount && isColdCount(FunctionCount.getValue());
 }
 
 /// Compute the hot and cold thresholds.




More information about the llvm-commits mailing list