> > @@ -0,0 +1,11 @@
> > +/* { dg-do compile } */
> > +/* { dg-options "-O3 -fdump-tree-loop-ivcanon" } */
> 
> This should probably be -fdump-tree-ivcanon-details.

Yep, I updated the testcaes in my tree.
> 
> > +struct foo {int b; int a[3];} foo;
> > +void add(struct foo *a,int l)
> > +{
> > +  int i;
> > +  for (i=0;i<l;i++)
> > +    a->a[i]++;
> > +}
> > +/* { dg-final { scan-tree-dump "Loop likely 1 iterates at most 3 times." 1 
> > "ivcanon"} } */
> > +/* { dg-final { scan-tree-dump "Peeled loop 1, 4 times." 1 "ivcanon"} } */
> 
> And here scan-tree-dump-times.  But even with that the testcases don't pass 
> for
> me.
It is because the unrolling happens in cunroll. 
> 
> > Index: testsuite/gcc.dg/tree-ssa/peel2.c
> > ===================================================================
> > --- testsuite/gcc.dg/tree-ssa/peel2.c       (revision 0)
> > +++ testsuite/gcc.dg/tree-ssa/peel2.c       (working copy)
> > @@ -0,0 +1,10 @@
> > +/* { dg-do compile } */
> > +/* { dg-options "-O3 -fpeel-all-loops -fdump-tree-loop-ivcanon" } */
> > +void add(int *a,int l)
> > +{
> > +  int i;
> > +  for (i=0;i<l;i++)
> > +    a[i]++;
> > +}
> > +/* { dg-final { scan-tree-dump "Loop likely 1 iterates at most 3 times." 1 
> > "ivcanon"} } */
> 
> How do you determine "3 times"?  Isn't something missing here?

It is bogus, I meant to only that that loop gets unrolled.  I should have 
re-run the tests
after changing them :)
I will send updated patch shortly

Honza

Reply via email to