diff options
author | Jan Hubicka <hubicka@ucw.cz> | 2017-11-13 18:23:25 +0100 |
---|---|---|
committer | Jan Hubicka <hubicka@gcc.gnu.org> | 2017-11-13 17:23:25 +0000 |
commit | 41f0e8194de366399afb726a6862843d81f896a3 (patch) | |
tree | 6ecf459f42e8a834a49fe66dca8ae9575c9b5b31 /gcc/ipa-inline.c | |
parent | 8f2b097ed54816d28cd51254c8e4616404ae348e (diff) | |
download | gcc-41f0e8194de366399afb726a6862843d81f896a3.zip gcc-41f0e8194de366399afb726a6862843d81f896a3.tar.gz gcc-41f0e8194de366399afb726a6862843d81f896a3.tar.bz2 |
cgraph.c (cgraph_edge::sreal_frequency): New function.
* cgraph.c (cgraph_edge::sreal_frequency): New function.
* cgraph.h (cgraph_edge::sreal_frequency): Declare.
* ipa-fnsummary.c (dump_ipa_call_summary): Use sreal_frequency.
(estimate_edge_size_and_time): Likewise.
(ipa_merge_fn_summary_after_inlining): Likewise.
* ipa-inline.c (cgraph_freq_base_rec): Remove.
(compute_uninlined_call_time): Use sreal_frequency.
(compute_inlined_call_time): Likewise.
(ipa_inline): Do not initialize cgraph_freq_base_rec.
* profile-count.c: Include sreal.h.
(profile_count::to_sreal_scale): New.
* profile-count.h: Forward declare sreal.
(profile_count::to_sreal_scale): Declare.
From-SVN: r254696
Diffstat (limited to 'gcc/ipa-inline.c')
-rw-r--r-- | gcc/ipa-inline.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/gcc/ipa-inline.c b/gcc/ipa-inline.c index 3128f32..8a2fd4b 100644 --- a/gcc/ipa-inline.c +++ b/gcc/ipa-inline.c @@ -129,8 +129,8 @@ static int overall_size; static profile_count max_count; static profile_count spec_rem; -/* Pre-computed constants 1/CGRAPH_FREQ_BASE and 1/100. */ -static sreal cgraph_freq_base_rec, percent_rec; +/* Pre-computed constant 1/100. */ +static sreal percent_rec; /* Return false when inlining edge E would lead to violating limits on function unit growth or stack usage growth. @@ -644,8 +644,9 @@ compute_uninlined_call_time (struct cgraph_edge *edge, && caller->count.ipa ().nonzero_p ()) uninlined_call_time *= (sreal)edge->count.ipa ().to_gcov_type () / caller->count.ipa ().to_gcov_type (); - if (edge->frequency ()) - uninlined_call_time *= cgraph_freq_base_rec * edge->frequency (); + sreal freq = edge->sreal_frequency (); + if (freq != 0) + uninlined_call_time *= freq; else uninlined_call_time = uninlined_call_time >> 11; @@ -668,8 +669,9 @@ compute_inlined_call_time (struct cgraph_edge *edge, if (edge->count.ipa ().nonzero_p () && caller->count.ipa ().nonzero_p ()) time *= (sreal)edge->count.to_gcov_type () / caller->count.to_gcov_type (); - if (edge->frequency ()) - time *= cgraph_freq_base_rec * edge->frequency (); + sreal freq = edge->sreal_frequency (); + if (freq != 0) + time *= freq; else time = time >> 11; @@ -2390,7 +2392,6 @@ ipa_inline (void) int cold; bool remove_functions = false; - cgraph_freq_base_rec = (sreal) 1 / (sreal) CGRAPH_FREQ_BASE; percent_rec = (sreal) 1 / (sreal) 100; order = XCNEWVEC (struct cgraph_node *, symtab->cgraph_count); |