From patchwork Tue May 11 08:57:44 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julian Brown X-Patchwork-Id: 1476984 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=gcc-patches-bounces@gcc.gnu.org; receiver=) Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4FfWzH2RJyz9sjJ for ; Tue, 11 May 2021 18:58:03 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 3E6833886C51; Tue, 11 May 2021 08:58:01 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from esa2.mentor.iphmx.com (esa2.mentor.iphmx.com [68.232.141.98]) by sourceware.org (Postfix) with ESMTPS id 025C03865479; Tue, 11 May 2021 08:57:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 025C03865479 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=Julian_Brown@mentor.com IronPort-SDR: UBuxZsLjwx4BGCvnx3r7Q86YXSkIw8/5AqpFEwjMGY1VFLIMu08HFHCiAYlo1KjuyfULdbI9SW 7Tu9AngzHP/EwzYWq49UVj1AAjQO8PrLqusg1K5eWQHVeXSBPDoYLvsauy+5xwaDjoImWyJsHQ bnmUiYQmDtkXskBwngysUubT6BXApkbb8PjNangmqU3RTIDRMGbLLYVhhRx5OWj42WqeqNokX+ O/xUDSfoZtJhl3CDrMaW/Ha+2Va0FYcpWvzBGgmAzvULTDl0uOAEaW+2PLyGtnH/2id8Wo0N3H yRk= X-IronPort-AV: E=Sophos;i="5.82,290,1613462400"; d="scan'208";a="61053287" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa2.mentor.iphmx.com with ESMTP; 11 May 2021 00:57:57 -0800 IronPort-SDR: ii62JAPFUKWZUgfZFemsFvkvtFt3Fe9/sVoixnlBPl5aBhahjGMTqwV4qFIVjq0sYDgr+lS0XO 46nYYuc9J5mbLbpXOQLGt93iQ/xGrGLkjRm1SNVy4RoAc6CetT24Z+XAgpJuAYqX0z/zccM44O DJ3PvxAyQ5RlywbAX98lkWVX2S9WF4TYs2xs4mi48QOeD62lIXwn9vzq+HdWBPR+/2dufLWnMv Qq5/PbE3lMkwqVo6NTeTx/N9RutNJDJFVF38Mkh9HpsD8lqy4VKgL0eP+eFayH3a90lTRIvH3Q 0ds= From: Julian Brown To: Subject: [PATCH 5/7] [og10] Rewrite GOMP_MAP_ATTACH_DETACH mappings for OpenMP also Date: Tue, 11 May 2021 01:57:44 -0700 Message-ID: X-Mailer: git-send-email 2.29.2 In-Reply-To: References: MIME-Version: 1.0 X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: SVR-IES-MBX-03.mgc.mentorg.com (139.181.222.3) To SVR-IES-MBX-04.mgc.mentorg.com (139.181.222.4) X-Spam-Status: No, score=-12.0 required=5.0 tests=BAYES_00, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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: Jakub Jelinek , Tobias Burnus , fortran@gcc.gnu.org, Thomas Schwinge Errors-To: gcc-patches-bounces@gcc.gnu.org Sender: "Gcc-patches" It never makes sense for a GOMP_MAP_ATTACH_DETACH mapping to survive beyond gimplify.c, and with OpenMP making use of that mapping type too now alongside OpenACC, there are cases where it was making it through to omp-low.c. This patch rewrites such mappings to GOMP_MAP_ATTACH or GOMP_MAP_DETACH unconditionally for both OpenACC and OpenMP, in cases where it hasn't otherwise been handled already in the preceding code. 2021-05-11 Julian Brown gcc/ * gimplify.c (gimplify_scan_omp_clauses): Remove OpenACC-only condition for changing GOMP_MAP_ATTACH_DETACH to GOMP_MAP_ATTACH or GOMP_MAP_DETACH. Use detach for OMP_TARGET_EXIT_DATA also. --- gcc/gimplify.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/gcc/gimplify.c b/gcc/gimplify.c index c2072c7188f..86000f8470b 100644 --- a/gcc/gimplify.c +++ b/gcc/gimplify.c @@ -9695,16 +9695,11 @@ gimplify_scan_omp_clauses (tree *list_p, gimple_seq *pre_p, if (cont) continue; } - else if ((code == OACC_ENTER_DATA - || code == OACC_EXIT_DATA - || code == OACC_DATA - || code == OACC_PARALLEL - || code == OACC_KERNELS - || code == OACC_SERIAL) - && OMP_CLAUSE_MAP_KIND (c) == GOMP_MAP_ATTACH_DETACH) + else if (OMP_CLAUSE_MAP_KIND (c) == GOMP_MAP_ATTACH_DETACH) { - gomp_map_kind k = (code == OACC_EXIT_DATA - ? GOMP_MAP_DETACH : GOMP_MAP_ATTACH); + gomp_map_kind k + = ((code == OACC_EXIT_DATA || code == OMP_TARGET_EXIT_DATA) + ? GOMP_MAP_DETACH : GOMP_MAP_ATTACH); OMP_CLAUSE_SET_MAP_KIND (c, k); }