This is the mail archive of the gcc-patches@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: [struct-reorg] strip struct frame from one-field structures.


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.


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