From patchwork Fri Sep 6 16:02:12 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julian Brown X-Patchwork-Id: 1159099 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-508522-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="vcU8j4TZ"; dkim-atps=neutral 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 46Q2Qf1ff1z9s00 for ; Sat, 7 Sep 2019 02:03:06 +1000 (AEST) 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:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; q=dns; s= default; b=QiWHDN4Lni6LbAUaOKr+CGuTfmALHNjerx2nGdoaW4XcpOpI8bgGc c+lT3XFChYkV9duGZivYSIe7vW+4x9T3nwH+i1/HBGuGBTDiNqNx9RtuiVTLDad1 j+m6IUxQ3Ar47FA0e8eoJ56nAVVvwOL0qRs+89tXMe+Gn4AnE3vDMY= 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:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s=default; bh=bi3jgBZuwOt1VVe/sUHrFr4pTqA=; b=vcU8j4TZcld2C+8tUaIbM9oS164J QXBu+o7AkihYNMLWSelkUFpiyvklaQ6JnlsvBvGrctHfiXVDiXTvk5xd8eHM8dFr qACjCcbWaD0oRmwVRrffLK+v828Gc6GoEv/s9E9i1O4T+pu9EHWDGXkdaV6385CN poKSvIcAvi4HrKA= Received: (qmail 112804 invoked by alias); 6 Sep 2019 16:02:30 -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 112751 invoked by uid 89); 6 Sep 2019 16:02:29 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-20.7 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy=HX-Languages-Length:1473, HContent-Transfer-Encoding:8bit X-HELO: esa4.mentor.iphmx.com Received: from esa4.mentor.iphmx.com (HELO esa4.mentor.iphmx.com) (68.232.137.252) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 06 Sep 2019 16:02:28 +0000 IronPort-SDR: 5r23y7l3/nApw3rEjn3mHaIRQaTVoK4SqBrucP0aLEHb7SvpjhQ5viXc4K2qP4i9XZ2Tzk76Mq WBD+2Xjr7Ga2WdZ1LWOJWI5CCZ9DCMKQInih7u+Smkak3s/e84k6SyTgKsKP39TB5yMBKPAc+h IhY+NDUp3D0lYl+mdYzOAs8FFlhgK7wZ78Kq48QmnO0j49aJNUzMVuyGS7szdTQMzXhe4yoCKV DSj3w8vwGKKLiQ8s5ytHNluClTUQ83ds2q1LdkOMlDGpydblDJ2vcmCcAgELoWU7EfiBrBTVm5 siQ= Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa4.mentor.iphmx.com with ESMTP; 06 Sep 2019 08:02:27 -0800 IronPort-SDR: Snx1Q96/E/rnJ4bEDuZ+cKKoSkLKwZxxegnlcBGqOwCquK1GVGNJMe9/thIoD87wLz7tlQKFur 0e7131pIf68y2usx/QL3Tlc9JsAOq6qYlJuWMmqUaaGO4l8AoDQLWMu2HUAjquw7//EdpEx0Dy aiW1+FnCJhoX/6ciMronqANyjmSP412jM6zq+iaA538TMlyYe77e6CeRrcmIbjizcqvHr07pFJ PR69TaQFp30qxuxgAdpVD8Vjf/8Sg+d2Oo0L3qInJELoweSFkqpbe3pjkGgtcvbHc9MmQGgy0k dyI= From: Julian Brown To: CC: Thomas Schwinge , Andrew Stubbs Subject: [PATCH] [og9] Use more appropriate var in localize_reductions call Date: Fri, 6 Sep 2019 09:02:12 -0700 Message-ID: <20190906160213.69722-2-julian@codesourcery.com> In-Reply-To: <20190906160213.69722-1-julian@codesourcery.com> References: <20190906160213.69722-1-julian@codesourcery.com> MIME-Version: 1.0 X-IsSubscribed: yes This patch uses a more appropriate local variable in the call to localize_reductions in gimplify_omp_for, for better self-documentation. Tested with offloading to AMD GCN. I will apply to the openacc-gcc-9-branch shortly. Julian ChangeLog gcc/ * gimplify.c (gimplify_omp_for): Use for_stmt in call to localize_reductions. --- gcc/ChangeLog.openacc | 5 +++++ gcc/gimplify.c | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog.openacc b/gcc/ChangeLog.openacc index ffe19bc5809..02667a2aed4 100644 --- a/gcc/ChangeLog.openacc +++ b/gcc/ChangeLog.openacc @@ -1,3 +1,8 @@ +2019-09-06 Julian Brown + + * gimplify.c (gimplify_omp_for): Use for_stmt in call to + localize_reductions. + 2019-09-06 Julian Brown * config/nvptx/nvptx.c (omp-sese.h): Include. diff --git a/gcc/gimplify.c b/gcc/gimplify.c index 3d869447d70..60761504a5e 100644 --- a/gcc/gimplify.c +++ b/gcc/gimplify.c @@ -11082,7 +11082,8 @@ gimplify_omp_for (tree *expr_p, gimple_seq *pre_p) here, because the code to remove reductions in kernels regions cannot handle that. */ if (outer && outer->region_type == ORT_ACC_PARALLEL) - localize_reductions (OMP_FOR_CLAUSES (*expr_p), OMP_FOR_BODY (*expr_p)); + localize_reductions (OMP_FOR_CLAUSES (for_stmt), + OMP_FOR_BODY (for_stmt)); } /* Set OMP_CLAUSE_LINEAR_NO_COPYIN flag on explicit linear