From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4929 invoked by alias); 27 Oct 2014 20:57:13 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 4882 invoked by uid 89); 27 Oct 2014 20:57:13 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.2 X-HELO: eggs.gnu.org Received: from eggs.gnu.org (HELO eggs.gnu.org) (208.118.235.92) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Mon, 27 Oct 2014 20:57:10 +0000 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xir0M-0007dc-O3 for gcc-patches@gcc.gnu.org; Mon, 27 Oct 2014 16:35:11 -0400 Received: from mx1.redhat.com ([209.132.183.28]:40936) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xir0M-0007b8-He for gcc-patches@gcc.gnu.org; Mon, 27 Oct 2014 16:35:06 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s9RKZ5Q8004432 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Mon, 27 Oct 2014 16:35:06 -0400 Received: from c64.redhat.com (vpn-236-51.phx2.redhat.com [10.3.236.51]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s9RKYt50021050; Mon, 27 Oct 2014 16:35:05 -0400 From: David Malcolm To: gcc-patches@gcc.gnu.org Cc: David Malcolm Subject: [gimple-classes, committed 16/92] Update various expressions within tree-scalar-evolution.c to be gimple_phi Date: Mon, 27 Oct 2014 20:57:00 -0000 Message-Id: <1414442490-14841-17-git-send-email-dmalcolm@redhat.com> In-Reply-To: <1414442490-14841-1-git-send-email-dmalcolm@redhat.com> References: <1414442490-14841-1-git-send-email-dmalcolm@redhat.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 X-IsSubscribed: yes X-SW-Source: 2014-10/txt/msg02876.txt.bz2 This corresponds to: [PATCH 17/89] Update various expressions within tree-scalar-evolution.c to be gimple_phi https://gcc.gnu.org/ml/gcc-patches/2014-04/msg01150.html from the original 89-patch kit That earlier patch was approved by Jeff: > OK when prerequisites have gone in. > Actually that's true for #17 & #18 as well. in https://gcc.gnu.org/ml/gcc-patches/2014-05/msg00626.html gcc/ * tree-scalar-evolution.c (follow_ssa_edge): Require a gimple_phi, rather than a gimple. (follow_ssa_edge_binary): Likewise. (follow_ssa_edge_expr): Likewise. (follow_ssa_edge_in_rhs): Likewise. (backedge_phi_arg_p): Likewise. (follow_ssa_edge_in_condition_phi_branch): Likewise. (follow_ssa_edge_in_condition_phi): Likewise. (follow_ssa_edge_inner_loop_phi): Likewise. (analyze_evolution_in_loop): Likewise. (analyze_initial_condition): Likewise. (interpret_loop_phi): Likewise. (interpret_condition_phi): Likewise. (follow_ssa_edge): Likewise; also, add checked casts to gimple_phi. (analyze_scalar_evolution_1): Add checked casts to gimple_phi within "case GIMPLE_PHI". --- gcc/ChangeLog.gimple-classes | 22 +++++++++++++++++++++ gcc/tree-scalar-evolution.c | 46 +++++++++++++++++++++++++------------------- 2 files changed, 48 insertions(+), 20 deletions(-) diff --git a/gcc/ChangeLog.gimple-classes b/gcc/ChangeLog.gimple-classes index 4006f14..c28facc 100644 --- a/gcc/ChangeLog.gimple-classes +++ b/gcc/ChangeLog.gimple-classes @@ -1,5 +1,27 @@ 2014-10-24 David Malcolm + Update various expressions within tree-scalar-evolution.c to be gimple_phi + + * tree-scalar-evolution.c (follow_ssa_edge): Require a gimple_phi, + rather than a gimple. + (follow_ssa_edge_binary): Likewise. + (follow_ssa_edge_expr): Likewise. + (follow_ssa_edge_in_rhs): Likewise. + (backedge_phi_arg_p): Likewise. + (follow_ssa_edge_in_condition_phi_branch): Likewise. + (follow_ssa_edge_in_condition_phi): Likewise. + (follow_ssa_edge_inner_loop_phi): Likewise. + (analyze_evolution_in_loop): Likewise. + (analyze_initial_condition): Likewise. + (interpret_loop_phi): Likewise. + (interpret_condition_phi): Likewise. + (follow_ssa_edge): Likewise; also, add checked casts to gimple_phi. + + (analyze_scalar_evolution_1): Add checked casts to gimple_phi + within "case GIMPLE_PHI". + +2014-10-24 David Malcolm + tree-ssa-loop-ivopts.c: use gimple_phi in a few places * tree-ssa-loop-ivopts.c (determine_biv_step): Require a gimple_phi. diff --git a/gcc/tree-scalar-evolution.c b/gcc/tree-scalar-evolution.c index 0a6739f..7ffa241 100644 --- a/gcc/tree-scalar-evolution.c +++ b/gcc/tree-scalar-evolution.c @@ -904,7 +904,8 @@ typedef enum t_bool { } t_bool; -static t_bool follow_ssa_edge (struct loop *loop, gimple, gimple, tree *, int); +static t_bool follow_ssa_edge (struct loop *loop, gimple, gimple_phi, + tree *, int); /* Follow the ssa edge into the binary expression RHS0 CODE RHS1. Return true if the strongly connected component has been found. */ @@ -912,7 +913,8 @@ static t_bool follow_ssa_edge (struct loop *loop, gimple, gimple, tree *, int); static t_bool follow_ssa_edge_binary (struct loop *loop, gimple at_stmt, tree type, tree rhs0, enum tree_code code, tree rhs1, - gimple halting_phi, tree *evolution_of_loop, int limit) + gimple_phi halting_phi, tree *evolution_of_loop, + int limit) { t_bool res = t_false; tree evol; @@ -1047,7 +1049,8 @@ follow_ssa_edge_binary (struct loop *loop, gimple at_stmt, static t_bool follow_ssa_edge_expr (struct loop *loop, gimple at_stmt, tree expr, - gimple halting_phi, tree *evolution_of_loop, int limit) + gimple_phi halting_phi, tree *evolution_of_loop, + int limit) { enum tree_code code = TREE_CODE (expr); tree type = TREE_TYPE (expr), rhs0, rhs1; @@ -1137,7 +1140,8 @@ follow_ssa_edge_expr (struct loop *loop, gimple at_stmt, tree expr, static t_bool follow_ssa_edge_in_rhs (struct loop *loop, gimple stmt, - gimple halting_phi, tree *evolution_of_loop, int limit) + gimple_phi halting_phi, tree *evolution_of_loop, + int limit) { enum tree_code code = gimple_assign_rhs_code (stmt); tree type = gimple_expr_type (stmt), rhs1, rhs2; @@ -1177,7 +1181,7 @@ follow_ssa_edge_in_rhs (struct loop *loop, gimple stmt, /* Checks whether the I-th argument of a PHI comes from a backedge. */ static bool -backedge_phi_arg_p (gimple phi, int i) +backedge_phi_arg_p (gimple_phi phi, int i) { const_edge e = gimple_phi_arg_edge (phi, i); @@ -1197,8 +1201,8 @@ backedge_phi_arg_p (gimple phi, int i) static inline t_bool follow_ssa_edge_in_condition_phi_branch (int i, struct loop *loop, - gimple condition_phi, - gimple halting_phi, + gimple_phi condition_phi, + gimple_phi halting_phi, tree *evolution_of_branch, tree init_cond, int limit) { @@ -1232,8 +1236,8 @@ follow_ssa_edge_in_condition_phi_branch (int i, static t_bool follow_ssa_edge_in_condition_phi (struct loop *loop, - gimple condition_phi, - gimple halting_phi, + gimple_phi condition_phi, + gimple_phi halting_phi, tree *evolution_of_loop, int limit) { int i, n; @@ -1279,8 +1283,8 @@ follow_ssa_edge_in_condition_phi (struct loop *loop, static t_bool follow_ssa_edge_inner_loop_phi (struct loop *outer_loop, - gimple loop_phi_node, - gimple halting_phi, + gimple_phi loop_phi_node, + gimple_phi halting_phi, tree *evolution_of_loop, int limit) { struct loop *loop = loop_containing_stmt (loop_phi_node); @@ -1325,7 +1329,7 @@ follow_ssa_edge_inner_loop_phi (struct loop *outer_loop, path that is analyzed on the return walk. */ static t_bool -follow_ssa_edge (struct loop *loop, gimple def, gimple halting_phi, +follow_ssa_edge (struct loop *loop, gimple def, gimple_phi halting_phi, tree *evolution_of_loop, int limit) { struct loop *def_loop; @@ -1348,7 +1352,8 @@ follow_ssa_edge (struct loop *loop, gimple def, gimple halting_phi, information and set the approximation to the main variable. */ return follow_ssa_edge_in_condition_phi - (loop, def, halting_phi, evolution_of_loop, limit); + (loop, as_a (def), halting_phi, evolution_of_loop, + limit); /* When the analyzed phi is the halting_phi, the depth-first search is over: we have found a path from @@ -1365,7 +1370,8 @@ follow_ssa_edge (struct loop *loop, gimple def, gimple halting_phi, /* Inner loop. */ if (flow_loop_nested_p (loop, def_loop)) return follow_ssa_edge_inner_loop_phi - (loop, def, halting_phi, evolution_of_loop, limit + 1); + (loop, as_a (def), halting_phi, evolution_of_loop, + limit + 1); /* Outer loop. */ return t_false; @@ -1446,7 +1452,7 @@ simplify_peeled_chrec (struct loop *loop, tree arg, tree init_cond) function from LOOP_PHI_NODE to LOOP_PHI_NODE in the loop. */ static tree -analyze_evolution_in_loop (gimple loop_phi_node, +analyze_evolution_in_loop (gimple_phi loop_phi_node, tree init_cond) { int i, n = gimple_phi_num_args (loop_phi_node); @@ -1541,7 +1547,7 @@ analyze_evolution_in_loop (gimple loop_phi_node, loop, and leaves this task to the on-demand tree reconstructor. */ static tree -analyze_initial_condition (gimple loop_phi_node) +analyze_initial_condition (gimple_phi loop_phi_node) { int i, n; tree init_cond = chrec_not_analyzed_yet; @@ -1612,7 +1618,7 @@ analyze_initial_condition (gimple loop_phi_node) /* Analyze the scalar evolution for LOOP_PHI_NODE. */ static tree -interpret_loop_phi (struct loop *loop, gimple loop_phi_node) +interpret_loop_phi (struct loop *loop, gimple_phi loop_phi_node) { tree res; struct loop *phi_loop = loop_containing_stmt (loop_phi_node); @@ -1661,7 +1667,7 @@ interpret_loop_phi (struct loop *loop, gimple loop_phi_node) analyzed. */ static tree -interpret_condition_phi (struct loop *loop, gimple condition_phi) +interpret_condition_phi (struct loop *loop, gimple_phi condition_phi) { int i, n = gimple_phi_num_args (condition_phi); tree res = chrec_not_analyzed_yet; @@ -1989,9 +1995,9 @@ analyze_scalar_evolution_1 (struct loop *loop, tree var, tree res) case GIMPLE_PHI: if (loop_phi_node_p (def)) - res = interpret_loop_phi (loop, def); + res = interpret_loop_phi (loop, as_a (def)); else - res = interpret_condition_phi (loop, def); + res = interpret_condition_phi (loop, as_a (def)); break; default: -- 1.8.5.3