This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Copyprop through aggregates.
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.
Also looking at the SPEC results or tramp, which neither were
-fno-tree-salias or -fno-tree-sra comparisons, there is improvement.
So, please look at the tree-ssa-copy.c changes and see if they make
sense or if this belongs in a completely separate pass. I will
submit the fix for get_ref_base_and_extent sligthly edited and separately
after bootstrap/testing.
Richard.