Hi, > 2012-09-26 J"orn Rennecke <joern.renne...@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