aboutsummaryrefslogtreecommitdiff
path: root/gcc/loop-init.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/loop-init.c')
-rw-r--r--gcc/loop-init.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/gcc/loop-init.c b/gcc/loop-init.c
index 2c7f37a..3e6d342 100644
--- a/gcc/loop-init.c
+++ b/gcc/loop-init.c
@@ -40,22 +40,11 @@ Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
void
loop_optimizer_init (unsigned flags)
{
- edge e;
- edge_iterator ei;
struct loops *loops;
gcc_assert (!current_loops);
loops = XCNEW (struct loops);
- /* Avoid annoying special cases of edges going to exit
- block. */
-
- for (ei = ei_start (EXIT_BLOCK_PTR->preds); (e = ei_safe_edge (ei)); )
- if ((e->flags & EDGE_FALLTHRU) && !single_succ_p (e->src))
- split_edge (e);
- else
- ei_next (&ei);
-
/* Find the loops. */
flow_loops_find (loops);
@@ -69,6 +58,19 @@ loop_optimizer_init (unsigned flags)
return;
}
+ if (flags & LOOPS_MAY_HAVE_MULTIPLE_LATCHES)
+ {
+ /* If the loops may have multiple latches, we cannot canonicalize
+ them further (and most of the loop manipulation functions will
+ not work). However, we avoid modifying cfg, which some
+ passes may want. */
+ gcc_assert ((flags & ~(LOOPS_MAY_HAVE_MULTIPLE_LATCHES
+ | LOOPS_HAVE_RECORDED_EXITS)) == 0);
+ current_loops->state = LOOPS_MAY_HAVE_MULTIPLE_LATCHES;
+ }
+ else
+ disambiguate_loops_with_multiple_latches ();
+
/* Create pre-headers. */
if (flags & LOOPS_HAVE_PREHEADERS)
create_preheaders (CP_SIMPLE_PREHEADERS);