From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 Content-Transfer-Encoding: 8bit Content-Type: text/plain 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 List-Id: 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 -- 2.31.1