summaryrefslogtreecommitdiff
path: root/gcc/cgraph.c
diff options
context:
space:
mode:
authorJan Hubicka <hubicka@ucw.cz>2017-11-23 16:59:07 +0100
committerJan Hubicka <hubicka@gcc.gnu.org>2017-11-23 15:59:07 +0000
commit7349698ee4147cf36862081e21736d4c2b96b9d9 (patch)
tree535b11fd8653e7e3108910ce67f9a0965e43310a /gcc/cgraph.c
parent0009a6c3c7d7c9c31d253558b602c35d3ad51d1b (diff)
downloadgcc-7349698ee4147cf36862081e21736d4c2b96b9d9.tar.gz
ipa-profile.c (ipa_propagate_frequency_1): Use count instead of frequency.
* ipa-profile.c (ipa_propagate_frequency_1): Use count instead of frequency. * cgraph.c (cgraph_edge::dump_edge_flags): Dump sreal frequencies. (cgraph_edge::maybe_hot_p): Use sreal frequencies. From-SVN: r255104
Diffstat (limited to 'gcc/cgraph.c')
-rw-r--r--gcc/cgraph.c18
1 files changed, 6 insertions, 12 deletions
diff --git a/gcc/cgraph.c b/gcc/cgraph.c
index 69eb9bb2341..7ac58ce91c1 100644
--- a/gcc/cgraph.c
+++ b/gcc/cgraph.c
@@ -2024,7 +2024,7 @@ cgraph_edge::dump_edge_flags (FILE *f)
fprintf (f, "(");
count.dump (f);
fprintf (f, ",");
- fprintf (f, "%.2f per call) ", frequency () / (double)CGRAPH_FREQ_BASE);
+ fprintf (f, "%.2f per call) ", sreal_frequency ().to_double ());
}
if (can_throw_external)
fprintf (f, "(can throw external) ");
@@ -2811,15 +2811,11 @@ cgraph_edge::maybe_hot_p (void)
if (symtab->state < IPA_SSA)
return true;
if (caller->frequency == NODE_FREQUENCY_EXECUTED_ONCE
- && frequency () < CGRAPH_FREQ_BASE * 3 / 2)
+ && sreal_frequency () * 2 < 3)
+ return false;
+ if (PARAM_VALUE (HOT_BB_FREQUENCY_FRACTION) == 0
+ || sreal_frequency () * PARAM_VALUE (HOT_BB_FREQUENCY_FRACTION) <= 1)
return false;
- if (opt_for_fn (caller->decl, flag_guess_branch_prob))
- {
- if (PARAM_VALUE (HOT_BB_FREQUENCY_FRACTION) == 0
- || frequency () <= (CGRAPH_FREQ_BASE
- / PARAM_VALUE (HOT_BB_FREQUENCY_FRACTION)))
- return false;
- }
return true;
}
@@ -3880,9 +3876,7 @@ cgraph_node::has_thunk_p (cgraph_node *node, void *)
return false;
}
-/* Expected frequency of executions within the function.
- When set to CGRAPH_FREQ_BASE, the edge is expected to be called once
- per function call. The range is 0 to CGRAPH_FREQ_MAX. */
+/* Expected frequency of executions within the function. */
sreal
cgraph_edge::sreal_frequency ()