From patchwork Fri Oct 20 10:48:53 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Biener X-Patchwork-Id: 828552 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-464617-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="afXkFfj3"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3yJMx40Kl1z9t6J for ; Fri, 20 Oct 2017 21:49:11 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:mime-version:content-type; q=dns; s= default; b=DGz7fOu9Z/ETwfayDJO/KUvyJXoD+TCgfN6kDcd92msqy9XUMz82a 6LcdOElXyCngCmI51E8H8W4dBFMXl8SYn0oA/eGDQ5XFdoFX0/t7HX9g0LRCvYml lfjoQsHugpZeUY38wCfqr0y7fHzVSsfKrVL0Aa/UinGURSMwHb1TdE= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:mime-version:content-type; s= default; bh=jTQr6I6Gf8gxeOVYFe/dLy2Y218=; b=afXkFfj3y7e4UZ4+8z0Y IsfWwfSeRiBxI+v2fxmkyxCqVO+GiPppDbzGVgr5whQ01di7rvWr7LYtiTHlmhT1 olmPRp9edh+oNxvWxNrUmakMOIgjnUvETJbCFlmohdBop6W9R45VRTXTyIKXmfd+ bggHJG5InuV3H1ZYcOGMdfo= Received: (qmail 41524 invoked by alias); 20 Oct 2017 10:48:59 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 41419 invoked by uid 89); 20 Oct 2017 10:48:57 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-11.1 required=5.0 tests=BAYES_00, GIT_PATCH_2, GIT_PATCH_3, KAM_ASCII_DIVIDERS, RP_MATCHES_RCVD, SPF_PASS autolearn=ham version=3.3.2 spammy=tames, Tame, 35313, 20315 X-HELO: mx2.suse.de Received: from mx2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 20 Oct 2017 10:48:56 +0000 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id AD4DBACC7 for ; Fri, 20 Oct 2017 10:48:53 +0000 (UTC) Date: Fri, 20 Oct 2017 12:48:53 +0200 (CEST) From: Richard Biener To: gcc-patches@gcc.gnu.org Subject: [PATCH][GRAPHITE] Tame down dumping Message-ID: User-Agent: Alpine 2.20 (LSU 67 2015-01-07) MIME-Version: 1.0 This tames dumping a bit and adjusts whitespacing and order of dumping. Bootstrapped / tested on x86_64-unknown-linux-gnu, applied. Richard. 2017-10-20 Richard Biener * graphite-isl-ast-to-gimple.c (translate_isl_ast_to_gimple::graphite_copy_stmts_from_block): Remove return value and simplify, dump copied stmt after lhs adjustment. (translate_isl_ast_to_gimple::translate_isl_ast_node_user): Reduce dump verbosity. (gsi_insert_earliest): Likewise. (translate_isl_ast_to_gimple::copy_bb_and_scalar_dependences): Adjust. * graphite.c (print_global_statistics): Adjust dumping. (print_graphite_scop_statistics): Likewise. (print_graphite_statistics): Do not dump loops here. (graphite_transform_loops): But here. Index: gcc/graphite-isl-ast-to-gimple.c =================================================================== --- gcc/graphite-isl-ast-to-gimple.c (revision 253926) +++ gcc/graphite-isl-ast-to-gimple.c (working copy) @@ -191,7 +191,7 @@ class translate_isl_ast_to_gimple tree get_rename_from_scev (tree old_name, gimple_seq *stmts, loop_p loop, vec iv_map); - bool graphite_copy_stmts_from_block (basic_block bb, basic_block new_bb, + void graphite_copy_stmts_from_block (basic_block bb, basic_block new_bb, vec iv_map); edge copy_bb_and_scalar_dependences (basic_block bb, edge next_e, vec iv_map); @@ -791,13 +810,12 @@ translate_isl_ast_node_user (__isl_keep isl_ast_expr_free (user_expr); basic_block old_bb = GBB_BB (gbb); - if (dump_file) + if (dump_file && (dump_flags & TDF_DETAILS)) { fprintf (dump_file, "[codegen] copying from bb_%d on edge (bb_%d, bb_%d)\n", old_bb->index, next_e->src->index, next_e->dest->index); print_loops_bb (dump_file, GBB_BB (gbb), 0, 3); - } next_e = copy_bb_and_scalar_dependences (old_bb, next_e, iv_map); @@ -807,7 +825,7 @@ translate_isl_ast_node_user (__isl_keep if (codegen_error_p ()) return NULL; - if (dump_file) + if (dump_file && (dump_flags & TDF_DETAILS)) { fprintf (dump_file, "[codegen] (after copy) new basic block\n"); print_loops_bb (dump_file, next_e->src, 0, 3); @@ -1049,9 +1067,9 @@ gsi_insert_earliest (gimple_seq seq) if (dump_file) { - fprintf (dump_file, "[codegen] inserting statement: "); + fprintf (dump_file, "[codegen] inserting statement in BB %d: ", + gimple_bb (use_stmt)->index); print_gimple_stmt (dump_file, use_stmt, 0, TDF_VOPS | TDF_MEMSYMS); - print_loops_bb (dump_file, gimple_bb (use_stmt), 0, 3); } } } @@ -1122,7 +1140,7 @@ should_copy_to_new_region (gimple *stmt, /* Duplicates the statements of basic block BB into basic block NEW_BB and compute the new induction variables according to the IV_MAP. */ -bool translate_isl_ast_to_gimple:: +void translate_isl_ast_to_gimple:: graphite_copy_stmts_from_block (basic_block bb, basic_block new_bb, vec iv_map) { @@ -1139,7 +1157,6 @@ graphite_copy_stmts_from_block (basic_bl /* Create a new copy of STMT and duplicate STMT's virtual operands. */ gimple *copy = gimple_copy (stmt); - gsi_insert_after (&gsi_tgt, copy, GSI_NEW_STMT); /* Rather than not copying debug stmts we reset them. ??? Where we can rewrite uses without inserting new @@ -1154,12 +1171,6 @@ graphite_copy_stmts_from_block (basic_bl gcc_unreachable (); } - if (dump_file) - { - fprintf (dump_file, "[codegen] inserting statement: "); - print_gimple_stmt (dump_file, copy, 0); - } - maybe_duplicate_eh_stmt (copy, stmt); gimple_duplicate_stmt_histograms (cfun, copy, cfun, stmt); @@ -1172,8 +1183,12 @@ graphite_copy_stmts_from_block (basic_bl create_new_def_for (old_name, copy, def_p); } - if (codegen_error_p ()) - return false; + gsi_insert_after (&gsi_tgt, copy, GSI_NEW_STMT); + if (dump_file) + { + fprintf (dump_file, "[codegen] inserting statement: "); + print_gimple_stmt (dump_file, copy, 0); + } /* For each SCEV analyzable SSA_NAME, rename their usage. */ ssa_op_iter iter; @@ -1198,8 +1213,6 @@ graphite_copy_stmts_from_block (basic_bl update_stmt (copy); } - - return true; } @@ -1236,11 +1249,7 @@ copy_bb_and_scalar_dependences (basic_bl gsi_insert_after (&gsi_tgt, ass, GSI_NEW_STMT); } - if (!graphite_copy_stmts_from_block (bb, new_bb, iv_map)) - { - set_codegen_error (); - return NULL; - } + graphite_copy_stmts_from_block (bb, new_bb, iv_map); /* Insert out-of SSA copies on the original BB outgoing edges. */ gsi_tgt = gsi_last_bb (new_bb); Index: gcc/graphite.c =================================================================== --- gcc/graphite.c (revision 253926) +++ gcc/graphite.c (working copy) @@ -111,7 +111,7 @@ print_global_statistics (FILE* file) fprintf (file, "LOOPS:%ld, ", n_loops); fprintf (file, "CONDITIONS:%ld, ", n_conditions); fprintf (file, "STMTS:%ld)\n", n_stmts); - fprintf (file, "\nGlobal profiling statistics ("); + fprintf (file, "Global profiling statistics ("); fprintf (file, "BBS:"); n_p_bbs.dump (file); fprintf (file, ", LOOPS:"); @@ -120,7 +120,7 @@ print_global_statistics (FILE* file) n_p_conditions.dump (file); fprintf (file, ", STMTS:"); n_p_stmts.dump (file); - fprintf (file, ")\n"); + fprintf (file, ")\n\n"); } /* Print statistics for SCOP to FILE. */ @@ -185,7 +185,7 @@ print_graphite_scop_statistics (FILE* fi fprintf (file, "LOOPS:%ld, ", n_loops); fprintf (file, "CONDITIONS:%ld, ", n_conditions); fprintf (file, "STMTS:%ld)\n", n_stmts); - fprintf (file, "\nSCoP profiling statistics ("); + fprintf (file, "SCoP profiling statistics ("); fprintf (file, "BBS:"); n_p_bbs.dump (file); fprintf (file, ", LOOPS:"); @@ -194,7 +194,7 @@ print_graphite_scop_statistics (FILE* fi n_p_conditions.dump (file); fprintf (file, ", STMTS:"); n_p_stmts.dump (file); - fprintf (file, ")\n"); + fprintf (file, ")\n\n"); } /* Print statistics for SCOPS to FILE. */ @@ -203,15 +203,10 @@ static void print_graphite_statistics (FILE* file, vec scops) { int i; - scop_p scop; FOR_EACH_VEC_ELT (scops, i, scop) print_graphite_scop_statistics (file, scop); - - /* Print the loop structure. */ - print_loops (file, 2); - print_loops (file, 3); } /* Deletes all scops in SCOPS. */ @@ -358,6 +353,13 @@ graphite_transform_loops (void) sort_sibling_loops (cfun); canonicalize_loop_closed_ssa_form (); + /* Print the loop structure. */ + if (dump_file && (dump_flags & TDF_DETAILS)) + { + print_loops (dump_file, 2); + print_loops (dump_file, 3); + } + calculate_dominance_info (CDI_POST_DOMINATORS); build_scops (&scops); free_dominance_info (CDI_POST_DOMINATORS);