From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26324 invoked by alias); 27 Oct 2014 20:55:07 -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 26260 invoked by uid 89); 27 Oct 2014 20:55:06 -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:55:05 +0000 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xir1b-000812-08 for gcc-patches@gcc.gnu.org; Mon, 27 Oct 2014 16:36:28 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41487) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xir1a-00080q-PV for gcc-patches@gcc.gnu.org; Mon, 27 Oct 2014 16:36:22 -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 s9RKZMxt004549 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Mon, 27 Oct 2014 16:35:22 -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 s9RKYt5S021050; Mon, 27 Oct 2014 16:35:21 -0400 From: David Malcolm To: gcc-patches@gcc.gnu.org Cc: David Malcolm Subject: [gimple-classes, committed 44/92] tree-parloops.c: Use gimple_phi in various places Date: Mon, 27 Oct 2014 20:55:00 -0000 Message-Id: <1414442490-14841-45-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/msg02862.txt.bz2 This corresponds to: [PATCH 46/89] tree-parloops.c: Use gimple_phi in various places https://gcc.gnu.org/ml/gcc-patches/2014-04/msg01168.html from the original 89-patch kit That earlier patch was approved by Jeff: > OK once prerequisites have gone in. in https://gcc.gnu.org/ml/gcc-patches/2014-05/msg00819.html gcc/ * tree-parloops.c (reduction_info::keep_res): Strengthen field from plain gimple to gimple_phi. (transform_to_exit_first_loop): Strengthen locals "phi", "nphi" to gimple_phi. Eliminate early decl of gimple_stmt_iterator gsi in favor of more tightly scoped gimple_phi_iterators, and a final later decl as a gimple_stmt_iterator. --- gcc/ChangeLog.gimple-classes | 11 +++++++++++ gcc/tree-parloops.c | 19 +++++++++++-------- 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/gcc/ChangeLog.gimple-classes b/gcc/ChangeLog.gimple-classes index b0a8465..b8d2f38 100644 --- a/gcc/ChangeLog.gimple-classes +++ b/gcc/ChangeLog.gimple-classes @@ -1,5 +1,16 @@ 2014-10-24 David Malcolm + tree-parloops.c: Use gimple_phi in various places + + * tree-parloops.c (reduction_info::keep_res): Strengthen field + from plain gimple to gimple_phi. + (transform_to_exit_first_loop): Strengthen locals "phi", "nphi" + to gimple_phi. Eliminate early decl of gimple_stmt_iterator gsi + in favor of more tightly scoped gimple_phi_iterators, and a final + later decl as a gimple_stmt_iterator. + +2014-10-24 David Malcolm + Introduce gimple_omp_sections * coretypes.h (gimple_omp_sections): New typedef. diff --git a/gcc/tree-parloops.c b/gcc/tree-parloops.c index cd290a7..fbb74a9 100644 --- a/gcc/tree-parloops.c +++ b/gcc/tree-parloops.c @@ -192,7 +192,7 @@ struct reduction_info enum tree_code reduction_code;/* code for the reduction operation. */ unsigned reduc_version; /* SSA_NAME_VERSION of original reduc_phi result. */ - gimple keep_res; /* The PHI_RESULT of this phi is the resulting value + gimple_phi keep_res; /* The PHI_RESULT of this phi is the resulting value of the reduction variable when existing the loop. */ tree initial_value; /* The initial value of the reduction var before entering the loop. */ tree field; /* the name of the field in the parloop data structure intended for reduction. */ @@ -1498,8 +1498,8 @@ transform_to_exit_first_loop (struct loop *loop, bool ok; edge exit = single_dom_exit (loop), hpred; tree control, control_name, res, t; - gimple phi, nphi, cond_stmt, stmt, cond_nit; - gimple_stmt_iterator gsi; + gimple_phi phi, nphi; + gimple cond_stmt, stmt, cond_nit; tree nit_1; split_block_after_labels (loop->header); @@ -1512,9 +1512,11 @@ transform_to_exit_first_loop (struct loop *loop, /* Make sure that we have phi nodes on exit for all loop header phis (create_parallel_loop requires that). */ - for (gsi = gsi_start_phis (loop->header); !gsi_end_p (gsi); gsi_next (&gsi)) + for (gimple_phi_iterator gsi = gsi_start_phis (loop->header); + !gsi_end_p (gsi); + gsi_next (&gsi)) { - phi = gsi_stmt (gsi); + phi = gsi.phi (); res = PHI_RESULT (phi); t = copy_ssa_name (res, phi); SET_PHI_RESULT (phi, t); @@ -1545,9 +1547,10 @@ transform_to_exit_first_loop (struct loop *loop, out of the loop is the control variable. */ exit = single_dom_exit (loop); control_name = NULL_TREE; - for (gsi = gsi_start_phis (ex_bb); !gsi_end_p (gsi); ) + for (gimple_phi_iterator gsi = gsi_start_phis (ex_bb); + !gsi_end_p (gsi); ) { - phi = gsi_stmt (gsi); + phi = gsi.phi (); res = PHI_RESULT (phi); if (virtual_operand_p (res)) { @@ -1582,7 +1585,7 @@ transform_to_exit_first_loop (struct loop *loop, /* Initialize the control variable to number of iterations according to the rhs of the exit condition. */ - gsi = gsi_after_labels (ex_bb); + gimple_stmt_iterator gsi = gsi_after_labels (ex_bb); cond_nit = last_stmt (exit->src); nit_1 = gimple_cond_rhs (cond_nit); nit_1 = force_gimple_operand_gsi (&gsi, -- 1.8.5.3