[PATCH] D25048: Tune isHotFunction/isColdFunction

Dehao Chen via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 28 14:57:24 PDT 2016


danielcdh created this revision.
danielcdh added reviewers: eraman, davidxl.
danielcdh added a subscriber: llvm-commits.

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

https://reviews.llvm.org/D25048

Files:
  lib/Analysis/ProfileSummaryInfo.cpp

Index: lib/Analysis/ProfileSummaryInfo.cpp
===================================================================
--- lib/Analysis/ProfileSummaryInfo.cpp
+++ lib/Analysis/ProfileSummaryInfo.cpp
@@ -75,8 +75,9 @@
   // 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()));
+          (FunctionCount.getValue() >=
+              (uint64_t)(0.3 * (double)Summary->getMaxFunctionCount()) ||
+           isHotCount(FunctionCount.getValue())));
 }
 
 // Returns true if the function is a cold function. If it returns false, it
@@ -96,8 +97,9 @@
   // 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()));
+          (FunctionCount.getValue() <=
+              (uint64_t)(0.01 * (double)Summary->getMaxFunctionCount()) ||
+           isColdCount(FunctionCount.getValue())));
 }
 
 // Compute the hot and cold thresholds.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D25048.72906.patch
Type: text/x-patch
Size: 1208 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160928/d16d266b/attachment.bin>


More information about the llvm-commits mailing list