This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/34265] Missed optimizations
- From: "rguenth at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 29 Nov 2007 10:11:51 -0000
- Subject: [Bug tree-optimization/34265] Missed optimizations
- References: <bug-34265-12313@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #17 from rguenth at gcc dot gnu dot org 2007-11-29 10:11 -------
Doh, not only I missed to diff the chunk mentioned in comment #6, but I also
added the original unrolling pass, not the one only supposed to unroll inner
loops #)
So, change the passes.c hunk to
Index: gcc/passes.c
===================================================================
--- gcc/passes.c (revision 130511)
+++ gcc/passes.c (working copy)
@@ -570,6 +570,9 @@ init_optimization_passes (void)
NEXT_PASS (pass_merge_phi);
NEXT_PASS (pass_vrp);
NEXT_PASS (pass_dce);
+ NEXT_PASS (pass_tree_loop_init);
+ NEXT_PASS (pass_complete_unrolli);
+ NEXT_PASS (pass_tree_loop_done);
NEXT_PASS (pass_cselim);
NEXT_PASS (pass_dominator);
/* The only const/copy propagation opportunities left after
that should fix some of the testsuite failures. Some thing also to experiment
with (to maybe fix some of the compile-time problems) is in the
tree-lssa-loop-ivcanon.c hunk change the condition to
if (!unroll_outer
&& loop->inner)
continue;
to only unroll innermost loops, not all-but-outermost loops.
As of pass placement another thing to look at is if it works as part of
early optimizations around
NEXT_PASS (pass_early_inline);
NEXT_PASS (pass_cleanup_cfg);
NEXT_PASS (pass_rename_ssa_copies);
.... here
NEXT_PASS (pass_ccp);
NEXT_PASS (pass_forwprop);
NEXT_PASS (pass_update_address_taken);
.... or here
NEXT_PASS (pass_simple_dse);
NEXT_PASS (pass_sra_early);
because this may enable SRA of variables in the loop body.
Most of the compile-time impact is actually from doing loop discovery, but
as we preserve loops now maybe we do not need pass_tree_loop_done after
the early unrolling and as well not pass_tree_loop_init before the rest
of loop optimizations anymore? Zdenek, can you confirm this?
--
rguenth at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |rakdver at gcc dot gnu dot
| |org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34265