From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6927 invoked by alias); 27 Oct 2014 20:36:00 -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 4205 invoked by uid 89); 27 Oct 2014 20:35:28 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Mon, 27 Oct 2014 20:35:26 +0000 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 s9RKZLpR004544 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Mon, 27 Oct 2014 16:35:21 -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 s9RKYt5R021050; Mon, 27 Oct 2014 16:35:21 -0400 From: David Malcolm To: gcc-patches@gcc.gnu.org Cc: David Malcolm Subject: [gimple-classes, committed 43/92] Introduce gimple_omp_sections Date: Mon, 27 Oct 2014 20:36:00 -0000 Message-Id: <1414442490-14841-44-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-IsSubscribed: yes X-SW-Source: 2014-10/txt/msg02804.txt.bz2 This corresponds to: [PATCH 45/89] Introduce gimple_omp_sections https://gcc.gnu.org/ml/gcc-patches/2014-04/msg01188.html from the original 89-patch kit That earlier patch was approved by Jeff: > OK with expected changes due to renaming/updates to const handling. > Please repost the final patch for archival purposes. in https://gcc.gnu.org/ml/gcc-patches/2014-05/msg00821.html gcc/ * coretypes.h (gimple_omp_sections): New typedef. (const_gimple_omp_sections): New typedef. * gimple-pretty-print.c (dump_gimple_omp_sections): Require a gimple_omp_sections rather than a plain gimple. (pp_gimple_stmt_1): Add checked cast to gimple_omp_sections within GIMPLE_OMP_SECTIONS case of switch statement. * gimple.c (gimple_build_omp_sections): Return a gimple_omp_sections rather than a plain gimple. * gimple.h (gimple_build_omp_sections): Return a gimple_omp_sections rather than a plain gimple. * omp-low.c (scan_omp_sections): Require a gimple_omp_sections rather than a plain gimple. (scan_omp_1_stmt): Add checked cast to gimple_omp_sections within GIMPLE_OMP_SECTIONS case of switch statement. (expand_omp_sections): Strengthen local "sections_stmt" from gimple to gimple_omp_sections. (lower_omp_sections): Likewise for "stmt". --- gcc/ChangeLog.gimple-classes | 26 ++++++++++++++++++++++++++ gcc/coretypes.h | 4 ++++ gcc/gimple-pretty-print.c | 7 ++++--- gcc/gimple.c | 5 +++-- gcc/gimple.h | 2 +- gcc/omp-low.c | 14 ++++++++------ 6 files changed, 46 insertions(+), 12 deletions(-) diff --git a/gcc/ChangeLog.gimple-classes b/gcc/ChangeLog.gimple-classes index 65c7986..b0a8465 100644 --- a/gcc/ChangeLog.gimple-classes +++ b/gcc/ChangeLog.gimple-classes @@ -1,5 +1,31 @@ 2014-10-24 David Malcolm + Introduce gimple_omp_sections + + * coretypes.h (gimple_omp_sections): New typedef. + (const_gimple_omp_sections): New typedef. + + * gimple-pretty-print.c (dump_gimple_omp_sections): Require a + gimple_omp_sections rather than a plain gimple. + (pp_gimple_stmt_1): Add checked cast to gimple_omp_sections within + GIMPLE_OMP_SECTIONS case of switch statement. + + * gimple.c (gimple_build_omp_sections): Return a + gimple_omp_sections rather than a plain gimple. + + * gimple.h (gimple_build_omp_sections): Return a + gimple_omp_sections rather than a plain gimple. + + * omp-low.c (scan_omp_sections): Require a gimple_omp_sections + rather than a plain gimple. + (scan_omp_1_stmt): Add checked cast to gimple_omp_sections within + GIMPLE_OMP_SECTIONS case of switch statement. + (expand_omp_sections): Strengthen local "sections_stmt" from gimple + to gimple_omp_sections. + (lower_omp_sections): Likewise for "stmt". + +2014-10-24 David Malcolm + Introduce gimple_omp_teams * coretypes.h (gimple_omp_teams): New typedef. diff --git a/gcc/coretypes.h b/gcc/coretypes.h index 2cd33e5..b8417bc 100644 --- a/gcc/coretypes.h +++ b/gcc/coretypes.h @@ -196,6 +196,10 @@ struct gimple_statement_omp_task; typedef struct gimple_statement_omp_task *gimple_omp_task; typedef const struct gimple_statement_omp_task *const_gimple_omp_task; +struct gimple_statement_omp_sections; +typedef struct gimple_statement_omp_sections *gimple_omp_sections; +typedef const struct gimple_statement_omp_sections *const_gimple_omp_sections; + struct gimple_statement_omp_single; typedef struct gimple_statement_omp_single *gimple_omp_single; typedef const struct gimple_statement_omp_single *const_gimple_omp_single; diff --git a/gcc/gimple-pretty-print.c b/gcc/gimple-pretty-print.c index d5e3639..a90d2ef 100644 --- a/gcc/gimple-pretty-print.c +++ b/gcc/gimple-pretty-print.c @@ -1388,8 +1388,8 @@ dump_gimple_omp_teams (pretty_printer *buffer, gimple_omp_teams gs, int spc, /* Dump a GIMPLE_OMP_SECTIONS tuple on the pretty_printer BUFFER. */ static void -dump_gimple_omp_sections (pretty_printer *buffer, gimple gs, int spc, - int flags) +dump_gimple_omp_sections (pretty_printer *buffer, gimple_omp_sections gs, + int spc, int flags) { if (flags & TDF_RAW) { @@ -2188,7 +2188,8 @@ pp_gimple_stmt_1 (pretty_printer *buffer, gimple gs, int spc, int flags) break; case GIMPLE_OMP_SECTIONS: - dump_gimple_omp_sections (buffer, gs, spc, flags); + dump_gimple_omp_sections (buffer, as_a (gs), + spc, flags); break; case GIMPLE_OMP_SECTIONS_SWITCH: diff --git a/gcc/gimple.c b/gcc/gimple.c index b4b76f3..c2b4588 100644 --- a/gcc/gimple.c +++ b/gcc/gimple.c @@ -1007,10 +1007,11 @@ gimple_build_omp_return (bool wait_p) CLAUSES are any of the OMP sections contsruct's clauses: private, firstprivate, lastprivate, reduction, and nowait. */ -gimple +gimple_omp_sections gimple_build_omp_sections (gimple_seq body, tree clauses) { - gimple p = gimple_alloc (GIMPLE_OMP_SECTIONS, 0); + gimple_omp_sections p = + as_a (gimple_alloc (GIMPLE_OMP_SECTIONS, 0)); if (body) gimple_omp_set_body (p, body); gimple_omp_sections_set_clauses (p, clauses); diff --git a/gcc/gimple.h b/gcc/gimple.h index 462495e..4e59777 100644 --- a/gcc/gimple.h +++ b/gcc/gimple.h @@ -1353,7 +1353,7 @@ gimple gimple_build_omp_taskgroup (gimple_seq); gimple_omp_continue gimple_build_omp_continue (tree, tree); gimple gimple_build_omp_ordered (gimple_seq); gimple gimple_build_omp_return (bool); -gimple gimple_build_omp_sections (gimple_seq, tree); +gimple_omp_sections gimple_build_omp_sections (gimple_seq, tree); gimple gimple_build_omp_sections_switch (void); gimple_omp_single gimple_build_omp_single (gimple_seq, tree); gimple_omp_target gimple_build_omp_target (gimple_seq, int, tree); diff --git a/gcc/omp-low.c b/gcc/omp-low.c index ce71618..1edc943 100644 --- a/gcc/omp-low.c +++ b/gcc/omp-low.c @@ -2295,7 +2295,7 @@ scan_omp_for (gimple_omp_for stmt, omp_context *outer_ctx) /* Scan an OpenMP sections directive. */ static void -scan_omp_sections (gimple stmt, omp_context *outer_ctx) +scan_omp_sections (gimple_omp_sections stmt, omp_context *outer_ctx) { omp_context *ctx; @@ -2814,7 +2814,7 @@ scan_omp_1_stmt (gimple_stmt_iterator *gsi, bool *handled_ops_p, break; case GIMPLE_OMP_SECTIONS: - scan_omp_sections (stmt, ctx); + scan_omp_sections (as_a (stmt), ctx); break; case GIMPLE_OMP_SINGLE: @@ -7423,7 +7423,8 @@ expand_omp_sections (struct omp_region *region) unsigned len; basic_block entry_bb, l0_bb, l1_bb, l2_bb, default_bb; gimple_stmt_iterator si, switch_si; - gimple sections_stmt, stmt; + gimple_omp_sections sections_stmt; + gimple stmt; gimple_omp_continue cont; edge_iterator ei; edge e; @@ -7478,7 +7479,7 @@ expand_omp_sections (struct omp_region *region) /* The call to GOMP_sections_start goes in ENTRY_BB, replacing the GIMPLE_OMP_SECTIONS statement. */ si = gsi_last_bb (entry_bb); - sections_stmt = gsi_stmt (si); + sections_stmt = as_a (gsi_stmt (si)); gcc_assert (gimple_code (sections_stmt) == GIMPLE_OMP_SECTIONS); vin = gimple_omp_sections_control (sections_stmt); if (!is_combined_parallel (region)) @@ -8876,11 +8877,12 @@ lower_omp_sections (gimple_stmt_iterator *gsi_p, omp_context *ctx) { tree block, control; gimple_stmt_iterator tgsi; - gimple stmt, t; + gimple_omp_sections stmt; + gimple t; gimple_bind new_stmt, bind; gimple_seq ilist, dlist, olist, new_body; - stmt = gsi_stmt (*gsi_p); + stmt = as_a (gsi_stmt (*gsi_p)); push_gimplify_context (); -- 1.8.5.3