[PATCH][RFC] Fix certain cases of VOP / compile-time / memory-usage explosions

Richard Guenther rguenther@suse.de
Tue Nov 20 15:45:00 GMT 2007


On Mon, 19 Nov 2007, Richard Guenther wrote:

> 
> With recent revs (notably the 33870 fix) I now see an increase in 
> compile-time and memory-usage up to the point that we cannot compile Qt
> anymore (PR34148).  One workaround for 4.3 would be to reduce the number
> of addressable vars and pointers before running may_alias, which can be
> effectively done using a forwprop / dce pass combination.
> 
> This reduces the compile-time and memory-usage of this PR 
> from 1.5GB and 54.5s (at -O) to 700MB and 31s or from 600MB and 63s
> (at -O2) to 400MB and 42s (yes, surprisingly we use more memory at -O,
> possibly due to non-strict-aliasing).
> 
> I didn't experiment with moving more of the initial cleanups pre-aliasing
> (ccp and copy_prop would be candidates) or even delete the copies we
> run after aliasing.  I'm throwing the patch on our testers to look for
> any negative compile-time impact (we run two extra passes over the IL
> after all).
> 
> And I realize this is just a workaround for whatever fundamental problems
> we have, but I guess this approach might be appropriate for stage3.

With the inconsistent VOP pruning fixed this patch bootstraps & regtests
ok on x86_64-unknown-linux-gnu apart from testcases that need adjustment.

As the other patch to address the 34184 regression seems to work out
as well, I'm not pushing on this patch now but defer to stage1.  Testing
on SPEC and C++ stuff revealed some general (small) compile-time
improvements, but nothing earth-shattering.

Richard.

> Index: gcc/passes.c
> ===================================================================
> *** gcc/passes.c	(revision 130286)
> --- gcc/passes.c	(working copy)
> *************** init_optimization_passes (void)
> *** 556,561 ****
> --- 556,566 ----
>     NEXT_PASS (pass_all_optimizations);
>       {
>         struct tree_opt_pass **p = &pass_all_optimizations.sub;
> +       /* After inlining run forwprop and DCE to eliminate addressable
> + 	 temporaries again.  This reduces the amount of pointers to
> + 	 be processed by PTA and reduces the number of VOPs created.  */
> +       NEXT_PASS (pass_forwprop);
> +       NEXT_PASS (pass_dce);
>         NEXT_PASS (pass_create_structure_vars);
>         NEXT_PASS (pass_return_slot);
>         NEXT_PASS (pass_rename_ssa_copies);



More information about the Gcc-patches mailing list