From 15ec8d5ab5f21997cfa34cdba9f4b2daea40e710 Mon Sep 17 00:00:00 2001 From: Jan Hubicka Date: Fri, 21 Jul 2023 13:38:29 +0200 Subject: 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.h | 1 + 1 file changed, 1 insertion(+) (limited to 'gcc/cfgloop.h') diff --git a/gcc/cfgloop.h b/gcc/cfgloop.h index 4d2fd4b6..269694c 100644 --- a/gcc/cfgloop.h +++ b/gcc/cfgloop.h @@ -411,6 +411,7 @@ extern unsigned expected_loop_iterations (class loop *); extern rtx doloop_condition_get (rtx_insn *); void mark_loop_for_removal (loop_p); +void print_loop_info (FILE *file, const class loop *loop, const char *); /* Induction variable analysis. */ -- cgit v1.1