From 3518424d4bf6a9654c7fea7f046ed839e888b1d6 Mon Sep 17 00:00:00 2001 From: Martin Liska Date: Tue, 29 Oct 2019 09:44:52 +0100 Subject: Print header in dump_memory_report. 2019-10-29 Martin Liska * cgraphunit.c (symbol_table::compile): Pass title as dump_memory_report argument. * toplev.c (dump_memory_report): New argument. (finalize): Pass new argument. * toplev.h (dump_memory_report): Add argument. 2019-10-29 Martin Liska * lto.c (do_whole_program_analysis): Pass title as dump_memory_report argument. From-SVN: r277559 --- gcc/ChangeLog | 8 ++++++++ gcc/cgraphunit.c | 10 ++-------- gcc/lto/ChangeLog | 5 +++++ gcc/lto/lto.c | 12 +++--------- gcc/toplev.c | 13 +++++++++++-- gcc/toplev.h | 3 ++- 6 files changed, 31 insertions(+), 20 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 6f5c26e..51097bb 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,13 @@ 2019-10-29 Martin Liska + * cgraphunit.c (symbol_table::compile): Pass + title as dump_memory_report argument. + * toplev.c (dump_memory_report): New argument. + (finalize): Pass new argument. + * toplev.h (dump_memory_report): Add argument. + +2019-10-29 Martin Liska + * ggc-common.c: Move Leak to the first column. 2019-10-29 Martin Liska diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c index 9873b9b..6ec2443 100644 --- a/gcc/cgraphunit.c +++ b/gcc/cgraphunit.c @@ -2602,10 +2602,7 @@ symbol_table::compile (void) timevar_push (TV_CGRAPHOPT); if (pre_ipa_mem_report) - { - fprintf (stderr, "Memory consumption before IPA\n"); - dump_memory_report (); - } + dump_memory_report ("Memory consumption before IPA"); if (!quiet_flag) fprintf (stderr, "Performing interprocedural optimizations\n"); state = IPA; @@ -2637,10 +2634,7 @@ symbol_table::compile (void) symtab->dump (dump_file); } if (post_ipa_mem_report) - { - fprintf (stderr, "Memory consumption after IPA\n"); - dump_memory_report (); - } + dump_memory_report ("Memory consumption after IPA"); timevar_pop (TV_CGRAPHOPT); /* Output everything. */ diff --git a/gcc/lto/ChangeLog b/gcc/lto/ChangeLog index 2aefc36..3592dda 100644 --- a/gcc/lto/ChangeLog +++ b/gcc/lto/ChangeLog @@ -1,5 +1,10 @@ 2019-10-29 Martin Liska + * lto.c (do_whole_program_analysis): Pass + title as dump_memory_report argument. + +2019-10-29 Martin Liska + * lto.c (do_whole_program_analysis): Remove argument. 2019-10-24 Jan Hubicka diff --git a/gcc/lto/lto.c b/gcc/lto/lto.c index 5dca73f..27ea341 100644 --- a/gcc/lto/lto.c +++ b/gcc/lto/lto.c @@ -455,10 +455,7 @@ do_whole_program_analysis (void) timevar_push (TV_WHOPR_WPA); if (pre_ipa_mem_report) - { - fprintf (stderr, "Memory consumption before IPA\n"); - dump_memory_report (); - } + dump_memory_report ("Memory consumption before IPA"); symtab->function_flags_ready = true; @@ -537,16 +534,13 @@ do_whole_program_analysis (void) timevar_stop (TV_PHASE_STREAM_OUT); if (post_ipa_mem_report) - { - fprintf (stderr, "Memory consumption after IPA\n"); - dump_memory_report (); - } + dump_memory_report ("Memory consumption after IPA"); /* Show the LTO report before launching LTRANS. */ if (flag_lto_report || (flag_wpa && flag_lto_report_wpa)) print_lto_report_1 (); if (mem_report_wpa) - dump_memory_report (); + dump_memory_report ("Final"); } /* Create artificial pointers for "omp declare target link" vars. */ diff --git a/gcc/toplev.c b/gcc/toplev.c index 8a152b8..00a5e83 100644 --- a/gcc/toplev.c +++ b/gcc/toplev.c @@ -1994,8 +1994,17 @@ target_reinit (void) } void -dump_memory_report () +dump_memory_report (const char *header) { + /* Print significant header. */ + fputc ('\n', stderr); + for (unsigned i = 0; i < 80; i++) + fputc ('#', stderr); + fprintf (stderr, "\n# %-77s#\n", header); + for (unsigned i = 0; i < 80; i++) + fputc ('#', stderr); + fputs ("\n\n", stderr); + dump_line_table_statistics (); ggc_print_statistics (); stringpool_statistics (); @@ -2058,7 +2067,7 @@ finalize (bool no_backend) } if (mem_report) - dump_memory_report (); + dump_memory_report ("Final"); if (profile_report) dump_profile_report (); diff --git a/gcc/toplev.h b/gcc/toplev.h index 91e3465..8814a5e 100644 --- a/gcc/toplev.h +++ b/gcc/toplev.h @@ -66,7 +66,8 @@ extern bool wrapup_global_declarations (tree *, int); extern void global_decl_processing (void); -extern void dump_memory_report (); +extern void +dump_memory_report (const char *); extern void dump_profile_report (void); extern void target_reinit (void); -- cgit v1.1