This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Vectorizing invariant data-ref


On Sun, Jul 19, 2009 at 8:18 AM, Revital1 Eres<ERES@il.ibm.com> wrote:
>
> Hello,
>
> The following snippet is from a f90 program which contains
> a loop that does not get vectorized.
>
> SUBROUTINE foo1(nx,ny,nz,arr2)
> USE globalvar_mod, ONLY : dyinv, xstart, xstop
>
> k=1
> do j=1,ny
> ?do i=1,nx
>
> ? ?arr1(i,j,k) = arr2(i,j,k ?) *dyinv
>
> ?end do
> end do
> END SUBROUTINE foo1
>
> The vectorizer failure message is:
>
> ? ? ? ?base_address: &dyinv
> ? ? ? ?offset from base address: 0
> ? ? ? ?constant offset from base address: 0
> ? ? ? ?step: 0
> ? ? ? ?aligned to: 128
> ? ? ? ?base_object: dyinv
> ? ? ? ?FAILED as dr address is invariant
>
> test41.f90:24: note: get vectype with 2 units of type real(kind=8)
> test41.f90:24: note: vectype: vector real(kind=8)
> test41.f90:24: note: not vectorized: unhandled data-ref
> test41.f90:24: note: bad data references.
> test41.f90:7: note: vectorized 0 loops in function.
>
> I am not familiar with f90 at all; seemingly dyinv is a regular
> variable but according to the message in the dump file
> it's a reference.
>
> One option to vectorize this loop is to extend the vectorizer's versioning
> for aliasing capability to version the loop also in this case.
> Other suggestions will be appreciated.

The testcase is from 459.GemsFDTD, right?  dyinv is a regular
global variable.  The issue is the global arrays arr1 and arr2 end
up pointing to anything even though the Fortran aliasing rules say
the do not.

We are working on this issue.

Thanks,
Richard.

> Thanks,
> Revital
>
>
> (See attached file: test41.f90.txt)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]