From patchwork Mon Nov 30 12:07:57 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Schwinge X-Patchwork-Id: 549971 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 3B66F1400DE for ; Mon, 30 Nov 2015 23:08:51 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=YFtqHmm/; 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:from :to:cc:subject:in-reply-to:references:date:message-id :mime-version:content-type; q=dns; s=default; b=GCyHztbC+TfMMsPM Ua/8utld8U5YSJhphvemUhpkTMf/dWHdu+er0Kzljl8mqAVJuW6/OG9luKOOFnPj VWZ2/EEaTDGiTvslCdy3N5JpLmlaz0VM0Z0Dio51MzqWeMNZrZQFVCP+MrETDKwV umF8osVxtuaRTvKQO/RHshkGvZI= 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:cc:subject:in-reply-to:references:date:message-id :mime-version:content-type; s=default; bh=rRoBhhRwgE3Iscv0HV5EFc BJDYU=; b=YFtqHmm/t8PVCt5my+fgJdX5HR9gAsgdMefkplxKZpgVIA0THb8QK6 gtkyDgmDU8ExSyefX5+228hm5SgksFaWb5LZ1lFML8UaoCAa86x9o4Lym5cj1SUy +jLI8alCg6AdmAF6XqPPFLoynZIO9OxaIpIoEbh/JCMHtYHxN9TC0= Received: (qmail 35622 invoked by alias); 30 Nov 2015 12:08:41 -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 35611 invoked by uid 89); 30 Nov 2015 12:08:39 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=AWL, BAYES_00, SPF_PASS, T_RP_MATCHES_RCVD 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, 30 Nov 2015 12:08:37 +0000 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51621) by fencepost.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1a3NFz-0005fw-Bg for gcc-patches@gnu.org; Mon, 30 Nov 2015 07:08:35 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a3NFw-0001qp-Bw for gcc-patches@gnu.org; Mon, 30 Nov 2015 07:08:35 -0500 Received: from relay1.mentorg.com ([192.94.38.131]:48109) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a3NFw-0001lX-2b for gcc-patches@gnu.org; Mon, 30 Nov 2015 07:08:32 -0500 Received: from svr-orw-fem-04.mgc.mentorg.com ([147.34.97.41]) by relay1.mentorg.com with esmtp id 1a3NFn-00016g-Ng from Thomas_Schwinge@mentor.com ; Mon, 30 Nov 2015 04:08:23 -0800 Received: from tftp-cs (147.34.91.1) by svr-orw-fem-04.mgc.mentorg.com (147.34.97.41) with Microsoft SMTP Server id 14.3.224.2; Mon, 30 Nov 2015 04:08:23 -0800 Received: by tftp-cs (Postfix, from userid 49978) id D8D8EC22FD; Mon, 30 Nov 2015 04:08:22 -0800 (PST) From: Thomas Schwinge To: Tom de Vries , "gcc-patches@gnu.org" CC: Jakub Jelinek , Richard Biener Subject: [gomp4] Use pass_ch instead of pass_ch_oacc_kernels (was: [PATCH, 8/16] Add pass_ch_oacc_kernels) In-Reply-To: <5643A516.9040500@mentor.com> References: <5640BD31.2060602@mentor.com> <5640E6EF.1050903@mentor.com> <5643A516.9040500@mentor.com> User-Agent: Notmuch/0.9-125-g4686d11 (http://notmuchmail.org) Emacs/24.5.1 (i586-pc-linux-gnu) Date: Mon, 30 Nov 2015 13:07:57 +0100 Message-ID: <87poyrofky.fsf@kepler.schwinge.homeip.net> 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! On Wed, 11 Nov 2015 21:29:10 +0100, Tom de Vries wrote: > On 09/11/15 19:33, Tom de Vries wrote: > > On 09/11/15 16:35, Tom de Vries wrote: > > this patch adds a pass pass_ch_oacc_kernels, which is like pass_ch, but > > only runs for loops with oacc_kernels_region set. > > > > [ But... thinking about it a bit more, I think that we could use a > > regular pass_ch instead. We only use the kernels pass group for a single > > loop nest in a kernels region, and we mark all the loops in the loop > > nest with oacc_kernels_region. So I think that the oacc_kernels_region > > test in pass_ch_oacc_kernels::process_loop_p evaluates to true. ] > > > > So, I'll try to confirm with retesting that we can drop this patch. > > > > That's confirmed. I can use pass_ch instead of pass_ch_oacc_kernels, so > I'm dropping this patch from the series. Committed to gomp-4_0-branch in r231067: commit 8249e606d83025092e3b0b227360f7e38fe591d4 Author: tschwinge Date: Mon Nov 30 12:05:50 2015 +0000 Use pass_ch instead of pass_ch_oacc_kernels gcc/ * passes.def: Use pass_ch instead of pass_ch_oacc_kernels. * tree-pass.h (make_pass_ch_oacc_kernels): Remove. * tree-ssa-loop-ch.c: Revert to trunk r230907 version. gcc/testsuite/ * gcc.dg/tree-ssa/copy-headers.c: Update for new pass_ch. * gcc.dg/tree-ssa/foldconst-2.c: Likewise. * gcc.dg/tree-ssa/loop-40.c: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gomp-4_0-branch@231067 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog.gomp | 6 +++ gcc/passes.def | 2 +- gcc/testsuite/ChangeLog.gomp | 6 +++ gcc/testsuite/gcc.dg/tree-ssa/copy-headers.c | 4 +- gcc/testsuite/gcc.dg/tree-ssa/foldconst-2.c | 4 +- gcc/testsuite/gcc.dg/tree-ssa/loop-40.c | 4 +- gcc/tree-pass.h | 1 - gcc/tree-ssa-loop-ch.c | 60 +++----------------------- 8 files changed, 24 insertions(+), 63 deletions(-) Grüße Thomas diff --git gcc/ChangeLog.gomp gcc/ChangeLog.gomp index 54712ab..2c8f0c2 100644 --- gcc/ChangeLog.gomp +++ gcc/ChangeLog.gomp @@ -1,3 +1,9 @@ +2015-11-30 Thomas Schwinge + + * passes.def: Use pass_ch instead of pass_ch_oacc_kernels. + * tree-pass.h (make_pass_ch_oacc_kernels): Remove. + * tree-ssa-loop-ch.c: Revert to trunk r230907 version. + 2015-11-18 Nathan Sidwell * config/nvptx/nvptx.c: Remove unneeded #includes. Backport diff --git gcc/passes.def gcc/passes.def index e44bfac..f4eb235 100644 --- gcc/passes.def +++ gcc/passes.def @@ -93,7 +93,7 @@ along with GCC; see the file COPYING3. If not see NEXT_PASS (pass_oacc_kernels); PUSH_INSERT_PASSES_WITHIN (pass_oacc_kernels) NEXT_PASS (pass_dominator, false /* may_peel_loop_headers_p */); - NEXT_PASS (pass_ch_oacc_kernels); + NEXT_PASS (pass_ch); NEXT_PASS (pass_dominator, false /* may_peel_loop_headers_p */); NEXT_PASS (pass_tree_loop_init); NEXT_PASS (pass_lim); diff --git gcc/testsuite/ChangeLog.gomp gcc/testsuite/ChangeLog.gomp index dd3b1f5..59733bd 100644 --- gcc/testsuite/ChangeLog.gomp +++ gcc/testsuite/ChangeLog.gomp @@ -1,3 +1,9 @@ +2015-11-30 Thomas Schwinge + + * gcc.dg/tree-ssa/copy-headers.c: Update for new pass_ch. + * gcc.dg/tree-ssa/foldconst-2.c: Likewise. + * gcc.dg/tree-ssa/loop-40.c: Likewise. + 2015-11-19 Cesar Philippidis * gfortran.dg/goacc/routine-6.f90: Ensure that the device clause is diff --git gcc/testsuite/gcc.dg/tree-ssa/copy-headers.c gcc/testsuite/gcc.dg/tree-ssa/copy-headers.c index 4241b40..a5a8212 100644 --- gcc/testsuite/gcc.dg/tree-ssa/copy-headers.c +++ gcc/testsuite/gcc.dg/tree-ssa/copy-headers.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -fdump-tree-ch-details" } */ +/* { dg-options "-O2 -fdump-tree-ch2-details" } */ extern int foo (int); @@ -12,4 +12,4 @@ void bla (void) } /* There should be a header duplicated. */ -/* { dg-final { scan-tree-dump-times "Duplicating header" 1 "ch"} } */ +/* { dg-final { scan-tree-dump-times "Duplicating header" 1 "ch2"} } */ diff --git gcc/testsuite/gcc.dg/tree-ssa/foldconst-2.c gcc/testsuite/gcc.dg/tree-ssa/foldconst-2.c index eb1e6de..e9a6f87 100644 --- gcc/testsuite/gcc.dg/tree-ssa/foldconst-2.c +++ gcc/testsuite/gcc.dg/tree-ssa/foldconst-2.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -fdump-tree-ch" } */ +/* { dg-options "-O2 -fdump-tree-ch2" } */ typedef union tree_node *tree; enum tree_code { @@ -56,4 +56,4 @@ emit_support_tinfos (void) } /* We should copy loop header to fundamentals[0] and then fold it way into known value. */ -/* { dg-final { scan-tree-dump-not "fundamentals.0" "ch"} } */ +/* { dg-final { scan-tree-dump-not "fundamentals.0" "ch2"} } */ diff --git gcc/testsuite/gcc.dg/tree-ssa/loop-40.c gcc/testsuite/gcc.dg/tree-ssa/loop-40.c index 8397396..36db565 100644 --- gcc/testsuite/gcc.dg/tree-ssa/loop-40.c +++ gcc/testsuite/gcc.dg/tree-ssa/loop-40.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -fdump-tree-ch-details" } */ +/* { dg-options "-O2 -fdump-tree-ch2-details" } */ int mymax2(int *it, int *end) { @@ -10,4 +10,4 @@ int mymax2(int *it, int *end) return max; } -/* { dg-final { scan-tree-dump "Duplicating header" "ch" } } */ +/* { dg-final { scan-tree-dump "Duplicating header" "ch2" } } */ diff --git gcc/tree-pass.h gcc/tree-pass.h index 8ac8e72..004db77 100644 --- gcc/tree-pass.h +++ gcc/tree-pass.h @@ -392,7 +392,6 @@ extern gimple_opt_pass *make_pass_iv_optimize (gcc::context *ctxt); extern gimple_opt_pass *make_pass_tree_loop_done (gcc::context *ctxt); extern gimple_opt_pass *make_pass_ch (gcc::context *ctxt); extern gimple_opt_pass *make_pass_ch_vect (gcc::context *ctxt); -extern gimple_opt_pass *make_pass_ch_oacc_kernels (gcc::context *ctxt); extern gimple_opt_pass *make_pass_ccp (gcc::context *ctxt); extern gimple_opt_pass *make_pass_split_paths (gcc::context *ctxt); extern gimple_opt_pass *make_pass_phi_only_cprop (gcc::context *ctxt); diff --git gcc/tree-ssa-loop-ch.c gcc/tree-ssa-loop-ch.c index 3773e94..6493fcc 100644 --- gcc/tree-ssa-loop-ch.c +++ gcc/tree-ssa-loop-ch.c @@ -33,7 +33,6 @@ along with GCC; see the file COPYING3. If not see #include "tree-inline.h" #include "tree-ssa-scopedtables.h" #include "tree-ssa-threadedge.h" -#include "omp-low.h" /* Duplicates headers of loops if they are small enough, so that the statements in the loop body are always executed when the loop is entered. This @@ -125,7 +124,7 @@ do_while_loop_p (struct loop *loop) namespace { -/* Common superclass for header-copying phases. */ +/* Common superclass for both header-copying phases. */ class ch_base : public gimple_opt_pass { protected: @@ -160,16 +159,14 @@ 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; } /* Initialize and finalize loop structures, copying headers inbetween. */ virtual unsigned int execute (function *); + opt_pass * clone () { return new pass_ch (m_ctxt); } + protected: /* ch_base method: */ virtual bool process_loop_p (struct loop *loop); @@ -341,8 +338,6 @@ ch_base::copy_headers (function *fun) return changed ? TODO_cleanup_cfg : 0; } -} // anon namespace - /* Initialize the loop structures we need, and finalize after. */ unsigned int @@ -408,6 +403,8 @@ pass_ch_vect::process_loop_p (struct loop *loop) return false; } +} // anon namespace + gimple_opt_pass * make_pass_ch_vect (gcc::context *ctxt) { @@ -419,50 +416,3 @@ make_pass_ch (gcc::context *ctxt) { return new pass_ch (ctxt); } - -namespace { - -const pass_data pass_data_ch_oacc_kernels = -{ - GIMPLE_PASS, /* type */ - "ch_oacc_kernels", /* name */ - OPTGROUP_LOOP, /* optinfo_flags */ - TV_TREE_CH, /* tv_id */ - ( PROP_cfg | PROP_ssa ), /* properties_required */ - 0, /* properties_provided */ - 0, /* properties_destroyed */ - 0, /* todo_flags_start */ - TODO_cleanup_cfg, /* todo_flags_finish */ -}; - -class pass_ch_oacc_kernels : public pass_ch -{ -public: - pass_ch_oacc_kernels (gcc::context *ctxt) - : pass_ch (pass_data_ch_oacc_kernels, ctxt) - {} - - /* opt_pass methods: */ - virtual bool gate (function *) { return true; } - -protected: - /* ch_base method: */ - virtual bool process_loop_p (struct loop *loop); -}; // class pass_ch_oacc_kernels - -} // anon namespace - -bool -pass_ch_oacc_kernels::process_loop_p (struct loop *loop) -{ - if (!loop->in_oacc_kernels_region) - return false; - - return pass_ch::process_loop_p (loop); -} - -gimple_opt_pass * -make_pass_ch_oacc_kernels (gcc::context *ctxt) -{ - return new pass_ch_oacc_kernels (ctxt); -}