From patchwork Wed Jun 14 22:07:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sandra Loosemore X-Patchwork-Id: 108155 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp254565vqr; Wed, 14 Jun 2023 15:09:41 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5FtQ8WDNrY5VWXbVlp9SELLzRz2N5HubYOj57/TWgYLkQCg5KFA+8Hu/dtXRs/p/3Gnsr9 X-Received: by 2002:a17:907:9410:b0:982:30e3:ddcb with SMTP id dk16-20020a170907941000b0098230e3ddcbmr8833870ejc.65.1686780581301; Wed, 14 Jun 2023 15:09:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686780581; cv=none; d=google.com; s=arc-20160816; b=PM7qHMNJjgylioLne+gU3xV/QAW+itTBngPivH70rEwaz5312TPM/CI6mJB8boZghE AQDOQLphbq/epJD9Gomg5B+JpZsZnYYUugFAnRcgZEt/KftYboDdtL9dFiHs68dymGpS 5v+Wsc3LPwyzblwwT1dqIEMEvi+MuNEyOycrb1M4nX4GAk9yVLZRAAurQqmiBX6reGpv aLTWqVjOXeTOJdqhbQ4a3IF5js+smBO3Twj5dgPLkJFNb9sSBlynZ1aCbL+s62y0CRQE 8GTGrzCRtrjTTQlyxaNZq8xAhVX/dGhpnGkPdbvisoAs1qDryqlpYyH9/W/boka7zC/X RbYg== 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:references:in-reply-to:message-id:date:subject:to:from :ironport-sdr:dmarc-filter:delivered-to; bh=ColeeQVfWGpowoQephSFYLLmzVcq1PzrooLCJB3LFSg=; b=ySRiwHAZ0kVTkLgS/ZZOSodS/UI+AaI9ojnaYf+XkhjcKNqPzpx1nMzC5gbhcEcNLc hg2cz2uOPx07VzlQjPc9GmRuIcvsZtbxhH7JpDNYAcR5hLXTJ7is3wQOx+6V4KX1swKW DhiJLdyWGqRQf2sgsY0ffDZByb3BE3bhJUOfa/dUhJjrHGlbCYbrIVL3y8LfJyj7wC+O iUkI8C3M1Gn1vonmFa3LilBidqfxyoM+hESd09YzrgA9MCL/wvgNpdIwFs7ZhFqKPVkD 6X5mVGOaI+nePbEDHZQw7/WlhKiUwJveGlSOLVcB9nZJcHbPS/0HTFfye213IwMCACSU lj7w== 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 sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id i17-20020a170906115100b00965604f0e3asi9203261eja.808.2023.06.14.15.09.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Jun 2023 15:09:41 -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 A916F3857711 for ; Wed, 14 Jun 2023 22:08:50 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from esa1.mentor.iphmx.com (esa1.mentor.iphmx.com [68.232.129.153]) by sourceware.org (Postfix) with ESMTPS id 8F8C13858C1F for ; Wed, 14 Jun 2023 22:08:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8F8C13858C1F 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.00,243,1681200000"; d="scan'208";a="9902135" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa1.mentor.iphmx.com with ESMTP; 14 Jun 2023 14:08:23 -0800 IronPort-SDR: 7S5HubCjfpEA/3V7tMI19vubi+IToDa1tPvBDSMiqwUindELYZ5VmDlkbvuhMbwA9OZt7ytCoO tr217TJImqk0NYqj8p9mTz3inqhQ1H/USVOaJoZ9gcodLXq8ka2NVrzHVrGWsBPdmmmd1z4huM wB75j2kDKVgymgA7l8X7ceIsh1Em5WERtRJBpFqwbDDv6OjX9dBuZmCRkh/prWlnHU1S6m+Idb N5l2wVP0eGte+1yWrpkJiexp+CsyMCQPVTKNUoNj2TZ0mU/QMCPZfWIqMkkFpRA/8FszvoTP4d nWY= From: Sandra Loosemore To: Subject: [OG13 1/6] OpenMP: Handle loop transformation clauses in nested functions Date: Wed, 14 Jun 2023 16:07:59 -0600 Message-ID: <20230614220804.917436-2-sandra@codesourcery.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230614220804.917436-1-sandra@codesourcery.com> References: <20230614220804.917436-1-sandra@codesourcery.com> MIME-Version: 1.0 X-ClientProxiedBy: svr-orw-mbx-15.mgc.mentorg.com (147.34.90.215) To svr-orw-mbx-13.mgc.mentorg.com (147.34.90.213) X-Spam-Status: No, score=-9.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE 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+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768717634366919461?= X-GMAIL-MSGID: =?utf-8?q?1768717634366919461?= The new internal clauses introduced for loop transformations were missing from the big switch statements over all clauses in these functions. gcc/ChangeLog: * tree-nested.cc (convert_nonlocal_omp_clauses): Handle loop transformation clauses. (convert_local_omp_clauses): Likewise. libgomp/ChangeLog: * testsuite/libgomp.fortran/loop-transforms/nested-fn.f90: New test. Co-Authored-By: Frederik Harwath --- gcc/ChangeLog.omp | 7 +++++++ gcc/tree-nested.cc | 14 ++++++++++++++ libgomp/ChangeLog.omp | 5 +++++ .../loop-transforms/nested-fn.f90 | 19 +++++++++++++++++++ 4 files changed, 45 insertions(+) create mode 100644 libgomp/testsuite/libgomp.fortran/loop-transforms/nested-fn.f90 diff --git a/gcc/ChangeLog.omp b/gcc/ChangeLog.omp index b4ebf6c0dea..d77d01076c2 100644 --- a/gcc/ChangeLog.omp +++ b/gcc/ChangeLog.omp @@ -1,3 +1,10 @@ +2023-06-13 Sandra Loosemore + Frederik Harwath + + * tree-nested.cc (convert_nonlocal_omp_clauses): Handle loop + transformation clauses. + (convert_local_omp_clauses): Likewise. + 2023-06-12 Tobias Burnus Backported from mainline: diff --git a/gcc/tree-nested.cc b/gcc/tree-nested.cc index 04651d86608..51c69dd3c10 100644 --- a/gcc/tree-nested.cc +++ b/gcc/tree-nested.cc @@ -1494,6 +1494,13 @@ convert_nonlocal_omp_clauses (tree *pclauses, struct walk_stmt_info *wi) case OMP_CLAUSE__OMPACC_: break; + /* Clauses related to loop transforms. */ + case OMP_CLAUSE_TILE: + case OMP_CLAUSE_UNROLL_FULL: + case OMP_CLAUSE_UNROLL_PARTIAL: + case OMP_CLAUSE_UNROLL_NONE: + break; + /* The following clause belongs to the OpenACC cache directive, which is discarded during gimplification. */ case OMP_CLAUSE__CACHE_: @@ -2291,6 +2298,13 @@ convert_local_omp_clauses (tree *pclauses, struct walk_stmt_info *wi) case OMP_CLAUSE__OMPACC_: break; + /* Clauses related to loop transforms. */ + case OMP_CLAUSE_TILE: + case OMP_CLAUSE_UNROLL_FULL: + case OMP_CLAUSE_UNROLL_PARTIAL: + case OMP_CLAUSE_UNROLL_NONE: + break; + /* The following clause belongs to the OpenACC cache directive, which is discarded during gimplification. */ case OMP_CLAUSE__CACHE_: diff --git a/libgomp/ChangeLog.omp b/libgomp/ChangeLog.omp index 60dc6c1f7c2..5ce5052a8dc 100644 --- a/libgomp/ChangeLog.omp +++ b/libgomp/ChangeLog.omp @@ -1,3 +1,8 @@ +2023-06-13 Sandra Loosemore + Frederik Harwath + + * testsuite/libgomp.fortran/loop-transforms/nested-fn.f90: New test. + 2023-06-14 Tobias Burnus Backported from mainline: diff --git a/libgomp/testsuite/libgomp.fortran/loop-transforms/nested-fn.f90 b/libgomp/testsuite/libgomp.fortran/loop-transforms/nested-fn.f90 new file mode 100644 index 00000000000..dc70c9228fd --- /dev/null +++ b/libgomp/testsuite/libgomp.fortran/loop-transforms/nested-fn.f90 @@ -0,0 +1,19 @@ +! { dg-do run } + +program foo + integer :: count +contains + +subroutine s1 () + integer :: i, count + + count = 0 + + !$omp target parallel do + !$omp unroll partial + do i = 1, 100 + end do + +end subroutine + +end program