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 <frede...@codesourcery.com> wrote:
> --- /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 = 1,10,3
> +       !$omp unroll full
> +       do j = 1,10,3
> +          sum = 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 = 1,10,3
> +       do j = 1,10,3
> +          sum = sum + 1
> +       end do
> +    end do
> +  end function
> +end module test_functions
> +
> +program test
> +  use test_functions
> +  implicit none
> +
> +  integer :: result
> +
> +  result = compute_sum ()
> +  write (*,*) result
> +  if (result .ne. 16) then
> +     call abort
> +  end if
> +
> +  result = 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 test

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 = 1,10,3
> +       !$omp unroll full
> +       do j = 1,10,3
> +          sum = sum + 1
> +       end do
> +    end do
> +  end function compute_sum
> +end module test_functions
> +
> +program test
> +  use test_functions
> +  implicit none
> +
> +  integer :: result
> +
> +  result = 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  execution 
test

All other variants PASS with:

    spawn [open ...]
              16


Grüße
 Thomas


-----------------
Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 
München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas 
Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht 
München, HRB 106955

Reply via email to