This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Partly solve PR19401


This patch enables complete loop peeling at the tree level, if
-fpeel-loops is specified.  This mimics the RTL loop optimizer
where you get complete loop peeling with -fpeel-loops.  This
is necessary to benefit from tree-level complete peeling without
suffering from generic RTL level loop unrolling.

The second hunk is also in Zdeneks patch
http://gcc.gnu.org/ml/gcc-patches/2005-01/msg00796.html
and it's quite obvious, too.  Btw. Zdeneks patch solves PR19401
completely, but is more intrusive.  This patch merely restores
behavior from gcc 3.4.

Bootstrapped on ia64.

Ok?  If yes, please apply.

Thanks,
Richard.


2005-Jan-20  Richard Guenther <richard.guenther@uni-tuebingen.de>

	* tree-ssa-loop.c (gate_tree_complete_unroll): Run
	complete unrolling if -fpeel-loops is specified, too.
	tree-ssa-loop-ivcanon.c (try_unroll_loop_completely):
	Remove superfluous and bogous check for flag_unroll_loops.


*** tree-ssa-loop.c.orig	Thu Jan 20 13:10:46 2005
--- tree-ssa-loop.c	Thu Jan 20 13:12:20 2005
*************** tree_complete_unroll (void)
*** 340,346 ****
  static bool
  gate_tree_complete_unroll (void)
  {
!   return flag_unroll_loops != 0;
  }

  struct tree_opt_pass pass_complete_unroll =
--- 340,346 ----
  static bool
  gate_tree_complete_unroll (void)
  {
!   return flag_peel_loops || flag_unroll_loops;
  }

  struct tree_opt_pass pass_complete_unroll =
*** tree-ssa-loop-ivcanon.c.orig	Thu Jan 20 13:13:42 2005
--- tree-ssa-loop-ivcanon.c	Thu Jan 20 13:14:16 2005
*************** try_unroll_loop_completely (struct loops
*** 168,176 ****

    if (n_unroll)
      {
-       if (!flag_unroll_loops)
- 	return false;
-
        old_cond = COND_EXPR_COND (cond);
        COND_EXPR_COND (cond) = dont_exit;
        modify_stmt (cond);
--- 168,173 ----


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]