From patchwork Mon Jul 3 21:33:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julian Brown X-Patchwork-Id: 11569 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp803276vqx; Mon, 3 Jul 2023 14:36:35 -0700 (PDT) X-Google-Smtp-Source: APBJJlHkrMIAUgrN/kZrWCBMinFejntknMzMMk0nT5qNFcJyxx3uQX8Wubg3/Nl9Crg3TIDv8UMH X-Received: by 2002:a17:906:d110:b0:993:4fd9:dece with SMTP id b16-20020a170906d11000b009934fd9decemr4393721ejz.12.1688420195448; Mon, 03 Jul 2023 14:36:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688420195; cv=none; d=google.com; s=arc-20160816; b=MQlgmHJYrMtdxTxvASeh8v0Fh9hXUqYU07v5b8S8qo5l1A+uypY1Akq6MX7ffK8Lie Yo1g4jImE8tVmGYqmgf9PLf0SMqAXwsM0JFGvAwt558RTleBQMmppK0TLh0K3lqCxzJl 0j9IvqpXmT6XIqBW2hLKNk0YJyENnLDVRhL4GjpOexw4BJxcQJntvv8ku5iG9K3l8Nni xbcYpKE/Cq4p6QJq/AlYajWea29723r+0vKAV1RkIlgPjuWbv9Odjsn72mfCOEDyTC5L a4fwARD4VD82fOLg3H0nLlgTDTloowqp/vx35roRQDxyAJJN2NQFQZzzoXJmWh2uPj63 3r3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:ironport-sdr :dmarc-filter:delivered-to; bh=L9vCcLeaB4jHgdfFp20+W1fk5UW0qd0XFwq/Zqs5H+E=; fh=hjv/BLZXfesavC81yKN9rZNUPmZjTWdzJkx8i001DNY=; b=x2X02NrJ5LskUrbA2g8VppBCrI6sEy0L/jaIYlW3GNXWL4LiHHwVi6Y8XSdbJdFDct ZbPpJ7GYb8zPYbMoiBNBMAhUuNBkjsyiR4mu6EipRSGKkvWn1Ewswu9NvPjQCTNMgnpo U80uI/40Zn1HAiMjCI4WzVzy9cAfc8JzEt1P1sLnm1d6djKO8hkNsJ5jrMHNOWd9G9Bm 4CIka9e/IKX3c/1H/Z75c2bnBSUpkJTtj6/AedTweBz6K4ARQlKTmihWjfCGZI5eV2hw VrKADKHQiIRTPfT2apxWdM0QMzJp7xnM0z5kds2T3kIepfHjMBzPueOGsG2c4P6WzKUy e70A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id qk8-20020a170906d9c800b00992acf1f370si5782099ejb.939.2023.07.03.14.36.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Jul 2023 14:36:35 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 8F8E43870F2D for ; Mon, 3 Jul 2023 21:34:45 +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 ADF9F3858C5E; Mon, 3 Jul 2023 21:33:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org ADF9F3858C5E 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,178,1684828800"; d="scan'208";a="12099548" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa2.mentor.iphmx.com with ESMTP; 03 Jul 2023 13:33:43 -0800 IronPort-SDR: gZRcgQZYcdd9WyGBgh9QIlJUTtpOYDO9mjeS/i7GdM1jKnczjAUPZhdDNzc9vaHp5ucV4j57Z4 73yW8ab9MlfIzCXMPisacAOeiGunJMnsRZpydM8e0rNvZhBu/l4a+nmTjAK6PWbQJOYWeANNop w3MeJE6rVzxKHOSxJgl2GjZOpMwxioH3kYVPmcHx7P8gLMoPdkDMUbQId0QxnyHZlcTwVkVmQv 7S8ofSaYlBocPI1lVpS8572lQo9Z+Acc7BZ21ucayshEHld3Uk0h40OCwtpWXaS6J1zMAePJ6q aQY= From: Julian Brown To: CC: , , Subject: [PATCH 0/5] [og13] OpenMP: strides, rectangular updates and array-shaping operator for "target update" Date: Mon, 3 Jul 2023 21:33:14 +0000 Message-ID: X-Mailer: git-send-email 2.25.1 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, T_SCC_BODY_TEXT_LINE 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+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770436895066419858?= X-GMAIL-MSGID: =?utf-8?q?1770436895066419858?= This patch series adds support for the array-shaping operator from OpenMP 5.0, and strided and rectangular transfers for "target update" directives. The patches were previously posted for mainline here: https://gcc.gnu.org/pipermail/gcc-patches/2023-March/613785.html (C++) https://gcc.gnu.org/pipermail/gcc-patches/2023-April/616921.html (Fortran) https://gcc.gnu.org/pipermail/gcc-patches/2023-May/618738.html (C) This time the patches have been merged to the og13 branch (mostly straightforward, though note the conflict described in patch 3/5). Re-tested with offloading to AMD GCN. I will apply shortly. Julian Brown (5): OpenMP: Fix "exit data" for array sections for ref-to-ptr components OpenMP: Allow complete replacement of clause during map/to/from expansion OpenMP: Support strided and shaped-array updates for C++ OpenMP: Noncontiguous "target update" for Fortran OpenMP: Array shaping operator and strided "target update" for C gcc/c-family/c-common.h | 12 +- gcc/c-family/c-omp.cc | 277 ++++++++-- gcc/c-family/c-pretty-print.cc | 5 + gcc/c/c-parser.cc | 331 +++++++++++- gcc/c/c-tree.h | 6 +- gcc/c/c-typeck.cc | 287 ++++++++-- gcc/cp/cp-objcp-common.cc | 1 + gcc/cp/cp-tree.def | 1 + gcc/cp/cp-tree.h | 13 +- gcc/cp/decl.cc | 75 +++ gcc/cp/decl2.cc | 19 +- gcc/cp/error.cc | 5 + gcc/cp/mangle.cc | 1 + gcc/cp/operators.def | 1 + gcc/cp/parser.cc | 303 ++++++++++- gcc/cp/parser.h | 7 + gcc/cp/pt.cc | 39 +- gcc/cp/semantics.cc | 289 ++++++++-- gcc/cp/typeck.cc | 12 +- gcc/fortran/trans-openmp.cc | 500 ++++++++++++++++++ gcc/gimplify.cc | 84 ++- gcc/omp-general.cc | 47 ++ gcc/omp-general.h | 4 +- gcc/omp-low.cc | 459 +++++++++++++++- gcc/testsuite/g++.dg/gomp/array-shaping-1.C | 22 + gcc/testsuite/g++.dg/gomp/array-shaping-2.C | 134 +++++ .../g++.dg/gomp/bad-array-shaping-1.C | 47 ++ .../g++.dg/gomp/bad-array-shaping-2.C | 52 ++ .../g++.dg/gomp/bad-array-shaping-3.C | 53 ++ .../g++.dg/gomp/bad-array-shaping-4.C | 60 +++ .../g++.dg/gomp/bad-array-shaping-5.C | 55 ++ .../g++.dg/gomp/bad-array-shaping-6.C | 59 +++ .../g++.dg/gomp/bad-array-shaping-7.C | 48 ++ .../g++.dg/gomp/bad-array-shaping-8.C | 50 ++ .../gcc.dg/gomp/bad-array-shaping-c-1.c | 26 + .../gcc.dg/gomp/bad-array-shaping-c-2.c | 24 + .../gcc.dg/gomp/bad-array-shaping-c-3.c | 30 ++ .../gcc.dg/gomp/bad-array-shaping-c-4.c | 27 + .../gcc.dg/gomp/bad-array-shaping-c-5.c | 17 + .../gcc.dg/gomp/bad-array-shaping-c-6.c | 26 + .../gcc.dg/gomp/bad-array-shaping-c-7.c | 15 + .../gfortran.dg/gomp/noncontig-updates-1.f90 | 19 + .../gfortran.dg/gomp/noncontig-updates-2.f90 | 16 + .../gfortran.dg/gomp/noncontig-updates-3.f90 | 16 + .../gfortran.dg/gomp/noncontig-updates-4.f90 | 15 + gcc/tree-pretty-print.cc | 17 + gcc/tree.def | 2 +- include/gomp-constants.h | 7 +- libgomp/libgomp.h | 15 + libgomp/target.c | 261 ++++++--- .../testsuite/libgomp.c++/array-shaping-1.C | 469 ++++++++++++++++ .../testsuite/libgomp.c++/array-shaping-10.C | 61 +++ .../testsuite/libgomp.c++/array-shaping-11.C | 63 +++ .../testsuite/libgomp.c++/array-shaping-12.C | 65 +++ .../testsuite/libgomp.c++/array-shaping-13.C | 89 ++++ .../testsuite/libgomp.c++/array-shaping-2.C | 38 ++ .../testsuite/libgomp.c++/array-shaping-3.C | 38 ++ .../testsuite/libgomp.c++/array-shaping-4.C | 38 ++ .../testsuite/libgomp.c++/array-shaping-5.C | 38 ++ .../testsuite/libgomp.c++/array-shaping-6.C | 54 ++ .../testsuite/libgomp.c++/array-shaping-7.C | 54 ++ .../testsuite/libgomp.c++/array-shaping-8.C | 65 +++ .../testsuite/libgomp.c++/array-shaping-9.C | 95 ++++ libgomp/testsuite/libgomp.c/array-shaping-1.c | 236 +++++++++ libgomp/testsuite/libgomp.c/array-shaping-2.c | 39 ++ libgomp/testsuite/libgomp.c/array-shaping-3.c | 42 ++ libgomp/testsuite/libgomp.c/array-shaping-4.c | 36 ++ libgomp/testsuite/libgomp.c/array-shaping-5.c | 38 ++ libgomp/testsuite/libgomp.c/array-shaping-6.c | 45 ++ .../libgomp.fortran/noncontig-updates-1.f90 | 54 ++ .../libgomp.fortran/noncontig-updates-10.f90 | 29 + .../libgomp.fortran/noncontig-updates-11.f90 | 51 ++ .../libgomp.fortran/noncontig-updates-12.f90 | 59 +++ .../libgomp.fortran/noncontig-updates-13.f90 | 42 ++ .../libgomp.fortran/noncontig-updates-2.f90 | 101 ++++ .../libgomp.fortran/noncontig-updates-3.f90 | 47 ++ .../libgomp.fortran/noncontig-updates-4.f90 | 78 +++ .../libgomp.fortran/noncontig-updates-5.f90 | 55 ++ .../libgomp.fortran/noncontig-updates-6.f90 | 34 ++ .../libgomp.fortran/noncontig-updates-7.f90 | 36 ++ .../libgomp.fortran/noncontig-updates-8.f90 | 39 ++ .../libgomp.fortran/noncontig-updates-9.f90 | 34 ++ 82 files changed, 5829 insertions(+), 324 deletions(-) create mode 100644 gcc/testsuite/g++.dg/gomp/array-shaping-1.C create mode 100644 gcc/testsuite/g++.dg/gomp/array-shaping-2.C create mode 100644 gcc/testsuite/g++.dg/gomp/bad-array-shaping-1.C create mode 100644 gcc/testsuite/g++.dg/gomp/bad-array-shaping-2.C create mode 100644 gcc/testsuite/g++.dg/gomp/bad-array-shaping-3.C create mode 100644 gcc/testsuite/g++.dg/gomp/bad-array-shaping-4.C create mode 100644 gcc/testsuite/g++.dg/gomp/bad-array-shaping-5.C create mode 100644 gcc/testsuite/g++.dg/gomp/bad-array-shaping-6.C create mode 100644 gcc/testsuite/g++.dg/gomp/bad-array-shaping-7.C create mode 100644 gcc/testsuite/g++.dg/gomp/bad-array-shaping-8.C create mode 100644 gcc/testsuite/gcc.dg/gomp/bad-array-shaping-c-1.c create mode 100644 gcc/testsuite/gcc.dg/gomp/bad-array-shaping-c-2.c create mode 100644 gcc/testsuite/gcc.dg/gomp/bad-array-shaping-c-3.c create mode 100644 gcc/testsuite/gcc.dg/gomp/bad-array-shaping-c-4.c create mode 100644 gcc/testsuite/gcc.dg/gomp/bad-array-shaping-c-5.c create mode 100644 gcc/testsuite/gcc.dg/gomp/bad-array-shaping-c-6.c create mode 100644 gcc/testsuite/gcc.dg/gomp/bad-array-shaping-c-7.c create mode 100644 gcc/testsuite/gfortran.dg/gomp/noncontig-updates-1.f90 create mode 100644 gcc/testsuite/gfortran.dg/gomp/noncontig-updates-2.f90 create mode 100644 gcc/testsuite/gfortran.dg/gomp/noncontig-updates-3.f90 create mode 100644 gcc/testsuite/gfortran.dg/gomp/noncontig-updates-4.f90 create mode 100644 libgomp/testsuite/libgomp.c++/array-shaping-1.C create mode 100644 libgomp/testsuite/libgomp.c++/array-shaping-10.C create mode 100644 libgomp/testsuite/libgomp.c++/array-shaping-11.C create mode 100644 libgomp/testsuite/libgomp.c++/array-shaping-12.C create mode 100644 libgomp/testsuite/libgomp.c++/array-shaping-13.C create mode 100644 libgomp/testsuite/libgomp.c++/array-shaping-2.C create mode 100644 libgomp/testsuite/libgomp.c++/array-shaping-3.C create mode 100644 libgomp/testsuite/libgomp.c++/array-shaping-4.C create mode 100644 libgomp/testsuite/libgomp.c++/array-shaping-5.C create mode 100644 libgomp/testsuite/libgomp.c++/array-shaping-6.C create mode 100644 libgomp/testsuite/libgomp.c++/array-shaping-7.C create mode 100644 libgomp/testsuite/libgomp.c++/array-shaping-8.C create mode 100644 libgomp/testsuite/libgomp.c++/array-shaping-9.C create mode 100644 libgomp/testsuite/libgomp.c/array-shaping-1.c create mode 100644 libgomp/testsuite/libgomp.c/array-shaping-2.c create mode 100644 libgomp/testsuite/libgomp.c/array-shaping-3.c create mode 100644 libgomp/testsuite/libgomp.c/array-shaping-4.c create mode 100644 libgomp/testsuite/libgomp.c/array-shaping-5.c create mode 100644 libgomp/testsuite/libgomp.c/array-shaping-6.c create mode 100644 libgomp/testsuite/libgomp.fortran/noncontig-updates-1.f90 create mode 100644 libgomp/testsuite/libgomp.fortran/noncontig-updates-10.f90 create mode 100644 libgomp/testsuite/libgomp.fortran/noncontig-updates-11.f90 create mode 100644 libgomp/testsuite/libgomp.fortran/noncontig-updates-12.f90 create mode 100644 libgomp/testsuite/libgomp.fortran/noncontig-updates-13.f90 create mode 100644 libgomp/testsuite/libgomp.fortran/noncontig-updates-2.f90 create mode 100644 libgomp/testsuite/libgomp.fortran/noncontig-updates-3.f90 create mode 100644 libgomp/testsuite/libgomp.fortran/noncontig-updates-4.f90 create mode 100644 libgomp/testsuite/libgomp.fortran/noncontig-updates-5.f90 create mode 100644 libgomp/testsuite/libgomp.fortran/noncontig-updates-6.f90 create mode 100644 libgomp/testsuite/libgomp.fortran/noncontig-updates-7.f90 create mode 100644 libgomp/testsuite/libgomp.fortran/noncontig-updates-8.f90 create mode 100644 libgomp/testsuite/libgomp.fortran/noncontig-updates-9.f90