From patchwork Tue Sep 22 15:10:41 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Schwinge X-Patchwork-Id: 521111 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 69C10140134 for ; Wed, 23 Sep 2015 01:11:44 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=bVcwyKqT; 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:subject:in-reply-to:references:date:message-id:mime-version :content-type; q=dns; s=default; b=u+V3z2l/UyoRNZS5tZJBZNPupmKAK fXXRdhMfftI2VKHFatd/aPD591It3Ye0m3MyCKeeJTQbmr+svVaVm5hVeAzuCOyK oJrhRz1OHsrhtRJRMu1Jl+pH8f0V9HC4PMmA/HKUupwH74PZGICpoLsfHIebGV3G z4QihoAEk/zhak= 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:in-reply-to:references:date:message-id:mime-version :content-type; s=default; bh=r7gsJYRLYMSqqJmD2r6Oc47M2J0=; b=bVc wyKqT0yBSCGZyhcMsCvNJsP5WBUeGNLqaUg/a+EB9V0CVzaYgVcwLDWuLK41Rfr1 zG/BObiU0zwlP6tZiZ4g3XcSRG5JuXuUjbiJMZZcgEo8gVvP5GC1Oz9p47cOluQT lfKy1mluqPArVeuwgO+eq+v7bMwJAZYaepzFqk4o= Received: (qmail 60422 invoked by alias); 22 Sep 2015 15:11:37 -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 59470 invoked by uid 89); 22 Sep 2015 15:11:36 -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, 22 Sep 2015 15:11:34 +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 1ZePEB-0006hV-11 from Thomas_Schwinge@mentor.com for gcc-patches@gcc.gnu.org; Tue, 22 Sep 2015 08:11:31 -0700 Received: from feldtkeller.schwinge.homeip.net (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, 22 Sep 2015 16:10:48 +0100 From: Thomas Schwinge To: Nathan Sidwell , GCC Patches Subject: Re: [gomp4] ptx reduction simplification In-Reply-To: <55FCA6DC.1040802@acm.org> References: <55FCA6DC.1040802@acm.org> User-Agent: Notmuch/0.9-125-g4686d11 (http://notmuchmail.org) Emacs/24.5.1 (i586-pc-linux-gnu) Date: Tue, 22 Sep 2015 17:10:41 +0200 Message-ID: <87k2rizdzi.fsf@kepler.schwinge.homeip.net> MIME-Version: 1.0 Hi! On Fri, 18 Sep 2015 20:05:48 -0400, Nathan Sidwell wrote: > I've committed this patch to rework and simplify [...] > the reduction lowering hooks. > > The current implementation [...] > [was] overcomplicated in a number of ways. > * omp-low.h (omp_reduction_init_op): Declare. > * omp-low.c (omp_reduction_init_op): New, broken out of ... > (omp_reduction_init): ... here. Call it. > * tree-parloops.c (initialize_reductions): Use > omp_redutction_init_op. Should this go into trunk already? (I can test it, if you'd like me to.) > --- tree-parloops.c (revision 227903) > +++ tree-parloops.c (working copy) > @@ -566,7 +566,7 @@ reduc_stmt_res (gimple stmt) > int > initialize_reductions (reduction_info **slot, struct loop *loop) > { > - tree init, c; > + tree init; > tree bvar, type, arg; > edge e; > > @@ -582,12 +582,8 @@ initialize_reductions (reduction_info ** > type = TREE_TYPE (PHI_RESULT (reduc->reduc_phi)); > bvar = create_tmp_var (type, "reduction"); > > - c = build_omp_clause (gimple_location (reduc->reduc_stmt), > - OMP_CLAUSE_REDUCTION); > - OMP_CLAUSE_REDUCTION_CODE (c) = reduc->reduction_code; > - OMP_CLAUSE_DECL (c) = SSA_NAME_VAR (reduc_stmt_res (reduc->reduc_stmt)); > - > - init = omp_reduction_init (c, TREE_TYPE (bvar)); > + init = omp_reduction_init_op (gimple_location (reduc->reduc_stmt), > + reduc->reduction_code, type); > reduc->init = init; > > /* Replace the argument representing the initialization value [...]/source-gcc/gcc/tree-parloops.c: In function 'int initialize_reductions(reduction_info**, loop*)': [...]/source-gcc/gcc/tree-parloops.c:570:8: error: variable 'bvar' set but not used [-Werror=unused-but-set-variable] tree bvar, type, arg; ^ Committed to gomp-4_0-branch in r228016: commit f858a76ae899a95b712beaaa8c110f708fd06a7a Author: tschwinge Date: Tue Sep 22 15:07:23 2015 +0000 Address -Werror=unused-but-set-variable diagnostic gcc/ * tree-parloops.c (initialize_reductions): Remove local variable bvar. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gomp-4_0-branch@228016 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog.gomp | 5 +++++ gcc/tree-parloops.c | 6 ++---- 2 files changed, 7 insertions(+), 4 deletions(-) Grüße, Thomas diff --git gcc/ChangeLog.gomp gcc/ChangeLog.gomp index e70d6cb..b7dbba0 100644 --- gcc/ChangeLog.gomp +++ gcc/ChangeLog.gomp @@ -1,3 +1,8 @@ +2015-09-22 Thomas Schwinge + + * tree-parloops.c (initialize_reductions): Remove local variable + bvar. + 2015-09-18 Nathan Sidwell * omp-low.h (omp_reduction_init_op): Declare. diff --git gcc/tree-parloops.c gcc/tree-parloops.c index 5062732..04ec254 100644 --- gcc/tree-parloops.c +++ gcc/tree-parloops.c @@ -567,7 +567,7 @@ int initialize_reductions (reduction_info **slot, struct loop *loop) { tree init; - tree bvar, type, arg; + tree type, arg; edge e; struct reduction_info *const reduc = *slot; @@ -578,10 +578,8 @@ initialize_reductions (reduction_info **slot, struct loop *loop) /* In the phi node at the header, replace the argument coming from the preheader with the reduction initialization value. */ - /* Create a new variable to initialize the reduction. */ + /* Initialize the reduction. */ type = TREE_TYPE (PHI_RESULT (reduc->reduc_phi)); - bvar = create_tmp_var (type, "reduction"); - init = omp_reduction_init_op (gimple_location (reduc->reduc_stmt), reduc->reduction_code, type); reduc->init = init;