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]

Re: GCC loop iterations and wrapping


Zdenek Dvorak wrote:
> Hello,
> 
> > -  /* FIXME: convert_step should not be used outside chrec_convert: fix
> > -     this by calling chrec_convert.  */
> > -  iv_step = convert_step (dta->ivopts_data->current_loop,
> > -			  sizetype, iv->base, iv->step, dta->stmt);
> > +  chrec = build_polynomial_chrec (loop->num, iv->base, iv->step);
> > +  chrec = chrec_convert (sizetype, chrec, dta->stmt);
> 
> I don't like this change.  You just waste memory creating a
> polynomial_chrec, without any reason.
> 

It is possible to add the same check to as in chrec_convert 

      if (!flag_unsafe_loop_optimizations 
	  && scev_probably_wraps_p (type, base, step, at_stmt, loop,
				    &dummy, &dummy))

and then call convert_step, for avoiding to waste memory.


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