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] Small cleanups


This makes the unroller dumps somewhat more informative if we
hit the param limits and it makes the sizes used consistent.
It also allows FRE to be placed inside the loop optimizer passes
by making sure to not release their loop information.

Bootstrapped and tested on x86_64-unknown-linux-gnu, applied to trunk.

Richard.

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.

Index: gcc/tree-ssa-pre.c
===================================================================
*** gcc/tree-ssa-pre.c	(revision 138513)
--- gcc/tree-ssa-pre.c	(working copy)
*************** init_pre (bool do_fre)
*** 4086,4092 ****
  /* Deallocate data structures used by PRE.  */
  
  static void
! fini_pre (void)
  {
    basic_block bb;
  
--- 4086,4092 ----
  /* Deallocate data structures used by PRE.  */
  
  static void
! fini_pre (bool do_fre)
  {
    basic_block bb;
  
*************** fini_pre (void)
*** 4117,4123 ****
  
    BITMAP_FREE (need_eh_cleanup);
  
!   if (current_loops != NULL)
      loop_optimizer_finalize ();
  }
  
--- 4117,4123 ----
  
    BITMAP_FREE (need_eh_cleanup);
  
!   if (!do_fre)
      loop_optimizer_finalize ();
  }
  
*************** execute_pre (bool do_fre ATTRIBUTE_UNUSE
*** 4192,4198 ****
    if (!do_fre)
      remove_dead_inserted_code ();
  
!   fini_pre ();
  
    return todo;
  }
--- 4192,4198 ----
    if (!do_fre)
      remove_dead_inserted_code ();
  
!   fini_pre (do_fre);
  
    return todo;
  }
Index: gcc/tree-ssa-loop-ivcanon.c
===================================================================
*** gcc/tree-ssa-loop-ivcanon.c	(revision 138513)
--- gcc/tree-ssa-loop-ivcanon.c	(working copy)
*************** try_unroll_loop_completely (struct loop
*** 184,193 ****
  
        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))
  	{
--- 184,189 ----
*************** try_unroll_loop_completely (struct loop
*** 196,201 ****
--- 192,208 ----
  		   (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)
  	{


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