This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [lno] [patch] vectorizer update - loop bound
- From: Dorit Naishlos <DORIT at il dot ibm dot com>
- To: Paul Brook <paul at codesourcery dot com>
- Cc: gcc-patches at gcc dot gnu dot org, pop at gauvain dot u-strasbg dot fr, Toon Moene <toon at moene dot indiv dot nluug dot nl>
- Date: Tue, 20 Jan 2004 19:09:31 +0200
- Subject: Re: [lno] [patch] vectorizer update - loop bound
> In gfortran we currently flatten all array access into a 0-based one
> dimensional array pointer.
>
> This is something that I hope to address fairly soon. To be done properly
I
> think it requires the addition of additional semantics for ARRAY_TYPEs,
> and/or an extra lowering pass.
I'm not sure I understand - Do you mean that the TYPE_MIN_VALUE of the
arrays is always set to 0, but the references are not yet modified
accordingly?
If I compile Toon's example below with gfortran, I get 0 for TYPE_MIN_VALUE
(TYPE_DOMAIN (array_type)). Is that an expected behavior? If so, does the
compiler have a way to find what is the correct first index?
thanks,
dorit
> DIMENSION A(1000000), B(1000000), C(1000000)
> READ*, X, Y
> A = LOG(X); B = LOG(Y); C = A + B
> PRINT*, C(500000)
> END
Paul Brook
<paul@codesourcer To: Dorit Naishlos/Haifa/IBM@IBMIL
y.com> cc: gcc-patches@gcc.gnu.org, Geoff Keating <geoffk@geoffk.org>,
pop@gauvain.u-strasbg.fr, Toon Moene <toon@moene.indiv.nluug.nl>
19/01/2004 18:25 Subject: Re: [lno] [patch] vectorizer update - loop bound
On Monday 19 January 2004 4:23 pm, Dorit Naishlos wrote:
> I figured out what the problem was, but now that the vectorizer passes
that
> stage, it fails on an alignment check, which currently tries to make sure
> that the array base and the first access to the array are aligned (which
is
> over conservative on purpose). The first access however is at index 1,
> which leads the vectorizer to conclude that the accesses to this array
are
> not aligned. Shouldn't the array accesses be normalized to start from 0
> when the Fortran program is translated to the trees? If not, can I query
> what was the source language and treat Fortran programs differently than
C
> (e.g., consider accesses to index i as accesses to index (i-1) in case
it's
> Fortran)?
This is not quite so easy to do in the general case (pointer and
allocatable
arrays).
In gfortran we currently flatten all array access into a 0-based one
dimensional array pointer.
This is something that I hope to address fairly soon. To be done properly I
think it requires the addition of additional semantics for ARRAY_TYPEs,
and/or an extra lowering pass.
Paul