This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH, middle-end]: move superblock formation to Tree-SSA
- From: Zdenek Dvorak <rakdver at kam dot mff dot cuni dot cz>
- To: Robert Kidd <rkidd at crhc dot uiuc dot edu>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Tue, 12 Jun 2007 13:17:01 +0200
- Subject: Re: [PATCH, middle-end]: move superblock formation to Tree-SSA
- References: <8B3392EC-DC4C-4ED9-8096-D16D3846C380@crhc.uiuc.edu>
Hello,
> Please find attached a patch to move Superblock formation to the Tree-
> SSA representation. This change buys about 1% on SPEC on IA64 and x86.
> diff -up -Nr gcc-stock/gcc/passes.c gcc-superblock-1/gcc/passes.c
> --- gcc-stock/gcc/passes.c 2007-06-10 21:29:07.000000000 -0500
> +++ gcc-superblock-1/gcc/passes.c 2007-06-10 22:04:36.000000000 -0500
> @@ -532,6 +532,7 @@ init_optimization_passes (void)
> NEXT_PASS (pass_phiprop);
> NEXT_PASS (pass_fre);
> NEXT_PASS (pass_dce);
> + NEXT_PASS (pass_tracer);
> NEXT_PASS (pass_forwprop);
> NEXT_PASS (pass_copy_prop);
> NEXT_PASS (pass_merge_phi);
this seems way too early, given that pass_tracer may (for example in
the testcase you propose) make the code harder to optimize in loop
optimizers. I think having it just after loop optimizer passes might be
a better idea.
Zdenek
> diff -up -Nr gcc-stock/gcc/testsuite/gcc.dg/tree-prof/tracer-1.c gcc-superblock-1/gcc/testsuite/gcc.dg/tree-prof/tracer-1.c
> --- gcc-stock/gcc/testsuite/gcc.dg/tree-prof/tracer-1.c 1969-12-31 18:00:00.000000000 -0600
> +++ gcc-superblock-1/gcc/testsuite/gcc.dg/tree-prof/tracer-1.c 2007-06-10 22:04:36.000000000 -0500
> @@ -0,0 +1,18 @@
> +/* { dg-options "-O2 -ftracer -fdump-tree-tracer" } */
> +main ()
> +{
> + int i;
> + int a, b, c;
> + for (i = 0; i < 1000; i++)
> + {
> + if (i % 17)
> + a++;
> + else
> + b++;
> + c++;
> + }
> + return 0;
> +}
> +/* Superblock formation should produce two copies of the increment of c */
> +/* { dg-final-use { scan-tree-dump-times "c_\[0-9\]* = c_\[0-9\]* \\+ 1;" 2 "tracer" } } */
> +/* { dg-final-use { cleanup-tree-dump "tracer" } } */