public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* Simple change in dot dumper -- Display profile count and branch probability
@ 2013-04-21 20:36 Xinliang David Li
  2013-04-21 20:54 ` Steven Bosscher
  0 siblings, 1 reply; 6+ messages in thread
From: Xinliang David Li @ 2013-04-21 20:36 UTC (permalink / raw)
  To: GCC Patches

Hi, the graph dump file currently does not show any profile
information. The following simple patch fixed that.  Ok for trunk?

thanks,

David

2013-04-20  Xinliang David Li  <davidxl@google.com>

        * graph.c (draw_cfg_node): Add count and frequency info.
        (draw_cfg_node_succ_edges): Add branch probility as label.

Index: graph.c
===================================================================
--- graph.c     (revision 198108)
+++ graph.c     (working copy)
@@ -110,6 +110,9 @@ draw_cfg_node (pretty_printer *pp, int f
   else
     {
       pp_character (pp, '{');
+      if (bb->count)
+       pp_printf (pp, "COUNT:" HOST_WIDEST_INT_PRINT_DEC, bb->count);
+      pp_printf (pp, " FREQ:%i |", bb->frequency);
       pp_write_text_to_stream (pp);
       dump_bb_for_graph (pp, bb);
       pp_character (pp, '}');
@@ -155,11 +158,12 @@ draw_cfg_node_succ_edges (pretty_printer

       pp_printf (pp,
                 "\tfn_%d_basic_block_%d:s -> fn_%d_basic_block_%d:n "
-                "[style=%s,color=%s,weight=%d,constraint=%s];\n",
+                "[style=%s,color=%s,weight=%d,constraint=%s,
label=\"[%i%%]\"];\n",
                 funcdef_no, e->src->index,
                 funcdef_no, e->dest->index,
                 style, color, weight,
-                (e->flags & (EDGE_FAKE | EDGE_DFS_BACK)) ? "false" : "true");
+                (e->flags & (EDGE_FAKE | EDGE_DFS_BACK)) ? "false" : "true",
+                e->probability * 100 / REG_BR_PROB_BASE);
     }
   pp_flush (pp);
 }

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-04-23  8:52 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-04-21 20:36 Simple change in dot dumper -- Display profile count and branch probability Xinliang David Li
2013-04-21 20:54 ` Steven Bosscher
2013-04-21 21:17   ` Xinliang David Li
2013-04-22 20:36     ` Diego Novillo
2013-04-23  9:06       ` Xinliang David Li
2013-04-23 10:15         ` Richard Biener

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).