From patchwork Sat Jun 12 08:19:17 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sebastian Pop X-Patchwork-Id: 55383 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 40084B7D6D for ; Sat, 12 Jun 2010 18:19:50 +1000 (EST) Received: (qmail 31303 invoked by alias); 12 Jun 2010 08:19:47 -0000 Received: (qmail 31293 invoked by uid 22791); 12 Jun 2010 08:19:45 -0000 X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, TW_CF, TW_TM X-Spam-Check-By: sourceware.org Received: from mail-vw0-f47.google.com (HELO mail-vw0-f47.google.com) (209.85.212.47) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 12 Jun 2010 08:19:39 +0000 Received: by vws11 with SMTP id 11so2283268vws.20 for ; Sat, 12 Jun 2010 01:19:37 -0700 (PDT) Received: by 10.224.114.155 with SMTP id e27mr1199043qaq.202.1276330777096; Sat, 12 Jun 2010 01:19:37 -0700 (PDT) MIME-Version: 1.0 Received: by 10.224.74.18 with HTTP; Sat, 12 Jun 2010 01:19:17 -0700 (PDT) In-Reply-To: References: From: Sebastian Pop Date: Sat, 12 Jun 2010 03:19:17 -0500 Message-ID: Subject: Re: [patch][graphite] Remove sese_adjust_liveout_phis To: GCC Patches , gcc-graphite X-IsSubscribed: yes 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 On Sat, Jun 12, 2010 at 02:53, Sebastian Pop wrote: > Hi, > > with the attached patches we no longer need to use the rename_map to > substitute the arguments of the phi nodes created after the code > generated by Graphite.  I committed these patches to the graphite > branch, and I will commit them to trunk once they pass the usual > graphite branch tests. > > The aim is to replace the rename_map with the map that CLooG exposes > for each user statement: associating to a loop level an expression. > The expand_* functions will be replaced by the code generation from a > chrec that is obtained from the original scev by chrec_applying the > loop level -> expression map on each varying loop.  This will then > allow us to remove the call to the IV canonicalization from Graphite. > The attached patch removes two uses of rename_map from gloog. Committed to the graphite branch. Sebastian From be9a6b386261452607f5440a46bbfb10700bf3d3 Mon Sep 17 00:00:00 2001 From: Sebastian Pop Date: Sat, 12 Jun 2010 03:12:04 -0500 Subject: [PATCH] Remove rename_nb_iterations and rename_sese_parameters 2010-06-12 Sebastian Pop * graphite-clast-to-gimple.c (gloog): Do not pass scops in parameter. Remove calls to rename_nb_iterations and rename_sese_parameters. * graphite-clast-to-gimple.h (gloog): Update declaration. * graphite.c (graphite_transform_loops): Update call to gloog. * sese.c (rename_variables_in_expr): Removed. (rename_nb_iterations): Removed. (rename_sese_parameters): Removed. * sese.h (rename_nb_iterations): Removed. (rename_sese_parameters): Removed. --- gcc/ChangeLog.graphite | 12 ++++++++ gcc/graphite-clast-to-gimple.c | 8 +----- gcc/graphite-clast-to-gimple.h | 2 +- gcc/graphite.c | 2 +- gcc/sese.c | 56 ---------------------------------------- gcc/sese.h | 2 - 6 files changed, 15 insertions(+), 67 deletions(-) diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite index d703048..b4e2700 100644 --- a/gcc/ChangeLog.graphite +++ b/gcc/ChangeLog.graphite @@ -1,5 +1,17 @@ 2010-06-12 Sebastian Pop + * graphite-clast-to-gimple.c (gloog): Do not pass scops in parameter. + Remove calls to rename_nb_iterations and rename_sese_parameters. + * graphite-clast-to-gimple.h (gloog): Update declaration. + * graphite.c (graphite_transform_loops): Update call to gloog. + * sese.c (rename_variables_in_expr): Removed. + (rename_nb_iterations): Removed. + (rename_sese_parameters): Removed. + * sese.h (rename_nb_iterations): Removed. + (rename_sese_parameters): Removed. + +2010-06-12 Sebastian Pop + * graphite-clast-to-gimple.c (gloog): Remove call to sese_adjust_liveout_phis. * graphite-sese-to-poly.c (scev_analyzable_p): When scev returns an diff --git a/gcc/graphite-clast-to-gimple.c b/gcc/graphite-clast-to-gimple.c index 01adba0..54801ce 100644 --- a/gcc/graphite-clast-to-gimple.c +++ b/gcc/graphite-clast-to-gimple.c @@ -1531,7 +1531,7 @@ create_params_index (htab_t index_table, CloogProgram *prog) { */ bool -gloog (scop_p scop, VEC (scop_p, heap) *scops, htab_t bb_pbb_mapping) +gloog (scop_p scop, htab_t bb_pbb_mapping) { VEC (tree, heap) *newivs = VEC_alloc (tree, heap, 10); loop_p context_loop; @@ -1539,7 +1539,6 @@ gloog (scop_p scop, VEC (scop_p, heap) *scops, htab_t bb_pbb_mapping) ifsese if_region = NULL; htab_t rename_map, newivs_index, params_index; cloog_prog_clast pc; - int i; timevar_push (TV_GRAPHITE_CODE_GEN); gloog_error = false; @@ -1579,11 +1578,6 @@ gloog (scop_p scop, VEC (scop_p, heap) *scops, htab_t bb_pbb_mapping) bb_pbb_mapping, 1, params_index); graphite_verify (); scev_reset_htab (); - rename_nb_iterations (rename_map); - - for (i = 0; VEC_iterate (scop_p, scops, i, scop); i++) - rename_sese_parameters (rename_map, SCOP_REGION (scop)); - recompute_all_dominators (); graphite_verify (); diff --git a/gcc/graphite-clast-to-gimple.h b/gcc/graphite-clast-to-gimple.h index f6557f6..c90cfc0 100644 --- a/gcc/graphite-clast-to-gimple.h +++ b/gcc/graphite-clast-to-gimple.h @@ -36,7 +36,7 @@ typedef struct bb_pbb_def poly_bb_p pbb; }bb_pbb_def; -extern bool gloog (scop_p, VEC (scop_p, heap) *, htab_t); +extern bool gloog (scop_p, htab_t); extern cloog_prog_clast scop_to_clast (scop_p); extern void debug_clast_stmt (struct clast_stmt *); extern void print_clast_stmt (FILE *, struct clast_stmt *); diff --git a/gcc/graphite.c b/gcc/graphite.c index 5f28aeb..51bf800 100644 --- a/gcc/graphite.c +++ b/gcc/graphite.c @@ -289,7 +289,7 @@ graphite_transform_loops (void) for (i = 0; VEC_iterate (scop_p, scops, i, scop); i++) if (POLY_SCOP_P (scop) && apply_poly_transforms (scop) - && gloog (scop, scops, bb_pbb_mapping)) + && gloog (scop, bb_pbb_mapping)) need_cfg_cleanup_p = true; htab_delete (bb_pbb_mapping); diff --git a/gcc/sese.c b/gcc/sese.c index 051599e..361c9b6 100644 --- a/gcc/sese.c +++ b/gcc/sese.c @@ -435,62 +435,6 @@ set_rename (htab_t map, tree old_name, tree expr) *slot = new_rename_map_elt (old_name, expr); } -/* Renames the expression T following the tuples (OLD_NAME, EXPR) in - the rename map M. Returns the expression T after renaming. */ - -static tree -rename_variables_in_expr (htab_t m, tree t) -{ - if (!t) - return t; - - if (TREE_CODE (t) == SSA_NAME) - return get_rename (m, t); - - switch (TREE_CODE_LENGTH (TREE_CODE (t))) - { - case 3: - TREE_OPERAND (t, 2) = rename_variables_in_expr (m, TREE_OPERAND (t, 2)); - - case 2: - TREE_OPERAND (t, 1) = rename_variables_in_expr (m, TREE_OPERAND (t, 1)); - - case 1: - TREE_OPERAND (t, 0) = rename_variables_in_expr (m, TREE_OPERAND (t, 0)); - - default: - return t; - } -} - -/* Renames all the loop->nb_iterations expressions following the - tuples (OLD_NAME, EXPR) in RENAME_MAP. */ - -void -rename_nb_iterations (htab_t rename_map) -{ - loop_iterator li; - struct loop *loop; - - FOR_EACH_LOOP (li, loop, 0) - loop->nb_iterations = rename_variables_in_expr (rename_map, - loop->nb_iterations); -} - -/* Renames all the parameters of SESE following the tuples (OLD_NAME, - EXPR) in RENAME_MAP. */ - -void -rename_sese_parameters (htab_t rename_map, sese region) -{ - int i; - tree p; - - for (i = 0; VEC_iterate (tree, SESE_PARAMS (region), i, p); i++) - VEC_replace (tree, SESE_PARAMS (region), i, - rename_variables_in_expr (rename_map, p)); -} - /* Rename the SSA_NAMEs used in STMT and that appear in MAP. */ static void diff --git a/gcc/sese.h b/gcc/sese.h index 4b2e5c2..d0d829f 100644 --- a/gcc/sese.h +++ b/gcc/sese.h @@ -262,8 +262,6 @@ extern void debug_rename_map (htab_t); extern hashval_t rename_map_elt_info (const void *); extern int eq_rename_map_elts (const void *, const void *); extern void set_rename (htab_t, tree, tree); -extern void rename_nb_iterations (htab_t); -extern void rename_sese_parameters (htab_t, sese); /* Constructs a new SCEV_INFO_STR structure for VAR and INSTANTIATED_BELOW. */ -- 1.7.0.4