diff options
-rw-r--r-- | gcc/ChangeLog | 9 | ||||
-rw-r--r-- | gcc/tree-ssa-loop-ivcanon.c | 15 | ||||
-rw-r--r-- | gcc/tree-ssa-pre.c | 6 |
3 files changed, 23 insertions, 7 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 42c6c42818b..7b8f8bd6651 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,14 @@ 2008-08-01 Richard Guenther <rguenther@suse.de> + * tree-ssa-pre.c (fini_pre): Take in_fre parameter. Free + loop information only if we initialized it. + (execute_pre): Call fini_pre with in_fre. + * tree-ssa-loop-ivcanon (try_unroll_loop_completely): Dump + if we do not unroll because we hit max-completely-peeled-insns. + Use our estimation for consistency, do allow shrinking. + +2008-08-01 Richard Guenther <rguenther@suse.de> + PR middle-end/36997 * gimplify.c (gimplify_call_expr): Set error_mark_node on GS_ERROR. diff --git a/gcc/tree-ssa-loop-ivcanon.c b/gcc/tree-ssa-loop-ivcanon.c index dc863f8b8a5..00965465342 100644 --- a/gcc/tree-ssa-loop-ivcanon.c +++ b/gcc/tree-ssa-loop-ivcanon.c @@ -184,10 +184,6 @@ try_unroll_loop_completely (struct loop *loop, ninsns = tree_num_loop_insns (loop, &eni_size_weights); - if (n_unroll * ninsns - > (unsigned) PARAM_VALUE (PARAM_MAX_COMPLETELY_PEELED_INSNS)) - return false; - unr_insns = estimated_unrolled_size (ninsns, n_unroll); if (dump_file && (dump_flags & TDF_DETAILS)) { @@ -196,6 +192,17 @@ try_unroll_loop_completely (struct loop *loop, (int) unr_insns); } + if (unr_insns > ninsns + && (unr_insns + > (unsigned) PARAM_VALUE (PARAM_MAX_COMPLETELY_PEELED_INSNS))) + { + if (dump_file && (dump_flags & TDF_DETAILS)) + fprintf (dump_file, "Not unrolling loop %d " + "(--param max-completely-peeled-insns limit reached).\n", + loop->num); + return false; + } + if (ul == UL_NO_GROWTH && unr_insns > ninsns) { diff --git a/gcc/tree-ssa-pre.c b/gcc/tree-ssa-pre.c index c98a18a772c..336c54ec700 100644 --- a/gcc/tree-ssa-pre.c +++ b/gcc/tree-ssa-pre.c @@ -4086,7 +4086,7 @@ init_pre (bool do_fre) /* Deallocate data structures used by PRE. */ static void -fini_pre (void) +fini_pre (bool do_fre) { basic_block bb; @@ -4117,7 +4117,7 @@ fini_pre (void) BITMAP_FREE (need_eh_cleanup); - if (current_loops != NULL) + if (!do_fre) loop_optimizer_finalize (); } @@ -4192,7 +4192,7 @@ execute_pre (bool do_fre ATTRIBUTE_UNUSED) if (!do_fre) remove_dead_inserted_code (); - fini_pre (); + fini_pre (do_fre); return todo; } |