This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Print BB frequencies and counts in "BLOCK X" tree dump
- From: Jan Hubicka <jh at suse dot cz>
- To: gcc-patches at gcc dot gnu dot org, rth at redhat dot com
- Date: Sun, 31 Jul 2005 11:22:44 +0200
- Subject: Print BB frequencies and counts in "BLOCK X" tree dump
Hi,
current tree dump contains edge probabilities and counts but not BB
frequencies making it bit challenging to second guess what is going
wrong with profile and also dificult to write testcases.
Bootstrapped/regtested i686-pc-gnu-linux, OK?
2005-07-31 Jan Hubicka <jh@suse.cz>
* pretty-print.h (pp_widest_integer): New macro.
* tree-pretty-print.c (dump_bb_header): Print BB frequencies and counts.
Index: pretty-print.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/pretty-print.h,v
retrieving revision 1.20
diff -c -3 -p -r1.20 pretty-print.h
*** pretty-print.h 30 Jun 2005 23:08:48 -0000 1.20
--- pretty-print.h 30 Jul 2005 22:11:35 -0000
*************** struct pretty_print_info
*** 269,274 ****
--- 269,276 ----
#define pp_decimal_int(PP, I) pp_scalar (PP, "%d", I)
#define pp_wide_integer(PP, I) \
pp_scalar (PP, HOST_WIDE_INT_PRINT_DEC, (HOST_WIDE_INT) I)
+ #define pp_widest_integer(PP, I) \
+ pp_scalar (PP, HOST_WIDEST_INT_PRINT_DEC, (HOST_WIDEST_INT) I)
#define pp_pointer(PP, P) pp_scalar (PP, "%p", P)
#define pp_identifier(PP, ID) pp_string (PP, ID)
Index: tree-pretty-print.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-pretty-print.c,v
retrieving revision 2.69
diff -c -3 -p -r2.69 tree-pretty-print.c
*** tree-pretty-print.c 20 Jul 2005 01:18:22 -0000 2.69
--- tree-pretty-print.c 30 Jul 2005 22:11:35 -0000
*************** dump_bb_header (pretty_printer *buffer,
*** 2247,2252 ****
--- 2247,2262 ----
INDENT (indent);
pp_string (buffer, "# BLOCK ");
pp_decimal_int (buffer, bb->index);
+ if (bb->frequency)
+ {
+ pp_string (buffer, " freq:");
+ pp_decimal_int (buffer, bb->frequency);
+ }
+ if (bb->count)
+ {
+ pp_string (buffer, " count:");
+ pp_widest_integer (buffer, bb->count);
+ }
if (flags & TDF_LINENO)
{