+2017-11-23 Jan Hubicka <hubicka@ucw.cz>
+
+ * 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.
+
2017-11-23 Jan Hubicka <hubicka@ucw.cz>
* ipa-fnsummary.c (record_modified_bb_info): Use sreal
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) ");
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;
}
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 ()
&& edge->caller->global.inlined_to->frequency
!= NODE_FREQUENCY_UNLIKELY_EXECUTED)))
d->maybe_unlikely_executed = false;
- if (!edge->frequency ())
+ if (edge->count.initialized_p () && !edge->count.nonzero_p ())
continue;
switch (edge->caller->frequency)
{