by xstrdup_for_dump. */
static const char *
-dump_probability (int value)
+dump_probability (int frequency, profile_count &count)
{
float minimum = 0.01f;
- gcc_assert (0 <= value && value <= REG_BR_PROB_BASE);
- float fvalue = value * 100.0f / REG_BR_PROB_BASE;
- if (fvalue < minimum && value > 0)
+ gcc_assert (0 <= frequency && frequency <= REG_BR_PROB_BASE);
+ float fvalue = frequency * 100.0f / REG_BR_PROB_BASE;
+ if (fvalue < minimum && frequency > 0)
return "[0.01%]";
char *buf;
- asprintf (&buf, "[%.2f%%]", fvalue);
+ if (count.initialized_p ())
+ asprintf (&buf, "[%.2f%%] [count: %" PRId64 "]", fvalue,
+ count.to_gcov_type ());
+ else
+ asprintf (&buf, "[%.2f%%] [count: INV]", fvalue);
+
const char *ret = xstrdup_for_dump (buf);
free (buf);
static void
dump_edge_probability (pretty_printer *buffer, edge e)
{
- pp_scalar (buffer, " %s", dump_probability (e->probability));
+ pp_scalar (buffer, " %s", dump_probability (e->probability, e->count));
}
/* Print GIMPLE statement G to FILE using SPC indentation spaces and
dump_generic_node (buffer, label, spc, flags, false);
basic_block bb = gimple_bb (gs);
if (bb && !(flags & TDF_GIMPLE))
- pp_scalar (buffer, " %s", dump_probability (bb->frequency));
+ pp_scalar (buffer, " %s", dump_probability (bb->frequency, bb->count));
pp_colon (buffer);
}
if (flags & TDF_GIMPLE)
fprintf (outf, "%*sbb_%d:\n", indent, "", bb->index);
else
fprintf (outf, "%*s<bb %d> %s:\n",
- indent, "", bb->index, dump_probability (bb->frequency));
+ indent, "", bb->index, dump_probability (bb->frequency,
+ bb->count));
}
}
}
/* Only conditional calls to must_not_eliminate must be made (with
any probability):
- { dg-final { scan-tree-dump-times "> \\\[\[0-9.\]+%\\\]:\n *must_not_eliminate" 127 "optimized" { target { ilp32 || lp64 } } } }
- { dg-final { scan-tree-dump-times "> \\\[\[0-9.\]+%\\\]:\n *must_not_eliminate" 96 "optimized" { target { { ! ilp32 } && { ! lp64 } } } } }
+ { dg-final { scan-tree-dump-times "> \\\[\[0-9.\]+%\\\]\\ \\\[count:\\[^:\\]*\\\]:\n *must_not_eliminate" 127 "optimized" { target { ilp32 || lp64 } } } }
+ { dg-final { scan-tree-dump-times "> \\\[\[0-9.\]+%\\\]\\ \\\[count:\\[^:\\]*\\\]:\n *must_not_eliminate" 96 "optimized" { target { { ! ilp32 } && { ! lp64 } } } } }
No unconditional calls to abort should be made:
{ dg-final { scan-tree-dump-not ";\n *must_not_eliminate" "optimized" } } */