This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: GCC loop iterations and wrapping
- From: Sebastian Pop <sebastian dot pop at cri dot ensmp dot fr>
- To: Zdenek Dvorak <rakdver at atrey dot karlin dot mff dot cuni dot cz>
- Cc: David Edelsohn <dje at watson dot ibm dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>, Daniel Berlin <dberlin at dberlin dot org>
- Date: Fri, 21 Oct 2005 20:19:53 +0200
- Subject: Re: GCC loop iterations and wrapping
- References: <20051017111611.GB3403@napoca.cri.ensmp.fr> <200510171439.j9HEdRq29556@makai.watson.ibm.com> <20051017161246.GA5937@napoca.cri.ensmp.fr> <200510171705.j9HH53q28188@makai.watson.ibm.com> <20051017182521.GA929@napoca.cri.ensmp.fr> <200510171833.j9HIXvq39648@makai.watson.ibm.com> <20051017185146.GA19710@napoca.cri.ensmp.fr> <200510181925.j9IJPtq27920@makai.watson.ibm.com> <20051021172109.GA31610@napoca.cri.ensmp.fr> <20051021180623.GA13448@atrey.karlin.mff.cuni.cz>
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.