File: loop_versioning_2.f90

package info (click to toggle)
gcc-arm-none-eabi 15%3A14.2.rel1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,099,328 kB
  • sloc: cpp: 3,627,108; ansic: 2,571,498; ada: 834,230; f90: 235,082; makefile: 79,231; asm: 74,984; xml: 51,692; exp: 39,736; sh: 33,298; objc: 15,629; python: 15,069; fortran: 14,429; pascal: 7,003; awk: 5,070; perl: 3,106; ml: 285; lisp: 253; lex: 204; haskell: 135
file content (39 lines) | stat: -rw-r--r-- 1,095 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
! { dg-options "-O3 -fdump-tree-lversion-details -fno-frontend-loop-interchange" }

! We could version the loop for when the first dimension has a stride
! of 1, but at present there's no real benefit.  The gimple loop
! interchange pass couldn't handle the versioned loop, and interchange
! is instead done by the frontend (but disabled by the options above).

subroutine f1(x)
  real :: x(:, :)
  do i = lbound(x, 1), ubound(x, 1)
     do j = lbound(x, 2), ubound(x, 2)
        x(i, j) = 100
     end do
  end do
end subroutine f1

subroutine f2(x, n, step)
  integer :: n, step
  real :: x(100, 100)
  do i = 1, n
     do j = 1, n
        x(i * step, j) = 100
     end do
  end do
end subroutine f2

subroutine f3(x, n, step)
  integer :: n, step
  real :: x(n * step, n)
  do i = 1, n
     do j = 1, n
        x(i * step, j) = 100
     end do
  end do
end subroutine f3

! { dg-final { scan-tree-dump-times {likely to be the innermost dimension} 1 "lversion" } }
! { dg-final { scan-tree-dump-not {want to version} "lversion" } }
! { dg-final { scan-tree-dump-not {versioned} "lversion" } }