On Mon, 16 May 2022, Tobias Burnus wrote: > As requested by Richard: Rediffed patch. > > Changes: s/.c/.cc/ + some whitespace changes. > (At least in my email reader, some <tab> were lost. I also fixed too-long line > issues.) > > In addition, FOR_EACH_LOOP was replaced by 'for (auto loop : ...' > (macro was removed late in GCC 12 development ? r12-2605-ge41ba804ba5f5c) > > Otherwise, it should be identical to Frederik's patch, earlier in this thread. > > On 15.12.21 16:54, Frederik Harwath wrote: > > Extend dump output to make understanding why Graphite rejects to > > include a loop in a SCoP easier (for GCC developers). > > OK for mainline?
+ if (printed) + fprintf (file, "\b\b"); please find other means of omitting ", ", like by printing it _before_ the number but only for the second and following loop number. I'll also note that +static void +print_sese_loop_numbers (FILE *file, sese_l sese) +{ + bool printed = false; + for (auto loop : loops_list (cfun, 0)) + { + if (loop_in_sese_p (loop, sese)) + fprintf (file, "%d, ", loop->num); + printed = true; + } is hardly optimal. Please instead iterate over sese.entry->dest->loop_father and children instead which you can do by passing that as extra argument to loops_list. + + if (dump_file && dump_flags & TDF_DETAILS) + { + fprintf (dump_file, "Loops in SCoP: "); + for (auto loop : loops_list (cfun, 0)) + if (loop_in_sese_p (loop, s)) + fprintf (dump_file, "%d ", loop->num); + fprintf (dump_file, "\n"); + } you are duplicating functionality of the function you just added ... Otherwise looks OK to me. Thanks, Richard. > Tobias > ----------------- > Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstra?e 201, 80634 > M?nchen; Gesellschaft mit beschr?nkter Haftung; Gesch?ftsf?hrer: Thomas > Heurung, Frank Th?rauf; Sitz der Gesellschaft: M?nchen; Registergericht > M?nchen, HRB 106955 > -- Richard Biener <rguent...@suse.de> SUSE Software Solutions Germany GmbH, Maxfeldstrasse 5, 90409 Nuernberg, Germany; GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman; HRB 36809 (AG Nuernberg)