OSDN Git Service

* ipa-inline.c (cgraph_maybe_hot_edge_p): Look for hot/cold attributes,
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 14 Mar 2007 01:26:00 +0000 (01:26 +0000)
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 14 Mar 2007 01:26:00 +0000 (01:26 +0000)
when profile esitmate is present, calls with very low frequency are
cold.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@122898 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/ipa-inline.c

index 1a40c6f..b90b689 100644 (file)
@@ -1,3 +1,9 @@
+2007-03-13  Jan Hubicka  <jh@suse.cz>
+
+       * ipa-inline.c (cgraph_maybe_hot_edge_p): Look for hot/cold attributes,
+       when profile esitmate is present, calls with very low frequency are
+       cold.
+
 2007-03-13  Zdenek Dvorak  <dvorakz@suse.cz>
 
        PR tree-optimization/30730
index 67ca5fd..04306aa 100644 (file)
@@ -472,6 +472,15 @@ cgraph_maybe_hot_edge_p (struct cgraph_edge *edge)
       && (edge->count
          <= profile_info->sum_max / PARAM_VALUE (HOT_BB_COUNT_FRACTION)))
     return false;
+  if (lookup_attribute ("cold", DECL_ATTRIBUTES (edge->callee->decl))
+      || lookup_attribute ("cold", DECL_ATTRIBUTES (edge->caller->decl)))
+    return false;
+  if (lookup_attribute ("hot", DECL_ATTRIBUTES (edge->caller->decl)))
+    return true;
+  if (flag_guess_branch_prob
+      && edge->frequency < (CGRAPH_FREQ_MAX
+                           / PARAM_VALUE (HOT_BB_FREQUENCY_FRACTION)))
+    return false;
   return true;
 }