From 4cdb798f6c9b2bb7090f9fa8101da6e34bd2e569 Mon Sep 17 00:00:00 2001 From: Jan Hubicka Date: Wed, 14 Mar 2007 02:26:00 +0100 Subject: [PATCH] ipa-inline.c (cgraph_maybe_hot_edge_p): Look for hot/cold attributes... * 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. From-SVN: r122898 --- gcc/ChangeLog | 6 ++++++ gcc/ipa-inline.c | 9 +++++++++ 2 files changed, 15 insertions(+) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 1a40c6f846e..b90b689e837 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2007-03-13 Jan Hubicka + + * 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 PR tree-optimization/30730 diff --git a/gcc/ipa-inline.c b/gcc/ipa-inline.c index 67ca5fdee24..04306aaa7e0 100644 --- a/gcc/ipa-inline.c +++ b/gcc/ipa-inline.c @@ -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; }