aboutsummaryrefslogtreecommitdiff
path: root/gcc/ipa-inline.c
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2007-03-14 02:26:00 +0100
committerJan Hubicka <hubicka@gcc.gnu.org>2007-03-14 01:26:00 +0000
commit4cdb798f6c9b2bb7090f9fa8101da6e34bd2e569 (patch)
tree28d05e9c63fc6bf9660113e9855dadadbcac190b /gcc/ipa-inline.c
parentb3ce5b6ed7924967c74d161950038d5eb044273e (diff)
downloadgcc-4cdb798f6c9b2bb7090f9fa8101da6e34bd2e569.zip
gcc-4cdb798f6c9b2bb7090f9fa8101da6e34bd2e569.tar.gz
gcc-4cdb798f6c9b2bb7090f9fa8101da6e34bd2e569.tar.bz2
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
Diffstat (limited to 'gcc/ipa-inline.c')
-rw-r--r--gcc/ipa-inline.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/gcc/ipa-inline.c b/gcc/ipa-inline.c
index 67ca5fd..04306aa 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;
}