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: rtlopt loop unroller question


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


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