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]

[rtlopt] enable complete peeling at -funroll-loops


Hi,
our new loop unroller is not handling "full unrolling" of loops
iterating constant (and small) amount if times.  Instead we handle it as
special case of loop peeling.  Side effect of this is that with
-funroll-loops these loops are no longer optimized that is confusing and
I've trapped myself into it several times.

I think it is completely resonable to see this transformation as special
case of both and enable it when eighter -funroll-loops or -fpeel-loops
is specified.

Honza

Wed Oct 23 16:42:32 CEST 2002  Jan Hubicka  <jh@suse.cz>
	* loop-unroll.c (unroll_or_peel_loop): Do complete unrolling
	when -funroll-loop is specified.

Index: loop-unroll.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/Attic/loop-unroll.c,v
retrieving revision 1.1.2.2
diff -c -3 -p -r1.1.2.2 loop-unroll.c
*** loop-unroll.c	19 Oct 2002 16:58:07 -0000	1.1.2.2
--- loop-unroll.c	23 Oct 2002 14:37:29 -0000
*************** unroll_or_peel_loop (loops, loop, flags)
*** 554,560 ****
        flags &= ~(UAP_UNROLL | UAP_UNROLL_ALL);
      }
  
!   if ((flags & UAP_PEEL) && npeel_completely > 0)
      {
        if (rtl_dump_file)
  	fprintf (rtl_dump_file, ";; Allowing to peel loop completely\n");
--- 554,563 ----
        flags &= ~(UAP_UNROLL | UAP_UNROLL_ALL);
      }
  
!   /* Avoid FAQ - most people when asking for unrolling will expect
!      compiler to remove loop iterating few times.  We handle this as special
!      case of loop peeling but enable it when -funroll-loops is present too.  */
!   if ((flags & (UAP_PEEL | UAP_UNROLL)) && npeel_completely > 0)
      {
        if (rtl_dump_file)
  	fprintf (rtl_dump_file, ";; Allowing to peel loop completely\n");


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