From patchwork Thu Aug 10 13:33:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julian Brown X-Patchwork-Id: 1819854 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Received: from server2.sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4RM7DX4YCtz1yYC for ; Thu, 10 Aug 2023 23:33:48 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id E6E293865C12 for ; Thu, 10 Aug 2023 13:33:43 +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 A821D385703C; Thu, 10 Aug 2023 13:33:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A821D385703C Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mentor.com X-IronPort-AV: E=Sophos;i="6.01,162,1684828800"; d="scan'208";a="14111557" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa3.mentor.iphmx.com with ESMTP; 10 Aug 2023 05:33:30 -0800 IronPort-SDR: 1U/FUC4xHVMCOvFC0BKc3jKRXXJHp2ECtwn+fJ1ApijNXoLlkV5dWXFZd++pGi/Fmy/U32i0MU O+4CkogiTH/clqGyH7n7yvts5W8Q1TrbStlx4T/oB7vhCwRNyPewpWRKudKlvhjoCVrnAEFEUq MtAGrKkeFUVKYfKjpzkEBsU7jLmlgI8NI2kG7CN4C7/T+JlU9OmfXmQTNT2s8DhOdWwr3uI41l SPOaeDtgYpJ2lL0NvdkQX4WPyIIx9AFnivC/p6mFvru8xCBYgcu/35u7jJISCKyjaJ72SA7jR4 +FE= From: Julian Brown To: CC: , , Subject: [PATCH 3/5] OpenMP: Introduce C_ORT_{, OMP_}DECLARE_MAPPER c_omp_region_type types Date: Thu, 10 Aug 2023 13:33:04 +0000 Message-ID: <7f150aec826622376459cdecd2c870bc2e80d07b.1691672603.git.julian@codesourcery.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-14.mgc.mentorg.com (139.181.222.14) To svr-ies-mbx-11.mgc.mentorg.com (139.181.222.11) X-Spam-Status: No, score=-11.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.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) 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: , Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" This patch adds C_ORT_DECLARE_MAPPER and C_ORT_OMP_DECLARE_MAPPER region types to the c_omp_region_type enum, and uses them in cp/pt.cc. Previously the C_ORT_DECLARE_SIMD code was being abused to inhibit calling finish_omp_clauses within mapper definitions, but this patch uses one of the new enumeration values for that purpose instead. This shouldn't result in any behaviour change, but improves self-documentation. 2023-08-10 Julian Brown gcc/c-family/ * c-common.h (c_omp_region_type): Add C_ORT_DECLARE_MAPPER and C_ORT_OMP_DECLARE_MAPPER codes. gcc/cp/ * pt.cc (tsubst_omp_clauses): Use C_ORT_OMP_DECLARE_MAPPER. (tsubst_expr): Likewise. --- gcc/c-family/c-common.h | 2 ++ gcc/cp/pt.cc | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/gcc/c-family/c-common.h b/gcc/c-family/c-common.h index c805c8b2f7e..079d1eaafaa 100644 --- a/gcc/c-family/c-common.h +++ b/gcc/c-family/c-common.h @@ -1271,9 +1271,11 @@ enum c_omp_region_type C_ORT_DECLARE_SIMD = 1 << 2, C_ORT_TARGET = 1 << 3, C_ORT_EXIT_DATA = 1 << 4, + C_ORT_DECLARE_MAPPER = 1 << 6, C_ORT_OMP_DECLARE_SIMD = C_ORT_OMP | C_ORT_DECLARE_SIMD, C_ORT_OMP_TARGET = C_ORT_OMP | C_ORT_TARGET, C_ORT_OMP_EXIT_DATA = C_ORT_OMP | C_ORT_EXIT_DATA, + C_ORT_OMP_DECLARE_MAPPER = C_ORT_OMP | C_ORT_DECLARE_MAPPER, C_ORT_ACC_TARGET = C_ORT_ACC | C_ORT_TARGET }; diff --git a/gcc/cp/pt.cc b/gcc/cp/pt.cc index fb50c5ac48d..2794c0ebecb 100644 --- a/gcc/cp/pt.cc +++ b/gcc/cp/pt.cc @@ -18328,7 +18328,7 @@ tsubst_omp_clauses (tree clauses, enum c_omp_region_type ort, } new_clauses = nreverse (new_clauses); - if (ort != C_ORT_OMP_DECLARE_SIMD) + if (ort != C_ORT_OMP_DECLARE_SIMD && ort != C_ORT_OMP_DECLARE_MAPPER) { if (ort & C_ORT_OMP) new_clauses = c_omp_instantiate_mappers (new_clauses, ort); @@ -19905,7 +19905,7 @@ tsubst_expr (tree t, tree args, tsubst_flags_t complain, tree in_decl) decl = tsubst (decl, args, complain, in_decl); tree type = tsubst (TREE_TYPE (t), args, complain, in_decl); tree clauses = OMP_DECLARE_MAPPER_CLAUSES (t); - clauses = tsubst_omp_clauses (clauses, C_ORT_OMP_DECLARE_SIMD, args, + clauses = tsubst_omp_clauses (clauses, C_ORT_OMP_DECLARE_MAPPER, args, complain, in_decl); TREE_TYPE (t) = type; OMP_DECLARE_MAPPER_DECL (t) = decl;