This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [struct-reorg] strip struct frame from one-field structures.
- From: "Richard Guenther" <richard dot guenther at gmail dot com>
- To: "Alon Dayan" <ALOND at il dot ibm dot com>
- Cc: "Olga Golovanevsky" <OLGA at il dot ibm dot com>, dnovillo at google dot com, zadeck at naturalbridge dot com, "Razya Ladelsky" <RAZYA at il dot ibm dot com>, dberlin at dberlin dot org, gcc-patches at gcc dot gnu dot org
- Date: Mon, 12 May 2008 14:35:22 +0200
- Subject: Re: [struct-reorg] strip struct frame from one-field structures.
- References: <OF2687452F.7D2514AF-ONC2257447.00387E0A-C2257447.00403170@il.ibm.com>
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.