From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14945 invoked by alias); 18 Jan 2016 12:59:43 -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 14932 invoked by uid 89); 18 Jan 2016 12:59:42 -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,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:1807, HX-detected-operating-system:Windows 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, 18 Jan 2016 12:59:41 +0000 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35042) by fencepost.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1aL9PH-0002K6-2k for gcc-patches@gnu.org; Mon, 18 Jan 2016 07:59:39 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aL9PC-0000rO-GL for gcc-patches@gnu.org; Mon, 18 Jan 2016 07:59:38 -0500 Received: from relay1.mentorg.com ([192.94.38.131]:50663) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aL9PC-0000pV-B9 for gcc-patches@gnu.org; Mon, 18 Jan 2016 07:59:34 -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 1aL9Ov-0002UD-VI from Tom_deVries@mentor.com ; Mon, 18 Jan 2016 04:59:18 -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, 18 Jan 2016 12:58:29 +0000 Subject: [Committed] Allow pass_parallelize_loops to be run outside the loop pipeline To: Richard Biener References: <5640BD31.2060602@mentor.com> <5640F98B.5050601@mentor.com> <5649C508.80803@mentor.com> <5654570F.3050003@mentor.com> <566DA3BF.7040105@mentor.com> CC: "gcc-patches@gnu.org" , Jakub Jelinek , Richard Biener From: Tom de Vries Message-ID: <569CE16C.8030206@mentor.com> Date: Mon, 18 Jan 2016 12:59:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/mixed; boundary="------------030409080405060107030308" X-detected-operating-system: by eggs.gnu.org: Windows NT kernel [generic] [fuzzy] X-Received-From: 192.94.38.131 X-SW-Source: 2016-01/txt/msg01271.txt.bz2 --------------030409080405060107030308 Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit Content-length: 370 [ was: Re: [PIING][PATCH, 9/16] Add pass_parallelize_loops_oacc_kernels ] On 14/12/15 16:22, Richard Biener wrote: > Can the pass not just use a pass parameter to switch between oacc/non-oacc? It can, and that means that parloops is run outside the loops pipeline. This patch enables that. Bootstrapped and reg-tested on x86_64. Committed to trunk. Thanks, - Tom --------------030409080405060107030308 Content-Type: text/x-patch; name= "0001-Allow-pass_parallelize_loops-to-be-run-outside-the-loop-pipeline.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename*0="0001-Allow-pass_parallelize_loops-to-be-run-outside-the-loop"; filename*1="-pipeline.patch" Content-length: 1474 Allow pass_parallelize_loops to be run outside the loop pipeline 2016-01-18 Tom de Vries * tree-parloops.c (pass_parallelize_loops::execute): Allow pass_parallelize_loops to be run outside the loop pipeline. --- gcc/tree-parloops.c | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/gcc/tree-parloops.c b/gcc/tree-parloops.c index 46d70ac..885103e 100644 --- a/gcc/tree-parloops.c +++ b/gcc/tree-parloops.c @@ -2844,23 +2844,41 @@ public: unsigned pass_parallelize_loops::execute (function *fun) { - if (number_of_loops (fun) <= 1) - return 0; - tree nthreads = builtin_decl_explicit (BUILT_IN_OMP_GET_NUM_THREADS); if (nthreads == NULL_TREE) return 0; + bool in_loop_pipeline = scev_initialized_p (); + if (!in_loop_pipeline) + loop_optimizer_init (LOOPS_NORMAL + | LOOPS_HAVE_RECORDED_EXITS); + + if (number_of_loops (fun) <= 1) + return 0; + + if (!in_loop_pipeline) + { + rewrite_into_loop_closed_ssa (NULL, TODO_update_ssa); + scev_initialize (); + } + + unsigned int todo = 0; if (parallelize_loops ()) { fun->curr_properties &= ~(PROP_gimple_eomp); checking_verify_loop_structure (); - return TODO_update_ssa; + todo |= TODO_update_ssa; + } + + if (!in_loop_pipeline) + { + scev_finalize (); + loop_optimizer_finalize (); } - return 0; + return todo; } } // anon namespace --------------030409080405060107030308--