This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH 5/7] Protect loops that might be executed zero times.
- From: Tobias Grosser <grosser at fim dot uni-passau dot de>
- To: Richard Guenther <richard dot guenther at gmail dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Tue, 01 Dec 2009 11:16:26 +0100
- Subject: Re: [PATCH 5/7] Protect loops that might be executed zero times.
- References: <cover.1259618689.git.grosser@fim.uni-passau.de> <a2d82a997a5d3535f580a0ee8c323cd691cf7907.1259618689.git.grosser@fim.uni-passau.de> <84fc9c000912010205j25c02ae9y6657089742f65088@mail.gmail.com>
A. On Tue, 2009-12-01 at 11:05 +0100, Richard Guenther wrote:
> On Mon, Nov 30, 2009 at 11:10 PM, Tobias Grosser
> <grosser@fim.uni-passau.de> wrote:
> > From: grosser <grosser@138bc75d-0d04-0410-961f-82ee72b054a4>
> >
> > 2009-11-23 Tobias Grosser <grosser@fim.uni-passau.de>
> >
> > PR middle-end/42130
> > * graphite-clast-to-gimple.c (graphite_create_new_loop_guard,
> > translate_clast_for_loop): New.
> > (translate_clast_for): Add a condition around the loop, to do not
> > execute loops with zero iterations.
> > * testsuite/g++.dg/graphite/pr42130.C: New.
> > * testsuite/gcc.dg/graphite/pr35356-2.c: Adapt.
> > ---
> > gcc/ChangeLog.graphite | 10 ++++
> > gcc/graphite-clast-to-gimple.c | 84 ++++++++++++++++++++++++++++-
> > gcc/testsuite/g++.dg/graphite/pr42130.C | 18 ++++++
> > gcc/testsuite/gcc.dg/graphite/pr35356-2.c | 16 +++++-
> > 4 files changed, 124 insertions(+), 4 deletions(-)
> > create mode 100644 gcc/testsuite/g++.dg/graphite/pr42130.C
> >
> > diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite
> > index c705cbd..863b0be 100644
> > --- a/gcc/ChangeLog.graphite
> > +++ b/gcc/ChangeLog.graphite
> > @@ -1,5 +1,15 @@
> > 2009-11-23 Tobias Grosser <grosser@fim.uni-passau.de>
> >
> > + PR middle-end/42130
> > + * graphite-clast-to-gimple.c (graphite_create_new_loop_guard,
> > + translate_clast_for_loop): New.
> > + (translate_clast_for): Add a condition around the loop, to do not
> > + execute loops with zero iterations.
> > + * testsuite/g++.dg/graphite/pr42130.C: New.
> > + * testsuite/gcc.dg/graphite/pr35356-2.c: Adapt.
> > +
> > +2009-11-23 Tobias Grosser <grosser@fim.uni-passau.de>
> > +
> > * graphite-clast-to-gimple.c (try_mark_loop_parallel): New.
> > (translate_clast_for, translate_clast_guard, translate_clast, gloog):
> > Remove context_loop and level.
> > diff --git a/gcc/graphite-clast-to-gimple.c b/gcc/graphite-clast-to-gimple.c
> > index 4f45708..3795f6f 100644
> > --- a/gcc/graphite-clast-to-gimple.c
> > +++ b/gcc/graphite-clast-to-gimple.c
> > @@ -768,8 +768,47 @@ try_mark_loop_parallel (sese region, loop_p loop, htab_t bb_pbb_mapping)
> > loop->can_be_parallel = true;
> > }
> >
> > +static tree gcc_type_for_iv_of_clast_loop (struct clast_for *);
> >
> > -/* Translates a clast for statement STMT to gimple.
> > +
> > +/* Creates a new if region protecting the loop to be executed, if the execution
> > + * count is zero (lb > ub). */
>
> GCC coding-style does not want the leading '*' on the second line
> of the comment.
>
> Also seen below again.
>
> Richard.
Already fixed in Patch 6/7. I just moved the changes from the graphite
branch. Probably I could have merged them before, however this would
make merge tracking harder.
Maybe I merge the changes but keep the two commit messages the next
time.
Thanks for your review
Tobi