This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Ping: RFA: Improve doloop_begin support
- From: Zdenek Dvorak <rakdver at iuuk dot mff dot cuni dot cz>
- To: Joern Rennecke <joern dot rennecke at embecosm dot com>
- Cc: gcc-patches at gcc dot gnu dot org, Daniel Berlin <dberlin at dberlin dot org>
- Date: Tue, 16 Oct 2012 11:21:10 +0200
- Subject: Re: Ping: RFA: Improve doloop_begin support
- References: <20121015005038.n7i3gxpezogggogs-nzlynne@webmail.spamcop.net>
Hi,
> 2012-09-26 J"orn Rennecke <joern.rennecke@arc.com>
>
> * loop-doloop.c (doloop_modify): Pass doloop_end pattern to
> gen_doloop_begin.
> * loop-doloop.c (doloop_optimize): Pass flag to indicate if loop is
> entered at top to gen_doloop_end.
> * config/arm/thumb2.md (doloop_end): Accept extra operand.
> * config/bfin/bfin.md (doloop_end): Likewise.
> * config/c6x/c6x.md (doloop_end): Likewise.
> * config/ia64/ia64.md (doloop_end): Likewise.
> * config/mep/mep.md (doloop_begin, doloop_end): Likewise.
> * config/rs6000/rs6000.md (doloop_end): Likewise.
> * config/s390/s390.md (doloop_end): Likewise.
> * config/sh/sh.md (doloop_end): Likewise.
> * config/spu/spu.md (doloop_end): Likewise.
> * config/tilegx/tilegx.md (doloop_end): Likewise.
> * config/tilepro/tilepro.md (doloop_end): Likewise.
> * doc/md.texi (doloop_end): Document new operand.
>
> http://gcc.gnu.org/ml/gcc-patches/2012-09/msg01807.html
+ entered_at_top = loop_preheader_edge (loop)->dest == desc->in_edge->dest;
is equivalent to
+ entered_at_top = loop->header == desc->in_edge->dest;
But, I don't think it will do what you want. Loops are canonicalized so that
their latch blocks have single successors. So, desc->in_edge->dest will be
the latch block, not the header, for the loop entered at the top. I think
+ entered_at_top = (loop->latch == desc->in_edge->dest
+ && forwarder_block_p (loop->latch));
is what you want. Other than that, the patch seems ok to me,
Zdenek