This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: rtlopt loop unroller question
- From: Zdenek Dvorak <rakdver at atrey dot karlin dot mff dot cuni dot cz>
- To: Yossi Markovich <YOSSIM at il dot ibm dot com>
- Cc: gcc gnu <gcc at gcc dot gnu dot org>, Ayal Zaks <ZAKS at il dot ibm dot com>,Dorit Naishlos <DORIT at il dot ibm dot com>
- Date: Thu, 6 Nov 2003 17:20:56 +0100
- Subject: Re: rtlopt loop unroller question
- References: <20031023203004.GA10121@atrey.karlin.mff.cuni.cz> <OFB8579F29.5653252F-ONC2256DCB.00390A7B-C2256DCB.003965F7@il.ibm.com>
Hello,
> >> However, if we complicate the example a little bit:
> >>
> >> {
> >> int A[N];
> >> int B[N];
> >> int C[N];
> >> int i;
> >>
> >> for (i=0; i<N; i++)
> >> A[i]=B[i]+C[i];
> >> return A;
> >> }
> >>
> >> we still get the inefficient addressing calculations.
> >> Using static variables instead of local ones yields
> >> much better code with or without your patch.
>
> >I am not sure what you refer to here (could you please demonstrate on
> >assembler)?
>
> where we still get the inefficient addressing calculations.
> (even after applying your first patch)
>
> notice that when declaring the arrays as static type ,
> we get the following asm code
> where we don't get the inefficient calculations (beside the redundant adds):
to solve this, you probably just need to adjust the costs assigned to
the addressing modes (provided that the first one really is less
efficient; I don't know enough about the architecture to judge this).
Almost definitely this has nothing to do with loop optimizer.
Zdenek