diff options
author | Andrew Pinski <apinski@marvell.com> | 2019-09-21 01:27:34 +0000 |
---|---|---|
committer | Andrew Pinski <apinski@marvell.com> | 2023-07-20 08:56:42 -0700 |
commit | 85a4e4f93ff251f206e9df3a0d47d5734ed328fc (patch) | |
tree | f20df9c53c12cccbb4d195cad9017e36f98a443a /gcc/combine.cc | |
parent | 70e46073910f2df3bd43decbfc530e16e59b3509 (diff) | |
download | gcc-85a4e4f93ff251f206e9df3a0d47d5734ed328fc.zip gcc-85a4e4f93ff251f206e9df3a0d47d5734ed328fc.tar.gz gcc-85a4e4f93ff251f206e9df3a0d47d5734ed328fc.tar.bz2 |
Move combine over to statistics_counter_event.
Since we have statistics_counter_event now, combine should use that
instead of it is own custom printing of statistics.
The only thing that is not done any more after this patch is printing
out the total stats for the whole TU.
Note you need to use -fdump-rtl-combine-stats to get the stats in the combine
dump unlike before where the stats was dumped directly into the file.
OK? Bootstrapped and tested on x86_64-linux-gnu with no regressions.
gcc/ChangeLog:
* combine.cc (dump_combine_stats): Remove.
(dump_combine_total_stats): Remove.
(total_attempts, total_merges, total_extras,
total_successes): Remove.
(combine_instructions): Don't increment total stats
instead use statistics_counter_event.
* dumpfile.cc (print_combine_total_stats): Remove.
* dumpfile.h (print_combine_total_stats): Remove.
(dump_combine_total_stats): Remove.
* passes.cc (finish_optimization_passes):
Don't call print_combine_total_stats.
* rtl.h (dump_combine_total_stats): Remove.
(dump_combine_stats): Remove.
Diffstat (limited to 'gcc/combine.cc')
-rw-r--r-- | gcc/combine.cc | 30 |
1 files changed, 4 insertions, 26 deletions
diff --git a/gcc/combine.cc b/gcc/combine.cc index d9161b2..4bf867d 100644 --- a/gcc/combine.cc +++ b/gcc/combine.cc @@ -108,10 +108,6 @@ static int combine_extras; static int combine_successes; -/* Totals over entire compilation. */ - -static int total_attempts, total_merges, total_extras, total_successes; - /* combine_instructions may try to replace the right hand side of the second instruction with the value of an associated REG_EQUAL note before throwing it at try_combine. That is problematic when there @@ -1456,10 +1452,10 @@ retry: undobuf.frees = 0; } - total_attempts += combine_attempts; - total_merges += combine_merges; - total_extras += combine_extras; - total_successes += combine_successes; + statistics_counter_event (cfun, "attempts", combine_attempts); + statistics_counter_event (cfun, "merges", combine_merges); + statistics_counter_event (cfun, "extras", combine_extras); + statistics_counter_event (cfun, "successes", combine_successes); nonzero_sign_valid = 0; rtl_hooks = general_rtl_hooks; @@ -14936,24 +14932,6 @@ unmentioned_reg_p (rtx equiv, rtx expr) return false; } -DEBUG_FUNCTION void -dump_combine_stats (FILE *file) -{ - fprintf - (file, - ";; Combiner statistics: %d attempts, %d substitutions (%d requiring new space),\n;; %d successes.\n\n", - combine_attempts, combine_merges, combine_extras, combine_successes); -} - -void -dump_combine_total_stats (FILE *file) -{ - fprintf - (file, - "\n;; Combiner totals: %d attempts, %d substitutions (%d requiring new space),\n;; %d successes.\n", - total_attempts, total_merges, total_extras, total_successes); -} - /* Make pseudo-to-pseudo copies after every hard-reg-to-pseudo-copy, because the reg-to-reg copy can usefully combine with later instructions, but we do not want to combine the hard reg into later instructions, for that |