[PATCH] Copyprop through aggregates.

Daniel Berlin dberlin@dberlin.org
Sat Feb 4 18:01:00 GMT 2006


On Sat, 2006-02-04 at 17:04 +0100, Richard Guenther wrote:
> On Sat, 4 Feb 2006, dberlin@dberlin.org wrote:
> 
> > >
> > > This patch enhances copyprop to see through store/load pairs to
> > > aggregates by walking virtual use-def chains.  See
> > > http://gcc.gnu.org/ml/gcc-patches/2006-01/msg01972.html
> > > for SPEC results and numbers for extra copyprop opportunities
> > > during a gcc bootstrap (though not including INDIRECT_REF bases
> > > at that time due to the missing fix for get_ref_base_and_extent -
> > > I can re-do the measurement, though).
> > >
> > > Bootstrapped and tested on x86_64-unknown-linux-gnu for all languages
> > > including Ada.
> > >
> > > Ok for mainline?
> > >
> > 
> > I'm curious why you keep having to add -fno-tree-salias to testcases. 
> > Since this is not the default, ISTM you should be showing improvement
> > without it.
> > Otherwise, what's the point?
> 
> The point is it works in the cases we did to decide not to decompose
> a structure to SFTs.  Like for arrays with more than 4 elements.  Or
> for the case in
> 
> /* { dg-do compile } */
> /* { dg-options "-O -fno-tree-sra -fno-tree-salias 
> -fdump-tree-copyprop-details" } */
> 
> typedef struct {
>   int i;
>   int j;
> } A;
> int foo(A *a, int i, int j)
> {
>   a->i = i;
>   a->j = j;
>   return a->i + a->j;
> }
> 
> /* { dg-final { scan-tree-dump "into:.*i_. \\+ j_." "copyprop1" } } */
> /* { dg-final { cleanup-tree-dump "copyprop" } } */
> 
> 
> where I simply forgot to remove -fno-tree-salias and -fno-tree-sra.
Okay.

The message may have come off wrong because i wrote it from webmail so i
did it quickly.

I didn't mean to suggest this is really pointless, I was more saying you
should be showing it off more by giving testcases that don't require
those flags, or tramp3d resluts, or something, so that diego will look
at it relatively quickly.

> Also looking at the SPEC results or tramp, which neither were
> -fno-tree-salias or -fno-tree-sra comparisons, there is improvement.

Like this :)


I'm happy to look at the copyprop changes, but i can't approve them
anyway.



More information about the Gcc-patches mailing list