From patchwork Tue Jul 14 09:47:17 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: 494960 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 2E7F11402AE for ; Tue, 14 Jul 2015 19:47:41 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=sBG1CdzX; 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 :message-id:date:from:mime-version:to:cc:subject:references :in-reply-to:content-type; q=dns; s=default; b=Z4zbUkOV56Yn9qG5i dbKhhFMLPPWX+Kvb0mZ7SfbhDz4bd0CBhqPQL+ryNTY7ZPk+nE1h/T8HBT7K3hRn qK2mpSpSUy8dLscjFIT9M8wQu+UQQRLLpMuLQ+h04chgI768FcWvCIx2Crl51NFS oBRa2aQeT8LVj/AdOcxLSsfeIE= 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 :message-id:date:from:mime-version:to:cc:subject:references :in-reply-to:content-type; s=default; bh=A0XN2kqe+G7oFaukl/as/Pa fAbU=; b=sBG1CdzXvYDE1KA0tuzO7dvPQxkoOeWDzC1hoCoU9U4bR301Omt9TSj ss7YJMDrI1HZSn+IOWPGXFWSh/tPpb47nJ3tNP4qfETDerYyPNNMRUlFj+Ptb9U3 PtIFfHT5vpAnTS0CMdhZjJM5AjeZx5LEPJ47WdLnbxriix2G9N1U= Received: (qmail 56410 invoked by alias); 14 Jul 2015 09:47:33 -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 55731 invoked by uid 89); 14 Jul 2015 09:47:33 -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, RCVD_IN_DNSWL_LOW, SPF_PASS 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; Tue, 14 Jul 2015 09:47:32 +0000 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 1ZEwoC-000657-66 from Tom_deVries@mentor.com for gcc-patches@gcc.gnu.org; Tue, 14 Jul 2015 02:47:28 -0700 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; Tue, 14 Jul 2015 10:47:26 +0100 Message-ID: <55A4DAA5.9090202@mentor.com> Date: Tue, 14 Jul 2015 11:47:17 +0200 From: Tom de Vries User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Thomas Schwinge CC: "Rech, Alex" , Tom de Vries , Nathan Sidwell , Subject: Re: Merge trunk r225562 (2015-07-08) into gomp-4_0-branch References: <55A04C2C.1060709@mentor.com> <87lhel4sve.fsf@schwinge.name> <55A366B0.3020007@mentor.com> <87h9p84fwy.fsf@schwinge.name> In-Reply-To: <87h9p84fwy.fsf@schwinge.name> On 13/07/15 10:31, Thomas Schwinge wrote: > Hi Tom! > > On Mon, 13 Jul 2015 09:20:16 +0200, Tom de Vries wrote: >> On 12/07/15 11:39, Thomas Schwinge wrote: >>> On Fri, 10 Jul 2015 18:50:20 -0400, Nathan Sidwell wrote: >>>> it looks like the most recent merge from trunk to gomp4 was early May. I think >>>> it is time for another one -- can you handle that? >>> >>> Indeed :-) -- and, as it happens, resolving the "merge artifacts" is one >>> of the things I've been working on last week. I hope I got that all >>> right, in particular gcc/tree-parloops.c (Tom), >> >> I've looked at the merge commit, gcc/tree-parloops.c was not modified. > > (Well, it was, but not "substantially".) You'd ported all your trunk > commits to gomp-4_0-branch already (thanks!), and in the functions where > I got merge conflicts, I just retained the code that was present on > gomp-4_0-branch already, which apparently was the right thing to do. ;-) > > >>> gcc/tree-ssa-loop-ch.c (Tom), >> >> That looks ok. I just wonder whether we could have derived >> pass_ch_oacc_kernels from pass_ch instead of from ch_base, avoiding >> duplicating the execute function, and have >> pass_ch_oacc_kernels::process_loop_p call pass_ch::process_loop_p rather >> than inline it. > > Your call, depending on what makes the most sense regarding the semantics > of pass_ch_oacc_kernels. > I've build attached patch, and ran goacc.exp, that all went ok. I'll do bootstrap and reg-test, and commit. > I was just (pleasantly) surprised to find myself (capable of) doing a > little C++ programming, with classes, inheritance, and so on. ;-) > Heh. I know the feeling :) Thanks, - Tom Derive pass_ch_oacc_kernels from pass_ch 2015-07-14 Tom de Vries * tree-ssa-loop-ch.c (pass_ch::pass_ch (pass_data, gcc::context)): New constructor. (pass_ch_oacc_kernels): Derive from pass_ch. (pass_ch_oacc_kernels::pass_ch_oacc_kernels(gcc::context)): Call pass_ch constructor. (pass_ch_oacc_kernels::execute): Remove. (pass_ch_oacc_kernels::process_loop_p): Rewrite using pass_ch::process_loop_p. --- gcc/tree-ssa-loop-ch.c | 25 ++++++++----------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/gcc/tree-ssa-loop-ch.c b/gcc/tree-ssa-loop-ch.c index 4256ef0..c28e1e8 100644 --- a/gcc/tree-ssa-loop-ch.c +++ b/gcc/tree-ssa-loop-ch.c @@ -165,6 +165,10 @@ public: : ch_base (pass_data_ch, ctxt) {} + pass_ch (pass_data data, gcc::context *ctxt) + : ch_base (data, ctxt) + {} + /* opt_pass methods: */ virtual bool gate (function *) { return flag_tree_ch != 0; } @@ -436,43 +440,30 @@ const pass_data pass_data_ch_oacc_kernels = TODO_cleanup_cfg, /* todo_flags_finish */ }; -class pass_ch_oacc_kernels : public ch_base +class pass_ch_oacc_kernels : public pass_ch { public: pass_ch_oacc_kernels (gcc::context *ctxt) - : ch_base (pass_data_ch_oacc_kernels, ctxt) + : pass_ch (pass_data_ch_oacc_kernels, ctxt) {} /* opt_pass methods: */ virtual bool gate (function *) { return true; } - virtual unsigned int execute (function *); protected: /* ch_base method: */ virtual bool process_loop_p (struct loop *loop); }; // class pass_ch_oacc_kernels -unsigned int -pass_ch_oacc_kernels::execute (function *fun) -{ - loop_optimizer_init (LOOPS_HAVE_PREHEADERS - | LOOPS_HAVE_SIMPLE_LATCHES); - - unsigned int res = copy_headers (fun); - - loop_optimizer_finalize (); - return res; -} - } // anon namespace bool pass_ch_oacc_kernels::process_loop_p (struct loop *loop) { - if (do_while_loop_p (loop)) + if (!loop->in_oacc_kernels_region) return false; - return loop->in_oacc_kernels_region; + return pass_ch::process_loop_p (loop); } gimple_opt_pass * -- 1.9.1