From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from esa4.mentor.iphmx.com (esa4.mentor.iphmx.com [68.232.137.252]) by sourceware.org (Postfix) with ESMTPS id 19BFD3858D28; Sat, 1 Apr 2023 08:42:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 19BFD3858D28 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="5.98,310,1673942400"; d="scan'208";a="1089866" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa4.mentor.iphmx.com with ESMTP; 01 Apr 2023 00:42:25 -0800 IronPort-SDR: +N9Y1FpyQ3sxdwGQtpJf2gXIzWVyQe6tPi8rmTnKH/VTG+GBKWxwPk5Rc8oExRbhXZbt54MnIU MsIBl1zccaEVJVB4hLNplaYDfCucCpIJKN5DL/dlc0uSiK3ZHAcWwyXdsNwydLO5suvqioge2Y 7/P2CvFPcLQ4VGzxmjwkZOwQDyfYpV95tjDvHkXKTnGr2wQdCNTEn3PIF9xOsXhzZjwfjDNoEz /QW9diP1s5Bmywq5oa1lECSad8cwomg3qC4QfUXN7Ra0CiJB0VUrLszx7qEcA9Y5K76aZcmaDV czM= From: Thomas Schwinge To: Frederik Harwath CC: , , , Subject: Re: [PATCH 1/7] openmp: Add Fortran support for "omp unroll" directive In-Reply-To: <20230324153046.3996092-2-frederik@codesourcery.com> References: <20230324153046.3996092-1-frederik@codesourcery.com> <20230324153046.3996092-2-frederik@codesourcery.com> User-Agent: Notmuch/0.29.3+94~g74c3f1b (https://notmuchmail.org) Emacs/28.2 (x86_64-pc-linux-gnu) Date: Sat, 1 Apr 2023 10:42:18 +0200 Message-ID: <87ilegouxh.fsf@euler.schwinge.homeip.net> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-14.mgc.mentorg.com (139.181.222.14) To svr-ies-mbx-10.mgc.mentorg.com (139.181.222.10) X-Spam-Status: No, score=-5.9 required=5.0 tests=BAYES_00,HEADER_FROM_DIFFERENT_DOMAINS,KAM_DMARC_STATUS,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 List-Id: Hi Frederik! Thanks for including a good number of test cases with your code changes! This new test case: On 2023-03-24T16:30:39+0100, Frederik Harwath w= rote: > --- /dev/null > +++ b/libgomp/testsuite/libgomp.fortran/loop-transforms/unroll-1.f90 > @@ -0,0 +1,52 @@ > +! { dg-additional-options "-fdump-tree-original" } > +! { dg-do run } > + > +module test_functions > + contains > + integer function compute_sum() result(sum) > + implicit none > + > + integer :: i,j > + > + !$omp do > + do i =3D 1,10,3 > + !$omp unroll full > + do j =3D 1,10,3 > + sum =3D sum + 1 > + end do > + end do > + end function > + > + integer function compute_sum2() result(sum) > + implicit none > + > + integer :: i,j > + > + !$omp parallel do reduction(+:sum) > + !$omp unroll partial(2) > + do i =3D 1,10,3 > + do j =3D 1,10,3 > + sum =3D sum + 1 > + end do > + end do > + end function > +end module test_functions > + > +program test > + use test_functions > + implicit none > + > + integer :: result > + > + result =3D compute_sum () > + write (*,*) result > + if (result .ne. 16) then > + call abort > + end if > + > + result =3D compute_sum2 () > + write (*,*) result > + if (result .ne. 16) then > + call abort > + end if > +end program ... I see FAIL for x86_64-pc-linux-gnu '-m32' (thus, host, not offloading), '-O0' (only): spawn [open ...] 1437822992 Program aborted. Backtrace: #0 0x8048df0 in ??? #1 0x8048ea6 in ??? #2 0x559a3af2 in ??? #3 0x8048bc0 in ??? FAIL: libgomp.fortran/loop-transforms/unroll-1.f90 -O0 execution tes= t All other variants PASS with: spawn [open ...] 16 16 And similarly, this new test case: > --- /dev/null > +++ b/libgomp/testsuite/libgomp.fortran/loop-transforms/unroll-simd-1.f90 > @@ -0,0 +1,33 @@ > +! { dg-options "-fno-openmp -fopenmp-simd" } > +! { dg-additional-options "-fdump-tree-original" } > +! { dg-do run } > + > +module test_functions > + contains > + integer function compute_sum() result(sum) > + implicit none > + > + integer :: i,j > + > + !$omp simd > + do i =3D 1,10,3 > + !$omp unroll full > + do j =3D 1,10,3 > + sum =3D sum + 1 > + end do > + end do > + end function compute_sum > +end module test_functions > + > +program test > + use test_functions > + implicit none > + > + integer :: result > + > + result =3D compute_sum () > + write (*,*) result > + if (result .ne. 16) then > + call abort > + end if > +end program ... I see FAIL for x86_64-pc-linux-gnu '-m32' (thus, host, not offloading), '-O0' (only): spawn [open ...] 41 Program aborted. Backtrace: #0 0x8048c35 in ??? #1 0x8048c72 in ??? #2 0x55977af2 in ??? #3 0x8048a60 in ??? FAIL: libgomp.fortran/loop-transforms/unroll-simd-1.f90 -O0 executio= n test All other variants PASS with: spawn [open ...] 16 Gr=C3=BC=C3=9Fe Thomas ----------------- Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstra=C3=9Fe 201= , 80634 M=C3=BCnchen; Gesellschaft mit beschr=C3=A4nkter Haftung; Gesch=C3= =A4ftsf=C3=BChrer: Thomas Heurung, Frank Th=C3=BCrauf; Sitz der Gesellschaf= t: M=C3=BCnchen; Registergericht M=C3=BCnchen, HRB 106955