This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH]: Improve ability to convert loops to perfect nests
- From: Daniel Berlin <dberlin at dberlin dot org>
- To: Zdenek Dvorak <rakdver at atrey dot karlin dot mff dot cuni dot cz>
- Cc: Sebastian Pop <sebastian dot pop at cri dot ensmp dot fr>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Sat, 11 Jun 2005 14:22:24 -0400
- Subject: Re: [PATCH]: Improve ability to convert loops to perfect nests
- References: <1118503464.8107.62.camel@linux.site> <20050611175536.GA27932@atrey.karlin.mff.cuni.cz>
On Sat, 2005-06-11 at 19:55 +0200, Zdenek Dvorak wrote:
> Hello,
>
> > 2005-06-11 Daniel Berlin <dberlin@dberlin.org>
> >
> > * lambda-code.c (replace_uses_equiv_to_x_with_y): Verify the step
> > is an INTEGER_CST before calling int_cst_value.
> >
> > Index: lambda-code.c
> > ===================================================================
> > RCS file: /cvs/gcc/gcc/gcc/lambda-code.c,v
> > retrieving revision 2.43
> > diff -u -p -r2.43 lambda-code.c
> > --- lambda-code.c 10 Jun 2005 19:23:26 -0000 2.43
> > +++ lambda-code.c 11 Jun 2005 15:22:38 -0000
> > @@ -2184,7 +2184,8 @@ replace_uses_equiv_to_x_with_y (struct l
> > (loop, analyze_scalar_evolution (loop, use));
> > if (access_fn != NULL_TREE)
> > step = evolution_part_in_loop_num (access_fn, loop->num);
> > - if ((step && int_cst_value (step) == xstep)
> > + if ((step && TREE_CODE (step) == INTEGER_CST
>
> step && cst_and_fits_in_hwi (step)
>
> would seem safer (I am not sure, perhaps you check the size of the
> type elsewhere?)
You are right, but it's not going to matter at some point.
If one looks at the code around this anyway, we'd realize we're still
going to miss replacements anyway, or screw up types, or this, or
that :)
As i said, the perfect nest transformation code is somewhat of a
trainwreck ATM, so i'm just going to rewrite it.