[struct-reorg] strip struct frame from one-field structures.

Razya Ladelsky RAZYA@il.ibm.com
Mon May 12 13:08:00 GMT 2008


"Richard Guenther" <richard.guenther@gmail.com> wrote on 12/05/2008 
15:35:22:

> On Mon, May 12, 2008 at 1:41 PM, Alon Dayan <ALOND@il.ibm.com> wrote:
> >
> >  This patch extends struct-reorg optimizations with an ability to 
strip a
> >  structure frame from one-field structures.
> >
> >  For example, the variable 'a' of structure type:
> >
> >  typedef struct str
> >  {
> >         int* a;
> >  }
> >  str a;
> >
> >  will be replaced with
> >  int* a;
> >
> >  It works for both user-defined and compiler generated structures, as, 
for
> >  example, those produced after structure peeling.
> >  The param struct-reorg-strip-struct was added to activate this
> >  optimization.
> >
> >  With this patch we measured additional 15% on 179.art over basic
> >  struct-reorg on p5.
> 
> Did you analyze why?  Because ...
> 
> >  But more than that, it opens further opportunities to subsequent
> >  optimizations by simplifying variable type
> >  from 'structure' type to field type, that might be easier to analyze 
and
> >  transform. For example, with this
> >  patch a one-field structure with an array field becomes a subject for
> >  matrix flattening and transposing,
> >  while without this patch it is not.
> 
> ... I don't buy this.  It shouldn't make a difference to analysis if the
> int * is wrapped inside a struct or not.  And if so, the affected passes
> should be fixed.
> 
> Richard.

i think the intentino is that instead of having an array of structures, 
we now have an array of int*, which makes the array a 2 dimensional array,
thereby a candidate for matrix transformations. 

Thanks,
Razya



More information about the Gcc-patches mailing list