From patchwork Wed Sep 6 09:34:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julian Brown X-Patchwork-Id: 13790 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ab0a:0:b0:3f2:4152:657d with SMTP id m10csp2195549vqo; Wed, 6 Sep 2023 02:36:57 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFKkHYv84JR0fxs4UoNIq+AlTj0wfhiEEiO1DmTz87bq9RDPLOUIBL1lR/RbptTwrYwHtMc X-Received: by 2002:ac2:5b9a:0:b0:4fc:3755:37d9 with SMTP id o26-20020ac25b9a000000b004fc375537d9mr1772038lfn.68.1693993016992; Wed, 06 Sep 2023 02:36:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693993016; cv=none; d=google.com; s=arc-20160816; b=Wct8AxVoAO0b77zUfj+kaZxAc4qQdZk9h9stIK3dYXfSFa+sk5Twka0Xb9+X/RXBXD WKjH170nez8Hfi7jgp5ID2IVzfAXmKwUhJ7AZu4Y79FlTEtDDG3lGSVQiuD8VhSn0k06 Lel0BocF8k6ueLhEIUBBz/Xfg8acoL4zXkwvyy6TC05780U02TjeWYt2F+RN9jnoiZ9M 9sJJEdd0enuqNrcoXYFH8qoUr9xa9/uZqU5ycDQ3Pqvbi/zyZ0Z+ToZGRgrdIoke5OVX mheysg8/XQ87zKjWlbEU0uk4C73nxPRK5CPsIokbXG8LWb4i9t8bm6pFvyNjDHA4G+RG /2PA== 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=oQCmHgarxGherdUSD0ShrtBX9bKnLwc5gfU+GebmZ9E=; fh=Zi4YE2qwf2z4EFGB81VSO9teNCSTLeJ7G0e+6tnjm6E=; b=fun9AoyorLEYl1XIgJnRZCbbgrX9zW6bHLXHgqy8PNsu94Zczg1cVdsntvh1XxbNeG GGfDP5UfVzVkQjoG9T6rX8EFwhN8hHLpejGBp/7kZ5SqYBVCpm+iD5tDcbOQA1A9zrfo EMhqbTX42cAJMWB24CjDaOVtmkQ/LL/rZ3LxfS+OTP9NqpGnGjtYu4qAYXbaNPh6uhhG QlPT4UtTRAqVG4mxQwIGLYxzIsvbrleyz/OWdu63rITx1WGThpuFudrOauqd+DwkiRdm 16dqzU8RwE5dUI4MzXfCLf6jX4o7m0Ln90dgeE61DH0bmBxQm6h0o2rJOC1ixKBaWMtr dFtA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id q11-20020a056402032b00b0052a11d5adafsi9459064edw.437.2023.09.06.02.36.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Sep 2023 02:36:56 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c 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 545A1388265D for ; Wed, 6 Sep 2023 09:35:31 +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 5DB453858D35; Wed, 6 Sep 2023 09:35:00 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5DB453858D35 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.02,231,1688457600"; d="scan'208";a="16228960" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa3.mentor.iphmx.com with ESMTP; 06 Sep 2023 01:34:59 -0800 IronPort-SDR: XaYIcrVyWvEOs9OlkvMTdz34yfnDLpari78SIEsV0krx9pVFKbMGqnQhqMi78sJb07PVoe+ufT SbFT163WOwG2wYfMKLtwftfkSxhFGzR19g3seGtYnr17gkooMntrxhnonAF03oQXrGbr61w9Z1 WyoomRrcwaksjSANpl2uWrgD8IYWmSSdNLkVeEPhKhYmMyoQY3l5HoIT1Lbgzq7daVDdslpG1x mUBUZBCGCAbB+bcELVZuAwpWBCXkfgicZ61vNwewMozd7g8rhuybChbtkFqKsCFsqrgB+E8lT4 Tg0= From: Julian Brown To: CC: , , Subject: [PATCH 0/5] OpenMP: Array-shaping operator and strided/rectangular 'target update' support Date: Wed, 6 Sep 2023 02:34:29 -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.30 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: INBOX X-GMAIL-THRID: 1776280422066599379 X-GMAIL-MSGID: 1776280422066599379 This patch series provides support for the OpenMP 5.0+ array-shaping operator and for strided/rectangular updates for 'target update' directives. Each of C, C++ and Fortran is supported (using existing base language syntax for the last). This series applies on top of the "infrastructure" support series: https://gcc.gnu.org/pipermail/gcc-patches/2023-August/627895.html and the lvalue parsing/declare mapper series: https://gcc.gnu.org/pipermail/gcc-patches/2023-September/629363.html The og13 version of this series was posted here: https://gcc.gnu.org/pipermail/gcc-patches/2023-July/623502.html This version of the series contains several follow-up fixes relative to the og13 version, and omits some parts that are only present on the branch for now. Further comments on individual patches. Tested with offloading to NVPTX and bootstrapped. OK? Julian Brown (5): OpenMP, NVPTX: memcpy[23]D bias correction OpenMP: Allow complete replacement of clause during map/to/from expansion OpenMP: Support strided and shaped-array updates for C++ OpenMP: Array shaping operator and strided "target update" for C OpenMP: Noncontiguous "target update" for Fortran 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 | 330 +++++++++++- gcc/c/c-tree.h | 6 +- gcc/c/c-typeck.cc | 281 ++++++++-- 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/openmp.cc | 5 +- gcc/fortran/trans-openmp.cc | 499 ++++++++++++++++++ gcc/gimplify.cc | 54 +- gcc/omp-general.cc | 47 ++ gcc/omp-general.h | 4 +- gcc/omp-low.cc | 476 ++++++++++++++++- 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/plugin/plugin-nvptx.c | 67 +++ libgomp/target.c | 271 +++++++--- .../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.c-c++-common/array-shaping-14.c | 34 ++ 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 ++ 85 files changed, 5933 insertions(+), 315 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-c++-common/array-shaping-14.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