This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Help with Dependency question
- From: Sebastian Pop <sebastian dot pop at cri dot ensmp dot fr>
- To: shreyas krishnan <shreyas76 at gmail dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Sun, 21 Aug 2005 11:58:26 +0200
- Subject: Re: Help with Dependency question
- References: <24389fb305082014076e600c59@mail.gmail.com>
shreyas krishnan wrote:
> Hi,
> For this simple loop, I get the following distance and direction vector
>
> Distance {1,-1)
> Direction (2,0)
>
> for(J = 1; J <= N-1; J++)
> for(I = 1; I <= N-1; I++)
> {
> XX = X[I+1][J];
> XY = X[I][J+1];
> }
>
>
> Can some body explain why thats so ?
Because:
at iteration J=1, I=2 you're accessing X[I][J+1], i.e. X[2][2]
at iteration J=2, I=1 you're accessing X[I+1][J], i.e. X[2][2]
thus, you have accessed the same array location at a distance of
(1, -1) in the iteration space.
Now, if you get a lexicographically negative distance vector, you
should know that this is a wrong answer, and the cause for this is
that the current subscript coupling does not implement the delta test.
I should filter out all these cases just for ensuring that anybody
gets hurt by this one: this is already what we're doing in the
autovect branch.
Sebastian