From patchwork Fri May 23 11:39:56 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Schwinge X-Patchwork-Id: 351815 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]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40CD9140092 for ; Fri, 23 May 2014 21:40:20 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:mime-version:content-type; q=dns; s= default; b=Kbwx5T6Z0wt9L0iPKuZ7OJjen4q7wYJGDjrPTbItYnONGvn7wFKEZ JK2LDVUprljgEuA/aDyY8woy0koompWFFwon+h5Y/G7NM9ykcBl/vxOIZbAkoHEF cRRVzQzh68kojBueroxTieVgy1IoF1SmBdLK2hiskjEywPcG5s+WfU= 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:from :to:subject:date:message-id:mime-version:content-type; s= default; bh=16jwprC3Vc2/6qVTIpHpYgcM9ZI=; b=V1KV82HeguEOJSHwsHNe XjcZ+S+mYxJ3hcgHtiNThO05try1vzkNUNB/kE4Bkc+dM4Cr3LPx8DQe+bs0GhuA XhiPsTNycc9yUyGiTe/FGa1Yts4aNw1Cj6w1qejeu+NHt5qbtokypqmnfL88ipYn wGgjyck1hLUGoTAOS5wBgiU= Received: (qmail 15698 invoked by alias); 23 May 2014 11:40:13 -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 15687 invoked by uid 89); 23 May 2014 11:40: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: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 23 May 2014 11:40:11 +0000 Received: from svr-orw-fem-01.mgc.mentorg.com ([147.34.98.93]) by relay1.mentorg.com with esmtp id 1WnnpX-0001P0-CE from Thomas_Schwinge@mentor.com for gcc-patches@gcc.gnu.org; Fri, 23 May 2014 04:40:07 -0700 Received: from SVR-IES-FEM-03.mgc.mentorg.com ([137.202.0.108]) by svr-orw-fem-01.mgc.mentorg.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Fri, 23 May 2014 04:40:07 -0700 Received: from feldtkeller.schwinge.homeip.net (137.202.0.76) by SVR-IES-FEM-03.mgc.mentorg.com (137.202.0.108) with Microsoft SMTP Server id 14.2.247.3; Fri, 23 May 2014 12:40:05 +0100 From: Thomas Schwinge To: Subject: [COMMITTED] Make it easier to diff expand_omp_for_* functions. Date: Fri, 23 May 2014 13:39:56 +0200 Message-ID: <1400845197-27637-1-git-send-email-thomas@codesourcery.com> MIME-Version: 1.0 From: tschwinge gcc/ * omp-low.c (expand_omp_for_static_chunk): Rename variable si to gsi, and variables v_* to v*. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@210858 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 5 +++ gcc/omp-low.c | 118 +++++++++++++++++++++++++++++----------------------------- 2 files changed, 64 insertions(+), 59 deletions(-) diff --git gcc/ChangeLog gcc/ChangeLog index 01f3ca1..3d74b6f 100644 --- gcc/ChangeLog +++ gcc/ChangeLog @@ -1,3 +1,8 @@ +2014-05-23 Thomas Schwinge + + * omp-low.c (expand_omp_for_static_chunk): Rename variable si to + gsi, and variables v_* to v*. + 2014-05-23 Eric Botcazou * varasm.c (output_constructor_bitfield): Fix thinkos in latest change. diff --git gcc/omp-low.c gcc/omp-low.c index 54e837f..129d513 100644 --- gcc/omp-low.c +++ gcc/omp-low.c @@ -6166,10 +6166,10 @@ expand_omp_for_static_chunk (struct omp_region *region, { tree n, s0, e0, e, t; tree trip_var, trip_init, trip_main, trip_back, nthreads, threadid; - tree type, itype, v_main, v_back, v_extra; + tree type, itype, vmain, vback, vextra; basic_block entry_bb, exit_bb, body_bb, seq_start_bb, iter_part_bb; basic_block trip_update_bb = NULL, cont_bb, collapse_bb = NULL, fin_bb; - gimple_stmt_iterator si; + gimple_stmt_iterator gsi; gimple stmt; edge se; enum built_in_function get_num_threads = BUILT_IN_OMP_GET_NUM_THREADS; @@ -6202,8 +6202,8 @@ expand_omp_for_static_chunk (struct omp_region *region, exit_bb = region->exit; /* Trip and adjustment setup goes in ENTRY_BB. */ - si = gsi_last_bb (entry_bb); - gcc_assert (gimple_code (gsi_stmt (si)) == GIMPLE_OMP_FOR); + gsi = gsi_last_bb (entry_bb); + gcc_assert (gimple_code (gsi_stmt (gsi)) == GIMPLE_OMP_FOR); if (gimple_omp_for_kind (fd->for_stmt) == GF_OMP_FOR_KIND_DISTRIBUTE) { @@ -6217,7 +6217,7 @@ expand_omp_for_static_chunk (struct omp_region *region, basic_block l2_dom_bb = NULL; counts = XALLOCAVEC (tree, fd->collapse); - expand_omp_for_init_counts (fd, &si, entry_bb, counts, + expand_omp_for_init_counts (fd, &gsi, entry_bb, counts, fin_bb, first_zero_iter, l2_dom_bb); t = NULL_TREE; @@ -6233,21 +6233,21 @@ expand_omp_for_static_chunk (struct omp_region *region, && (t == NULL_TREE || !integer_onep (t))) { n1 = fold_convert (type, unshare_expr (fd->loop.n1)); - n1 = force_gimple_operand_gsi (&si, n1, true, NULL_TREE, + n1 = force_gimple_operand_gsi (&gsi, n1, true, NULL_TREE, true, GSI_SAME_STMT); n2 = fold_convert (type, unshare_expr (fd->loop.n2)); - n2 = force_gimple_operand_gsi (&si, n2, true, NULL_TREE, + n2 = force_gimple_operand_gsi (&gsi, n2, true, NULL_TREE, true, GSI_SAME_STMT); stmt = gimple_build_cond (fd->loop.cond_code, n1, n2, NULL_TREE, NULL_TREE); - gsi_insert_before (&si, stmt, GSI_SAME_STMT); + gsi_insert_before (&gsi, stmt, GSI_SAME_STMT); if (walk_tree (gimple_cond_lhs_ptr (stmt), expand_omp_regimplify_p, NULL, NULL) || walk_tree (gimple_cond_rhs_ptr (stmt), expand_omp_regimplify_p, NULL, NULL)) { - si = gsi_for_stmt (stmt); - gimple_regimplify_operands (stmt, &si); + gsi = gsi_for_stmt (stmt); + gimple_regimplify_operands (stmt, &gsi); } se = split_block (entry_bb, stmt); se->flags = EDGE_TRUE_VALUE; @@ -6258,25 +6258,25 @@ expand_omp_for_static_chunk (struct omp_region *region, if (gimple_in_ssa_p (cfun)) { int dest_idx = find_edge (entry_bb, fin_bb)->dest_idx; - for (si = gsi_start_phis (fin_bb); - !gsi_end_p (si); gsi_next (&si)) + for (gsi = gsi_start_phis (fin_bb); + !gsi_end_p (gsi); gsi_next (&gsi)) { - gimple phi = gsi_stmt (si); + gimple phi = gsi_stmt (gsi); add_phi_arg (phi, gimple_phi_arg_def (phi, dest_idx), se, UNKNOWN_LOCATION); } } - si = gsi_last_bb (entry_bb); + gsi = gsi_last_bb (entry_bb); } t = build_call_expr (builtin_decl_explicit (get_num_threads), 0); t = fold_convert (itype, t); - nthreads = force_gimple_operand_gsi (&si, t, true, NULL_TREE, + nthreads = force_gimple_operand_gsi (&gsi, t, true, NULL_TREE, true, GSI_SAME_STMT); t = build_call_expr (builtin_decl_explicit (get_thread_num), 0); t = fold_convert (itype, t); - threadid = force_gimple_operand_gsi (&si, t, true, NULL_TREE, + threadid = force_gimple_operand_gsi (&gsi, t, true, NULL_TREE, true, GSI_SAME_STMT); n1 = fd->loop.n1; @@ -6293,14 +6293,14 @@ expand_omp_for_static_chunk (struct omp_region *region, gcc_assert (innerc); n2 = OMP_CLAUSE_DECL (innerc); } - n1 = force_gimple_operand_gsi (&si, fold_convert (type, n1), + n1 = force_gimple_operand_gsi (&gsi, fold_convert (type, n1), true, NULL_TREE, true, GSI_SAME_STMT); - n2 = force_gimple_operand_gsi (&si, fold_convert (itype, n2), + n2 = force_gimple_operand_gsi (&gsi, fold_convert (itype, n2), true, NULL_TREE, true, GSI_SAME_STMT); - step = force_gimple_operand_gsi (&si, fold_convert (itype, step), + step = force_gimple_operand_gsi (&gsi, fold_convert (itype, step), true, NULL_TREE, true, GSI_SAME_STMT); fd->chunk_size - = force_gimple_operand_gsi (&si, fold_convert (itype, fd->chunk_size), + = force_gimple_operand_gsi (&gsi, fold_convert (itype, fd->chunk_size), true, NULL_TREE, true, GSI_SAME_STMT); t = build_int_cst (itype, (fd->loop.cond_code == LT_EXPR ? -1 : 1)); @@ -6314,7 +6314,7 @@ expand_omp_for_static_chunk (struct omp_region *region, else t = fold_build2 (TRUNC_DIV_EXPR, itype, t, step); t = fold_convert (itype, t); - n = force_gimple_operand_gsi (&si, t, true, NULL_TREE, + n = force_gimple_operand_gsi (&gsi, t, true, NULL_TREE, true, GSI_SAME_STMT); trip_var = create_tmp_reg (itype, ".trip"); @@ -6332,7 +6332,7 @@ expand_omp_for_static_chunk (struct omp_region *region, } stmt = gimple_build_assign (trip_init, build_int_cst (itype, 0)); - gsi_insert_before (&si, stmt, GSI_SAME_STMT); + gsi_insert_before (&gsi, stmt, GSI_SAME_STMT); t = fold_build2 (MULT_EXPR, itype, threadid, fd->chunk_size); t = fold_build2 (MULT_EXPR, itype, t, step); @@ -6340,31 +6340,31 @@ expand_omp_for_static_chunk (struct omp_region *region, t = fold_build_pointer_plus (n1, t); else t = fold_build2 (PLUS_EXPR, type, t, n1); - v_extra = force_gimple_operand_gsi (&si, t, true, NULL_TREE, - true, GSI_SAME_STMT); + vextra = force_gimple_operand_gsi (&gsi, t, true, NULL_TREE, + true, GSI_SAME_STMT); /* Remove the GIMPLE_OMP_FOR. */ - gsi_remove (&si, true); + gsi_remove (&gsi, true); /* Iteration space partitioning goes in ITER_PART_BB. */ - si = gsi_last_bb (iter_part_bb); + gsi = gsi_last_bb (iter_part_bb); t = fold_build2 (MULT_EXPR, itype, trip_main, nthreads); t = fold_build2 (PLUS_EXPR, itype, t, threadid); t = fold_build2 (MULT_EXPR, itype, t, fd->chunk_size); - s0 = force_gimple_operand_gsi (&si, t, true, NULL_TREE, + s0 = force_gimple_operand_gsi (&gsi, t, true, NULL_TREE, false, GSI_CONTINUE_LINKING); t = fold_build2 (PLUS_EXPR, itype, s0, fd->chunk_size); t = fold_build2 (MIN_EXPR, itype, t, n); - e0 = force_gimple_operand_gsi (&si, t, true, NULL_TREE, + e0 = force_gimple_operand_gsi (&gsi, t, true, NULL_TREE, false, GSI_CONTINUE_LINKING); t = build2 (LT_EXPR, boolean_type_node, s0, n); - gsi_insert_after (&si, gimple_build_cond_empty (t), GSI_CONTINUE_LINKING); + gsi_insert_after (&gsi, gimple_build_cond_empty (t), GSI_CONTINUE_LINKING); /* Setup code for sequential iteration goes in SEQ_START_BB. */ - si = gsi_start_bb (seq_start_bb); + gsi = gsi_start_bb (seq_start_bb); tree startvar = fd->loop.v; tree endvar = NULL_TREE; @@ -6390,12 +6390,12 @@ expand_omp_for_static_chunk (struct omp_region *region, else t = fold_build2 (PLUS_EXPR, type, t, n1); t = fold_convert (TREE_TYPE (startvar), t); - t = force_gimple_operand_gsi (&si, t, + t = force_gimple_operand_gsi (&gsi, t, DECL_P (startvar) && TREE_ADDRESSABLE (startvar), NULL_TREE, false, GSI_CONTINUE_LINKING); stmt = gimple_build_assign (startvar, t); - gsi_insert_after (&si, stmt, GSI_CONTINUE_LINKING); + gsi_insert_after (&gsi, stmt, GSI_CONTINUE_LINKING); t = fold_convert (itype, e0); t = fold_build2 (MULT_EXPR, itype, t, step); @@ -6404,73 +6404,73 @@ expand_omp_for_static_chunk (struct omp_region *region, else t = fold_build2 (PLUS_EXPR, type, t, n1); t = fold_convert (TREE_TYPE (startvar), t); - e = force_gimple_operand_gsi (&si, t, true, NULL_TREE, + e = force_gimple_operand_gsi (&gsi, t, true, NULL_TREE, false, GSI_CONTINUE_LINKING); if (endvar) { stmt = gimple_build_assign (endvar, e); - gsi_insert_after (&si, stmt, GSI_CONTINUE_LINKING); + gsi_insert_after (&gsi, stmt, GSI_CONTINUE_LINKING); if (useless_type_conversion_p (TREE_TYPE (fd->loop.v), TREE_TYPE (e))) stmt = gimple_build_assign (fd->loop.v, e); else stmt = gimple_build_assign_with_ops (NOP_EXPR, fd->loop.v, e, NULL_TREE); - gsi_insert_after (&si, stmt, GSI_CONTINUE_LINKING); + gsi_insert_after (&gsi, stmt, GSI_CONTINUE_LINKING); } if (fd->collapse > 1) - expand_omp_for_init_vars (fd, &si, counts, inner_stmt, startvar); + expand_omp_for_init_vars (fd, &gsi, counts, inner_stmt, startvar); if (!broken_loop) { /* The code controlling the sequential loop goes in CONT_BB, replacing the GIMPLE_OMP_CONTINUE. */ - si = gsi_last_bb (cont_bb); - stmt = gsi_stmt (si); + gsi = gsi_last_bb (cont_bb); + stmt = gsi_stmt (gsi); gcc_assert (gimple_code (stmt) == GIMPLE_OMP_CONTINUE); - v_main = gimple_omp_continue_control_use (stmt); - v_back = gimple_omp_continue_control_def (stmt); + vmain = gimple_omp_continue_control_use (stmt); + vback = gimple_omp_continue_control_def (stmt); if (!gimple_omp_for_combined_p (fd->for_stmt)) { if (POINTER_TYPE_P (type)) - t = fold_build_pointer_plus (v_main, step); + t = fold_build_pointer_plus (vmain, step); else - t = fold_build2 (PLUS_EXPR, type, v_main, step); - if (DECL_P (v_back) && TREE_ADDRESSABLE (v_back)) - t = force_gimple_operand_gsi (&si, t, true, NULL_TREE, + t = fold_build2 (PLUS_EXPR, type, vmain, step); + if (DECL_P (vback) && TREE_ADDRESSABLE (vback)) + t = force_gimple_operand_gsi (&gsi, t, true, NULL_TREE, true, GSI_SAME_STMT); - stmt = gimple_build_assign (v_back, t); - gsi_insert_before (&si, stmt, GSI_SAME_STMT); + stmt = gimple_build_assign (vback, t); + gsi_insert_before (&gsi, stmt, GSI_SAME_STMT); t = build2 (fd->loop.cond_code, boolean_type_node, - DECL_P (v_back) && TREE_ADDRESSABLE (v_back) - ? t : v_back, e); - gsi_insert_before (&si, gimple_build_cond_empty (t), GSI_SAME_STMT); + DECL_P (vback) && TREE_ADDRESSABLE (vback) + ? t : vback, e); + gsi_insert_before (&gsi, gimple_build_cond_empty (t), GSI_SAME_STMT); } /* Remove GIMPLE_OMP_CONTINUE. */ - gsi_remove (&si, true); + gsi_remove (&gsi, true); if (fd->collapse > 1 && !gimple_omp_for_combined_p (fd->for_stmt)) collapse_bb = extract_omp_for_update_vars (fd, cont_bb, body_bb); /* Trip update code goes into TRIP_UPDATE_BB. */ - si = gsi_start_bb (trip_update_bb); + gsi = gsi_start_bb (trip_update_bb); t = build_int_cst (itype, 1); t = build2 (PLUS_EXPR, itype, trip_main, t); stmt = gimple_build_assign (trip_back, t); - gsi_insert_after (&si, stmt, GSI_CONTINUE_LINKING); + gsi_insert_after (&gsi, stmt, GSI_CONTINUE_LINKING); } /* Replace the GIMPLE_OMP_RETURN with a barrier, or nothing. */ - si = gsi_last_bb (exit_bb); - if (!gimple_omp_return_nowait_p (gsi_stmt (si))) + gsi = gsi_last_bb (exit_bb); + if (!gimple_omp_return_nowait_p (gsi_stmt (gsi))) { - t = gimple_omp_return_lhs (gsi_stmt (si)); - gsi_insert_after (&si, build_omp_barrier (t), GSI_SAME_STMT); + t = gimple_omp_return_lhs (gsi_stmt (gsi)); + gsi_insert_after (&gsi, build_omp_barrier (t), GSI_SAME_STMT); } - gsi_remove (&si, true); + gsi_remove (&gsi, true); /* Connect the new blocks. */ find_edge (iter_part_bb, seq_start_bb)->flags = EDGE_TRUE_VALUE; @@ -6532,9 +6532,9 @@ expand_omp_for_static_chunk (struct omp_region *region, locus = gimple_phi_arg_location_from_edge (phi, se); /* A special case -- fd->loop.v is not yet computed in - iter_part_bb, we need to use v_extra instead. */ + iter_part_bb, we need to use vextra instead. */ if (t == fd->loop.v) - t = v_extra; + t = vextra; add_phi_arg (nphi, t, ene, locus); locus = redirect_edge_var_map_location (vm); add_phi_arg (nphi, redirect_edge_var_map_def (vm), re, locus);