From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by sourceware.org (Postfix) with ESMTPS id 416F93858C51 for ; Tue, 17 May 2022 08:21:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 416F93858C51 Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id 2D363220F4; Tue, 17 May 2022 08:21:45 +0000 (UTC) Received: from wotan.suse.de (wotan.suse.de [10.160.0.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id 00BFE2C141; Tue, 17 May 2022 08:21:44 +0000 (UTC) Date: Tue, 17 May 2022 08:21:44 +0000 (UTC) From: Richard Biener To: Tobias Burnus cc: gcc-patches@gcc.gnu.org, "Pop, Sebastian" , sebpop@gmail.com, thomas@codesourcery.com, grosser@fim.uni-passau.de, Frederik Harwath Subject: Re: [PATCH 15/40] graphite: Extend SCoP detection dump output In-Reply-To: Message-ID: References: <20211215155447.19379-1-frederik@codesourcery.com> <20211215155447.19379-16-frederik@codesourcery.com> User-Agent: Alpine 2.22 (LSU 394 2020-01-19) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-4.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2022 08:21:49 -0000 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 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 SUSE Software Solutions Germany GmbH, Maxfeldstrasse 5, 90409 Nuernberg, Germany; GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman; HRB 36809 (AG Nuernberg)