]> git.ipfire.org Git - thirdparty/gcc.git/commit
improfe loop dumps
authorJan Hubicka <jh@suse.cz>
Fri, 21 Jul 2023 11:38:29 +0000 (13:38 +0200)
committerJan Hubicka <jh@suse.cz>
Fri, 21 Jul 2023 11:39:25 +0000 (13:39 +0200)
commit15ec8d5ab5f21997cfa34cdba9f4b2daea40e710
tree47a578c9bea25b09cd02d0dd4cb7286241ce515a
parent1d96b11e4aef1727b3bd3215d0d8140a504d8eb7
improfe loop dumps

we have flow_loop_dump and print_loop. While print_loop was extended to dump
stuff from loop structure we added over years (loop info), flow_loop_dump was not.
-fdump-tree-all files contains flow_loop_dump which makes it hard to see what
metadata we have attached to loop.

This patch unifies dumping of these fields from both functions.  For example for:
int a[100];
main()
{
        for (int i = 0;  i < 10; i++)
                a[i]=i;
}
we now print:
;; Loop 0
;;  header 0, latch 1
;;  depth 0, outer -1
;;  nodes: 0 1 2 3 4 5
;;
;; Loop 1
;;  header 4, latch 3
;;  depth 1, outer 0, finite_p
;;  upper_bound 10
;;  likely_upper_bound 10
;;  estimate 10
;;  iterations by profile: 10.001101 (unreliable)

finite_p, upper_boud, likely_upper_bound estimate and iterations by profile is new.

Bootstrap/regtest on x86_64 in progress. OK if it passes?

Honza

gcc/ChangeLog:

* cfgloop.cc (flow_loop_dump): Use print_loop_info.
* cfgloop.h (print_loop_info): Declare.
* tree-cfg.cc (print_loop_info): Break out from ...; add
printing of missing fields and profile
(print_loop): ... here.

gcc/testsuite/ChangeLog:

* gcc.dg/tree-ssa/dce-1.c: Update for new loop dumps.
gcc/cfgloop.cc
gcc/cfgloop.h
gcc/testsuite/gcc.dg/tree-ssa/dce-1.c
gcc/tree-cfg.cc