cfgloopmanip.c (create_preheader): Speed up by "unrolling" and simplifying FOR_EACH_EDGE.

* cfgloopmanip.c (create_preheader): Speed up by "unrolling"
	and simplifying FOR_EACH_EDGE.

From-SVN: r91913
This commit is contained in:
Kazu Hirata 2004-12-08 18:52:48 +00:00 committed by Kazu Hirata
parent d63a0e228c
commit b057216dba
2 changed files with 13 additions and 6 deletions

View File

@ -1,3 +1,8 @@
2004-12-08 Kazu Hirata <kazu@cs.umass.edu>
* cfgloopmanip.c (create_preheader): Speed up by "unrolling"
and simplifying FOR_EACH_EDGE.
2004-12-08 Richard Sandiford <rsandifo@redhat.com>
* config/frv/frv.c (frv_sort_insn_group): Always initialize

View File

@ -1156,9 +1156,10 @@ create_preheader (struct loop *loop, int flags)
gcc_assert (nentry);
if (nentry == 1)
{
FOR_EACH_EDGE (e, ei, loop->header->preds)
if (e->src != loop->latch)
break;
/* Get an edge that is different from the one from loop->latch
to loop->header. */
e = EDGE_PRED (loop->header,
EDGE_PRED (loop->header, 0)->src == loop->latch);
if (!(flags & CP_SIMPLE_PREHEADERS) || EDGE_COUNT (e->src->succs) == 1)
return NULL;
@ -1178,9 +1179,10 @@ create_preheader (struct loop *loop, int flags)
/* Reorganize blocks so that the preheader is not stuck in the middle of the
loop. */
FOR_EACH_EDGE (e, ei, dummy->preds)
if (e->src != loop->latch)
break;
/* Get an edge that is different from the one from loop->latch to
dummy. */
e = EDGE_PRED (dummy, EDGE_PRED (dummy, 0)->src == loop->latch);
move_block_after (dummy, e->src);
loop->header->loop_father = loop;