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]

Why alias set 0 ? (Was: Long term code compactness regression)


> Jan Hubicka wrote:
> 
> > > I checked this morning, with last week's gcc-3.1 snapshot.  A few cases
> > > with g77 have slowed down in recent weeks.  The worst examples of
> > In what testcases g77 slowed down recently?
> >
> > Honza
> 
> Jan, sorry for my pedantry, but I have ready at hand a very short and basic
> c++ testcode (reduced from the Haney tests) which today is 2 times (!) slower
> than one week ago on i686 (-O2)... Do you have time to look a little bit at
> it? Here it is (PR4714 for some more details):
Hi,
I am just looking at the attached 
testcase and first thing that looks odd to me is that there
are memory references of alias set zero to the 'n' field of RealMatrix structure:

(insn 239 232 240 (set (reg:SI 113)
        (mem/s/j:SI (plus:SI (reg/v/u/f:SI 58)
                (const_int 4 [0x4])) [0 S4 A32])) -1 (nil)
    (nil))

These appears to get aliased with:

(insn 297 295 299 (set (mem:SF (plus:SI (reg:SI 119)
                (const_int -4 [0xfffffffc])) [2 S4 A32])
        (reg:SF 133)) -1 (nil)
    (nil))

storing result of the multiplication effectivly disallowing any memory hoisting
and strength reduction of array indexing, as the value still needs to be multiplied.

2.95 version appears to have similar problem, but why?

Richard, do you have any idea?

Honza
> 
> ///////////////////////////////////////////////
> class RealMatrix {
> public:
> 
>   float &index(int i, int j)
>     {
>       return d[i - 1 + n[0] * (j - 1)];
>     }
>   float index(int i, int j) const
>     {
>       return d[i - 1 + n[0] * (j - 1)];
>     }
> 
>   int dim(int i) const { return n[i - 1]; }
> 
> private:
> 
>   float *d;
>   int n[4];
> };
> 
> void rmatMul(RealMatrix &t, const RealMatrix &a, const RealMatrix &b)
> {
>   const int M = a.dim(1), N = b.dim(2), K = b.dim(1);
> 
>   for (int j = 1; j <= N; j++)
>     {
>       for (int k = 1; k <= K; k++)
>         {
>           float temp = b.index(k, j);
>           if (temp != 0.0)
>             {
>               for (int i = 1; i <= M; i++)
>                 t.index(i, j) += temp * a.index(i, k);
>             }
>         }
>     }
> }
> /////////////////////////////////////////
> 
> Thanks,
> Paolo.


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