From patchwork Mon Nov 9 09:44:35 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom de Vries X-Patchwork-Id: 541669 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 161BF1402C6 for ; Mon, 9 Nov 2015 20:45:24 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=TgdW233u; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to:cc :from:subject:message-id:date:mime-version:content-type; q=dns; s=default; b=ldcPIPyibWmoqqUJoC2HSs3+fdB1rdr+FrNSsM28OHGdls3tAi Np8A1+n5yr0ZTmDrpYCmzTRIh5Sqk1OrYiiOXEF5kjVU1qId76jHc+fRoT33Cw+T kKugLtQjvc0JSY+i6x+tzk08U/3YWWbpQnDHjU7zPdlsFbiVifhCfc2iM= 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:to:cc :from:subject:message-id:date:mime-version:content-type; s= default; bh=6xk5BHT/Z6NI3gU8kQvZ/lX2IfM=; b=TgdW233u3OrxPow8IdLu 7FnHfmFJktEIub6P4eQ4EdtbZ2AFShp0lSzSrLdhBaZHxYrpLWR3isIkBMz98+g8 /IrcuAJmlnZIDMZ3aju1ZUZgndwHQdVzfLLhhLh256qARqqMi+M3txwlWGu+JUkP nxDYgNS8Gt/ewpcifBZhK00= Received: (qmail 32073 invoked by alias); 9 Nov 2015 09:45:14 -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 32033 invoked by uid 89); 9 Nov 2015 09:45:08 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD, SPF_PASS autolearn=ham version=3.3.2 X-HELO: fencepost.gnu.org Received: from fencepost.gnu.org (HELO fencepost.gnu.org) (208.118.235.10) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Mon, 09 Nov 2015 09:45:07 +0000 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55337) by fencepost.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1Zvj0b-0002BP-K4 for gcc-patches@gnu.org; Mon, 09 Nov 2015 04:45:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zvj0W-0000CW-P9 for gcc-patches@gnu.org; Mon, 09 Nov 2015 04:45:05 -0500 Received: from relay1.mentorg.com ([192.94.38.131]:64698) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zvj0W-0000CR-GD for gcc-patches@gnu.org; Mon, 09 Nov 2015 04:45:00 -0500 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=SVR-IES-FEM-01.mgc.mentorg.com) by relay1.mentorg.com with esmtp id 1Zvj0V-0007Va-HV from Tom_deVries@mentor.com ; Mon, 09 Nov 2015 01:44:59 -0800 Received: from [127.0.0.1] (137.202.0.76) by SVR-IES-FEM-01.mgc.mentorg.com (137.202.0.104) with Microsoft SMTP Server id 14.3.224.2; Mon, 9 Nov 2015 09:44:58 +0000 To: "gcc-patches@gnu.org" CC: Jakub Jelinek From: Tom de Vries Subject: [gomp4, committed] Remove ssa support in expand_omp_target Message-ID: <56406B03.8030303@mentor.com> Date: Mon, 9 Nov 2015 10:44:35 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Windows NT kernel [generic] [fuzzy] X-Received-From: 192.94.38.131 Hi, now that we don't postpone expanding the kernels region anymore, we don't need ssa support in expand_omp_target. Committed to gomp-4_0-branch. Thanks, - Tom Remove ssa support in expand_omp_target 2015-11-09 Tom de Vries * omp-low.c (release_first_vuse_in_edge_dest): Remove (expand_omp_target): Remove ssa support. --- gcc/omp-low.c | 74 ++++------------------------------------------------------- 1 file changed, 5 insertions(+), 69 deletions(-) diff --git a/gcc/omp-low.c b/gcc/omp-low.c index cd9c9e6..ed7640a 100644 --- a/gcc/omp-low.c +++ b/gcc/omp-low.c @@ -6973,38 +6973,6 @@ expand_omp_build_assign (gimple_stmt_iterator *gsi_p, tree to, tree from, } } -/* Release the first vuse in bb E->dest, either normal or phi arg for - edge E. */ - -static void -release_first_vuse_in_edge_dest (edge e) -{ - gimple_stmt_iterator i; - basic_block bb = e->dest; - - for (i = gsi_start_phis (bb); !gsi_end_p (i); gsi_next (&i)) - { - gimple *phi = gsi_stmt (i); - tree arg = PHI_ARG_DEF_FROM_EDGE (phi, e); - - if (!virtual_operand_p (arg)) - continue; - - mark_virtual_operand_for_renaming (arg); - return; - } - - for (i = gsi_start_bb (bb); !gsi_end_p (i); gsi_next_nondebug (&i)) - { - gimple *stmt = gsi_stmt (i); - if (gimple_vuse (stmt) == NULL_TREE) - continue; - - mark_virtual_operand_for_renaming (gimple_vuse (stmt)); - return; - } -} - /* Expand the OpenMP parallel or task directive starting at REGION. */ static void @@ -12727,6 +12695,7 @@ expand_omp_target (struct omp_region *region) /* Supported by expand_omp_taskreg, but not here. */ if (child_cfun != NULL) gcc_checking_assert (!child_cfun->cfg); + gcc_checking_assert (!gimple_in_ssa_p (cfun)); entry_bb = region->entry; exit_bb = region->exit; @@ -12735,7 +12704,7 @@ expand_omp_target (struct omp_region *region) mark_loops_in_oacc_kernels_region (region->entry, region->exit); basic_block entry_succ_bb = single_succ (entry_bb); - if (offloaded && !gimple_in_ssa_p (cfun)) + if (offloaded) { gsi = gsi_last_bb (entry_succ_bb); if (gimple_code (gsi_stmt (gsi)) == GIMPLE_OMP_ENTRY_END) @@ -12793,25 +12762,8 @@ expand_omp_target (struct omp_region *region) gcc_assert (tgtcopy_stmt != NULL); arg = DECL_ARGUMENTS (child_fn); - if (!gimple_in_ssa_p (cfun)) - { - gcc_assert (gimple_assign_lhs (tgtcopy_stmt) == arg); - gsi_remove (&gsi, true); - } - else - { - tree lhs = gimple_assign_lhs (tgtcopy_stmt); - gcc_assert (SSA_NAME_VAR (lhs) == arg); - /* We'd like to set the rhs to the default def in the child_fn, - but it's too early to create ssa names in the child_fn. - Instead, we set the rhs to the parm. In - move_sese_region_to_fn, we introduce a default def for the - parm, map the parm to it's default def, and once we encounter - this stmt, replace the parm with the default def. */ - gimple_assign_set_rhs1 (tgtcopy_stmt, arg); - gcc_assert (ssa_default_def (cfun, arg) == NULL); - update_stmt (tgtcopy_stmt); - } + gcc_assert (gimple_assign_lhs (tgtcopy_stmt) == arg); + gsi_remove (&gsi, true); } /* Declare local variables needed in CHILD_CFUN. */ @@ -12854,23 +12806,11 @@ expand_omp_target (struct omp_region *region) stmt = gimple_build_return (NULL); gsi_insert_after (&gsi, stmt, GSI_SAME_STMT); gsi_remove (&gsi, true); - - /* A vuse in single_succ (exit_bb) may use a vdef from the region - which is about to be split off. Mark the vdef for renaming. */ - release_first_vuse_in_edge_dest (single_succ_edge (exit_bb)); } /* Move the offloading region into CHILD_CFUN. */ - if (gimple_in_ssa_p (cfun)) - { - init_tree_ssa (child_cfun); - init_ssa_operands (child_cfun); - child_cfun->gimple_df->in_ssa_p = true; - block = NULL_TREE; - } - else - block = gimple_block (entry_stmt); + block = gimple_block (entry_stmt); new_bb = move_sese_region_to_fn (child_cfun, entry_bb, exit_bb, block); if (exit_bb) @@ -12937,8 +12877,6 @@ expand_omp_target (struct omp_region *region) if (changed) cleanup_tree_cfg (); } - if (gimple_in_ssa_p (cfun)) - update_ssa (TODO_update_ssa); if (flag_checking && !loops_state_satisfies_p (LOOPS_NEED_FIXUP)) verify_loop_structure (); pop_cfun (); @@ -13257,8 +13195,6 @@ expand_omp_target (struct omp_region *region) gcc_assert (g && gimple_code (g) == GIMPLE_OMP_RETURN); gsi_remove (&gsi, true); } - if (gimple_in_ssa_p (cfun)) - update_ssa (TODO_update_ssa_only_virtuals); } /* Expand the parallel region tree rooted at REGION. Expansion -- 1.9.1