This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Print out profile decisions
- From: Jan Hubicka <jh at suse dot cz>
- To: gcc-patches at gcc dot gnu dot org, rth at cygnus dot com
- Date: Thu, 23 May 2002 19:21:53 +0200
- Subject: Print out profile decisions
Hi,
I've found usefull following two chagnes to debug bug in the new profile
predicates. As I hope that we will find much more places to use them, I
would like to have them dumped.
Thu May 23 19:19:54 CEST 2002 Jan Hubicka <jh@suse.cz>
* cfg.c (dump_flow_info): Print results of
maybe_hot/probably_never_executed predicates.
* toplev.c (open_dump_file): Print function frequency.
? e
Index: cfg.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cfg.c,v
retrieving revision 1.28
diff -c -3 -p -r1.28 cfg.c
*** cfg.c 22 May 2002 01:27:33 -0000 1.28
--- cfg.c 23 May 2002 17:16:45 -0000
*************** dump_flow_info (file)
*** 552,558 ****
bb->prev_bb->index, bb->next_bb->index);
fprintf (file, "loop_depth %d, count ", bb->loop_depth);
fprintf (file, HOST_WIDEST_INT_PRINT_DEC, bb->count);
! fprintf (file, ", freq %i.\n", bb->frequency);
fprintf (file, "Predecessors: ");
for (e = bb->pred; e; e = e->pred_next)
--- 552,563 ----
bb->prev_bb->index, bb->next_bb->index);
fprintf (file, "loop_depth %d, count ", bb->loop_depth);
fprintf (file, HOST_WIDEST_INT_PRINT_DEC, bb->count);
! fprintf (file, ", freq %i", bb->frequency);
! if (maybe_hot_bb_p (bb))
! fprintf (file, ", maybe hot");
! if (probably_never_executed_bb_p (bb))
! fprintf (file, ", probably never executed");
! fprintf (file, ".\n", bb->frequency);
fprintf (file, "Predecessors: ");
for (e = bb->pred; e; e = e->pred_next)
Index: toplev.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/toplev.c,v
retrieving revision 1.631
diff -c -3 -p -r1.631 toplev.c
*** toplev.c 23 May 2002 12:04:45 -0000 1.631
--- toplev.c 23 May 2002 17:16:51 -0000
*************** open_dump_file (index, decl)
*** 1787,1794 ****
free (dump_name);
if (decl)
! fprintf (rtl_dump_file, "\n;; Function %s\n\n",
! (*lang_hooks.decl_printable_name) (decl, 2));
timevar_pop (TV_DUMP);
return 1;
--- 1787,1799 ----
free (dump_name);
if (decl)
! fprintf (rtl_dump_file, "\n;; Function %s%s\n\n",
! (*lang_hooks.decl_printable_name) (decl, 2),
! cfun->function_frequency == FUNCTION_FREQUENCY_HOT
! ? " (hot)"
! : cfun->function_frequency == FUNCTION_FREQUENCY_UNLIKELY_EXECUTED
! ? " (unlikely executed)"
! : "");
timevar_pop (TV_DUMP);
return 1;