Re: Fix array bound niter estimate (PR middle-end/54937)

2012-10-23 Thread Richard Biener
On Mon, 22 Oct 2012, Jan Hubicka wrote: > Hi, > here is updated patch with the comments. The fortran failures turned out to > be > funny interaction in between this patch and my other change that hoped that > loop closed SSA is closed on VOPs, but it is not. > > Regtested x86_64-linux, bootstra

Re: Fix array bound niter estimate (PR middle-end/54937)

2012-10-22 Thread Jan Hubicka
Hi, here is updated patch with the comments. The fortran failures turned out to be funny interaction in between this patch and my other change that hoped that loop closed SSA is closed on VOPs, but it is not. Regtested x86_64-linux, bootstrap in progress, OK? Honza * tree-ssa-loop-niter

Re: Fix array bound niter estimate (PR middle-end/54937)

2012-10-22 Thread Jan Hubicka
> > +static void > > +maybe_lower_iteration_bound (struct loop *loop) > > +{ > > + pointer_set_t *not_executed_last_iteration = pointer_set_create (); > > + pointer_set_t *visited; > > + struct nb_iter_bound *elt; > > + bool found = false; > > + VEC (basic_block, heap) *queue = NULL; > > + > >

Re: Fix array bound niter estimate (PR middle-end/54937)

2012-10-22 Thread Richard Biener
On Fri, 19 Oct 2012, Jan Hubicka wrote: > > > > What about the conservative variant of simply > > > > > > > > else > > > > delta = double_int_one; > > > > > > I think it would be bad idea: it makes us to completely unroll one > > > interation > > > too many that bloats code for no

Re: Fix array bound niter estimate (PR middle-end/54937)

2012-10-22 Thread Richard Biener
On Fri, 19 Oct 2012, Jan Hubicka wrote: > > On Fri, 19 Oct 2012, Jan Hubicka wrote: > > > > > Hi, > > > this patch fixes off-by-one error in the testcase attached. The problem > > > is that > > > dominance based test used by record_estimate to check whether the given > > > statement > > > must

Re: Fix array bound niter estimate (PR middle-end/54937)

2012-10-20 Thread Jan Hubicka
> > > > What about the conservative variant of simply > > > > > > > > else > > > > delta = double_int_one; > > > > > > I think it would be bad idea: it makes us to completely unroll one > > > interation > > > too many that bloats code for no benefit. No optimization cancels the >

Re: Fix array bound niter estimate (PR middle-end/54937)

2012-10-19 Thread Jan Hubicka
> > > What about the conservative variant of simply > > > > > > else > > > delta = double_int_one; > > > > I think it would be bad idea: it makes us to completely unroll one > > interation > > too many that bloats code for no benefit. No optimization cancels the path > > in > > CF

Re: Fix array bound niter estimate (PR middle-end/54937)

2012-10-19 Thread Jan Hubicka
> > What about the conservative variant of simply > > > > else > > delta = double_int_one; > > I think it would be bad idea: it makes us to completely unroll one interation > too many that bloats code for no benefit. No optimization cancels the path in > CFG because of undefined eff

Re: Fix array bound niter estimate (PR middle-end/54937)

2012-10-19 Thread Jan Hubicka
> On Fri, 19 Oct 2012, Jan Hubicka wrote: > > > Hi, > > this patch fixes off-by-one error in the testcase attached. The problem is > > that > > dominance based test used by record_estimate to check whether the given > > statement > > must be executed at last iteration of the loop is wrong ignor

Re: Fix array bound niter estimate (PR middle-end/54937)

2012-10-19 Thread Richard Biener
On Fri, 19 Oct 2012, Jan Hubicka wrote: > Hi, > this patch fixes off-by-one error in the testcase attached. The problem is > that > dominance based test used by record_estimate to check whether the given > statement > must be executed at last iteration of the loop is wrong ignoring the side >

Fix array bound niter estimate (PR middle-end/54937)

2012-10-19 Thread Jan Hubicka
Hi, this patch fixes off-by-one error in the testcase attached. The problem is that dominance based test used by record_estimate to check whether the given statement must be executed at last iteration of the loop is wrong ignoring the side effect of other statements that may terminate the program