This is the mail archive of the 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]

Re: [RFC] Fix PR19401: always completely peel loops

On Thu, 13 Jan 2005, Giovanni Bajo wrote:

> Richard Guenther <> wrote:
> > This minimal patch unconditionally enables complete loop peeling
> > at the tree level.
> I do not see any data numbers baking up this chain. Ideally, I would like to
> see how this affects the bootstrap time, how it affects the SPEC scores, how it
> affects compile/run time on POOMA. Also, it should be tested at -Os too, like
> on CSiBE (or similar), since it should not make GCC regress when optimizing for
> size.

Well, it's motivated two-ways - for one, we currently generate very
much worse code for std::pow(x, 2) than for std::pow(x, 2.0) if you
do not specify -funroll-loops -- for another, in gcc 3.4 I could get
the loops from PR19401 unrolled with specifying -fpeel-loops and not
get hurt by side-effects of -funroll-loops.  For the tree peeler, I
cannot do this, as its use is guarded by flag_unroll_loops, not
flag_peel_loops (which would be an alternative patch, I'd propose
if complete unrolling cannot be enabled by default).

The patch didn't work anyway due to this oversight(?) -- Zdenek?


2005-01-13  Richard Guenther <>

	* tree-ssa-loop-ivcanon.c (try_unroll_loop_completely):
	Guard complete unrolling by completely_unroll, not
	flag_unroll_loops, like everywhere else in this function.

Index: gcc/tree-ssa-loop-ivcanon.c
RCS file: /cvs/gcc/gcc/gcc/tree-ssa-loop-ivcanon.c,v
retrieving revision 2.5
diff -u -c -3 -p -r2.5 tree-ssa-loop-ivcanon.c
*** gcc/tree-ssa-loop-ivcanon.c	1 Oct 2004 18:26:31 -0000	2.5
--- gcc/tree-ssa-loop-ivcanon.c	13 Jan 2005 11:12:35 -0000
*************** try_unroll_loop_completely (struct loops
*** 168,174 ****

    if (n_unroll)
!       if (!flag_unroll_loops)
  	return false;

        old_cond = COND_EXPR_COND (cond);
--- 168,174 ----

    if (n_unroll)
!       if (!completely_unroll)
  	return false;

        old_cond = COND_EXPR_COND (cond);

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