This is the mail archive of the 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]

Vectorizing invariant data-ref


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

do j=1,ny
  do i=1,nx

    arr1(i,j,k) = arr2(i,j,k  ) *dyinv

  end do
end do

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.


(See attached file: test41.f90.txt)

Attachment: test41.f90.txt
Description: Text document

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