From patchwork Wed Dec 15 15:54:43 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Frederik Harwath X-Patchwork-Id: 48978 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 6A0F63857C4B for ; Wed, 15 Dec 2021 16:18:16 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from esa3.mentor.iphmx.com (esa3.mentor.iphmx.com [68.232.137.180]) by sourceware.org (Postfix) with ESMTPS id 36612385802B for ; Wed, 15 Dec 2021 15:57:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 36612385802B Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mentor.com IronPort-SDR: 3ak5CTWWK+DJilwSvmt4Dnvv+//p2aj72RPNNNxvXAHGjGu69Nw+CjUOkUK6AQG9I3puiicVaD gyKrybtMdvwhaWRPA+tThTh6/ln1ebDs5ejAfvJE3Ej3OdcDLeSqWclVh22d0MjNTU2lc0CpuN ifyNM1Vklm7xxSu1hhxcKT2zm0Y9sh+i6pZDWJzk1WcuRur1pxR25jcSDjhq8yNcPRcIp+sWUG VwZEHY3A5h2dU6z6sDySWItEu30Cv03wv/PXNzbEDxAgqQH4HYzO7dLNpNYKGYfA3NPtcwSiJE 0vKDUBSo12UFe5ssDl8C/lq8 X-IronPort-AV: E=Sophos;i="5.88,207,1635235200"; d="scan'208";a="69584653" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa3.mentor.iphmx.com with ESMTP; 15 Dec 2021 07:57:23 -0800 IronPort-SDR: 6Sddxl63vu+dZ6plm50qdWMJd3pGQUgd5OjL+PKGwzyC9B8JFCfsXU4P4lkADSeXpD6VM6HQxa Z5S97chOpRoeRSz9vs/TQN44SwEMk4BTPUyRiBeu5+5N8HjjTbRbar9pg5WmQZR+zlFsgqSvoE IZU3Ddy7nkK6ZIy/oI5uL98fJ8ILp7fg2JEbILpNwBjPKWABecibmc6U+ejxDLB/VxE+UGYTMT 2NeRz2ZrduiIkQeslLx/Ert1kNijN/7Z9U4bK6Icf2t9KtA+i5E28rgP1/SG5lyOmoSEOIQ9VT 4K4= From: Frederik Harwath To: Subject: [PATCH 36/40] openacc: Enable reduction variable localization for "kernels" Date: Wed, 15 Dec 2021 16:54:43 +0100 Message-ID: <20211215155447.19379-37-frederik@codesourcery.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211215155447.19379-1-frederik@codesourcery.com> References: <20211215155447.19379-1-frederik@codesourcery.com> MIME-Version: 1.0 X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-09.mgc.mentorg.com (139.181.222.9) To SVR-IES-MBX-04.mgc.mentorg.com (139.181.222.4) X-Spam-Status: No, score=-12.8 required=5.0 tests=BAYES_00, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: thomas@codesourcery.com Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" gcc/ChangeLog: * gimplify.c (gimplify_omp_for): Enable localization on "kernels" regions. (gimplify_omp_workshare): Likewise. --- gcc/gimplify.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) -- 2.33.0 ----------------- Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht München, HRB 106955 diff --git a/gcc/gimplify.c b/gcc/gimplify.c index bf37388f947c..a0137089496b 100644 --- a/gcc/gimplify.c +++ b/gcc/gimplify.c @@ -12229,11 +12229,9 @@ gimplify_omp_for (tree *expr_p, gimple_seq *pre_p) && outer->region_type != ORT_ACC_KERNELS) outer = outer->outer_context; - /* FIXME: Reductions only work in parallel regions at present. We avoid - doing the reduction localization transformation in kernels regions - here, because the code to remove reductions in kernels regions cannot - handle that. */ - if (outer && outer->region_type == ORT_ACC_PARALLEL) + if (outer && (outer->region_type == ORT_ACC_PARALLEL + || (outer->region_type == ORT_ACC_KERNELS + && param_openacc_kernels == OPENACC_KERNELS_DECOMPOSE))) localize_reductions (OMP_FOR_CLAUSES (for_stmt), OMP_FOR_BODY (for_stmt)); } @@ -13767,8 +13765,9 @@ gimplify_omp_workshare (tree *expr_p, gimple_seq *pre_p) { push_gimplify_context (); - /* FIXME: Reductions are not supported in kernels regions yet. */ - if (/*ort == ORT_ACC_KERNELS ||*/ ort == ORT_ACC_PARALLEL) + if (ort == ORT_ACC_PARALLEL + || (ort == ORT_ACC_KERNELS + && param_openacc_kernels == OPENACC_KERNELS_DECOMPOSE)) localize_reductions (OMP_CLAUSES (expr), OMP_BODY (expr)); gimple *g = gimplify_and_return_first (OMP_BODY (expr), &body);