diff options
author | kazu <kazu@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-12-08 18:52:48 +0000 |
---|---|---|
committer | kazu <kazu@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-12-08 18:52:48 +0000 |
commit | 050ecc41f80af0d1719bab230a2afc85f95bb236 (patch) | |
tree | 4e16e8f3757b241aca3fb4449f18006ee08624a5 /gcc/cfgloopmanip.c | |
parent | f98c17aae465015bc8abac4bfc039be1b29559d3 (diff) | |
download | gcc-050ecc41f80af0d1719bab230a2afc85f95bb236.tar.gz |
* cfgloopmanip.c (create_preheader): Speed up by "unrolling"
and simplifying FOR_EACH_EDGE.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@91913 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cfgloopmanip.c')
-rw-r--r-- | gcc/cfgloopmanip.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/gcc/cfgloopmanip.c b/gcc/cfgloopmanip.c index 06fbf701e23..77988c20c2f 100644 --- a/gcc/cfgloopmanip.c +++ b/gcc/cfgloopmanip.c @@ -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; |