From patchwork Fri Aug 18 22:47:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julian Brown X-Patchwork-Id: 1823192 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=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.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 ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4RSH8x5B3pz1yfT for ; Sat, 19 Aug 2023 08:48:32 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id AF9343831E01 for ; Fri, 18 Aug 2023 22:48:29 +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 43ACA38654AD; Fri, 18 Aug 2023 22:48:16 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 43ACA38654AD 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,184,1684828800"; d="scan'208";a="14830503" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa3.mentor.iphmx.com with ESMTP; 18 Aug 2023 14:48:14 -0800 IronPort-SDR: BkKidf3AHJ4JVPMWN5d8/FcP/Cx00cczL5nHY4EbsKERHiq8/cOvaqke4rDxMkYVRpPwz4yvHb tkwhG3Y07b3wHFcthDsWUnnrehtdabhm9xiTqDh6CSFfJ3qZMKFQd+/8vxJYACndmDAalFuAhj 48JQSMTE0qY5v8hM23s8TtHbIrG2r+ozafwcg0WuETMDGEBCD42tHfcRRfaQ78I4hfpOkAJc+A atZj5PJc8zGQ09HVf6yQjGFmiIbpmINWZFc0jK//qZxGD66pnUhUItmbdU3KvR6XcMJPowMnqZ Mw0= From: Julian Brown To: CC: , , Subject: [PATCH v7 0/5] OpenMP/OpenACC: map clause and OMP gimplify rework Date: Fri, 18 Aug 2023 15:47:46 -0700 Message-ID: X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-15.mgc.mentorg.com (139.181.222.15) To svr-ies-mbx-11.mgc.mentorg.com (139.181.222.11) X-Spam-Status: No, score=-5.8 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, KAM_SHORT, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=no 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 series comprises the first few patches in support of several OpenMP 5.0 features: "lvalue" parsing for map/to/from clauses, "declare mapper" support and array shaping/strided "target update" support. These patches provide the critical infrastructure changes needed to implement those features. Though labelled "v7", there are fewer patches here than in the previously-posted "v6" series for mainline: https://gcc.gnu.org/pipermail/gcc-patches/2022-December/609031.html Rather, this is more similar to the series posted for og13: https://gcc.gnu.org/pipermail/gcc-patches/2023-June/622213.html Though rearranged somewhat and without several of the later OpenACC-specific patches. Further comments on individual patches. Tested with offloading to NVPTX and bootstrapped. OK for mainline? Julian Brown (5): OpenMP/OpenACC: Reindent TO/FROM/_CACHE_ stanza in {c_}finish_omp_clause OpenMP/OpenACC: Rework clause expansion and nested struct handling OpenMP: Pointers and member mappings OpenMP/OpenACC: Unordered/non-constant component offset runtime diagnostic OpenMP/OpenACC: Reorganise OMP map clause handling in gimplify.cc gcc/c-family/c-common.h | 74 +- gcc/c-family/c-omp.cc | 834 ++++- gcc/c/c-parser.cc | 17 +- gcc/c/c-typeck.cc | 745 ++-- gcc/cp/parser.cc | 17 +- gcc/cp/pt.cc | 4 +- gcc/cp/semantics.cc | 1035 +++--- gcc/fortran/dependency.cc | 128 + gcc/fortran/dependency.h | 1 + gcc/fortran/gfortran.h | 1 + gcc/fortran/trans-openmp.cc | 306 +- gcc/gimplify.cc | 1936 +++++++--- gcc/omp-general.cc | 425 +++ gcc/omp-general.h | 69 + gcc/omp-low.cc | 8 +- gcc/testsuite/c-c++-common/gomp/clauses-2.c | 2 +- gcc/testsuite/c-c++-common/gomp/target-50.c | 2 +- .../c-c++-common/gomp/target-enter-data-1.c | 3 +- .../c-c++-common/gomp/target-implicit-map-2.c | 3 +- .../g++.dg/gomp/static-component-1.C | 23 + gcc/testsuite/gcc.dg/gomp/target-3.c | 2 +- gcc/testsuite/gfortran.dg/gomp/map-12.f90 | 2 +- gcc/testsuite/gfortran.dg/gomp/map-9.f90 | 2 +- .../gfortran.dg/gomp/map-subarray-2.f90 | 57 + .../gfortran.dg/gomp/map-subarray.f90 | 40 + gcc/tree-pretty-print.cc | 3 + gcc/tree.h | 8 + include/gomp-constants.h | 6 + libgomp/oacc-mem.c | 6 +- libgomp/target.c | 98 +- libgomp/testsuite/libgomp.c++/baseptrs-3.C | 275 ++ libgomp/testsuite/libgomp.c++/baseptrs-4.C | 3154 +++++++++++++++++ libgomp/testsuite/libgomp.c++/baseptrs-5.C | 62 + libgomp/testsuite/libgomp.c++/class-array-1.C | 59 + libgomp/testsuite/libgomp.c++/target-48.C | 32 + libgomp/testsuite/libgomp.c++/target-49.C | 37 + .../libgomp.c++/target-exit-data-reftoptr-1.C | 34 + .../testsuite/libgomp.c++/target-lambda-1.C | 5 +- libgomp/testsuite/libgomp.c++/target-this-3.C | 11 +- libgomp/testsuite/libgomp.c++/target-this-4.C | 11 +- .../libgomp.c-c++-common/baseptrs-1.c | 50 + .../libgomp.c-c++-common/baseptrs-2.c | 70 + .../map-arrayofstruct-1.c | 38 + .../map-arrayofstruct-2.c | 58 + .../map-arrayofstruct-3.c | 68 + .../libgomp.c-c++-common/ptr-attach-2.c | 60 + .../target-implicit-map-2.c | 2 + .../target-implicit-map-5.c | 50 + .../libgomp.c-c++-common/target-map-zlas-1.c | 36 + .../libgomp.fortran/map-subarray-2.f90 | 108 + .../libgomp.fortran/map-subarray-3.f90 | 62 + .../libgomp.fortran/map-subarray-4.f90 | 35 + .../libgomp.fortran/map-subarray-5.f90 | 54 + .../libgomp.fortran/map-subarray-6.f90 | 26 + .../libgomp.fortran/map-subarray-7.f90 | 29 + .../libgomp.fortran/map-subarray-8.f90 | 47 + .../libgomp.fortran/map-subarray.f90 | 33 + .../libgomp.fortran/map-subcomponents.f90 | 32 + .../libgomp.fortran/struct-elem-map-1.f90 | 180 + 59 files changed, 9039 insertions(+), 1536 deletions(-) create mode 100644 gcc/testsuite/g++.dg/gomp/static-component-1.C create mode 100644 gcc/testsuite/gfortran.dg/gomp/map-subarray-2.f90 create mode 100644 gcc/testsuite/gfortran.dg/gomp/map-subarray.f90 create mode 100644 libgomp/testsuite/libgomp.c++/baseptrs-3.C create mode 100644 libgomp/testsuite/libgomp.c++/baseptrs-4.C create mode 100644 libgomp/testsuite/libgomp.c++/baseptrs-5.C create mode 100644 libgomp/testsuite/libgomp.c++/class-array-1.C create mode 100644 libgomp/testsuite/libgomp.c++/target-48.C create mode 100644 libgomp/testsuite/libgomp.c++/target-49.C create mode 100644 libgomp/testsuite/libgomp.c++/target-exit-data-reftoptr-1.C create mode 100644 libgomp/testsuite/libgomp.c-c++-common/baseptrs-1.c create mode 100644 libgomp/testsuite/libgomp.c-c++-common/baseptrs-2.c create mode 100644 libgomp/testsuite/libgomp.c-c++-common/map-arrayofstruct-1.c create mode 100644 libgomp/testsuite/libgomp.c-c++-common/map-arrayofstruct-2.c create mode 100644 libgomp/testsuite/libgomp.c-c++-common/map-arrayofstruct-3.c create mode 100644 libgomp/testsuite/libgomp.c-c++-common/ptr-attach-2.c create mode 100644 libgomp/testsuite/libgomp.c-c++-common/target-implicit-map-5.c create mode 100644 libgomp/testsuite/libgomp.c-c++-common/target-map-zlas-1.c create mode 100644 libgomp/testsuite/libgomp.fortran/map-subarray-2.f90 create mode 100644 libgomp/testsuite/libgomp.fortran/map-subarray-3.f90 create mode 100644 libgomp/testsuite/libgomp.fortran/map-subarray-4.f90 create mode 100644 libgomp/testsuite/libgomp.fortran/map-subarray-5.f90 create mode 100644 libgomp/testsuite/libgomp.fortran/map-subarray-6.f90 create mode 100644 libgomp/testsuite/libgomp.fortran/map-subarray-7.f90 create mode 100644 libgomp/testsuite/libgomp.fortran/map-subarray-8.f90 create mode 100644 libgomp/testsuite/libgomp.fortran/map-subarray.f90 create mode 100644 libgomp/testsuite/libgomp.fortran/map-subcomponents.f90