-/* Find the entry edges into the LOOP. */
-
-static void
-flow_loop_entry_edges_find (struct loop *loop)
-{
- edge e;
- int num_entries;
-
- num_entries = 0;
- for (e = loop->header->pred; e; e = e->pred_next)
- {
- if (flow_loop_outside_edge_p (loop, e))
- num_entries++;
- }
-
- if (! num_entries)
- abort ();
-
- loop->entry_edges = xmalloc (num_entries * sizeof (edge *));
-
- num_entries = 0;
- for (e = loop->header->pred; e; e = e->pred_next)
- {
- if (flow_loop_outside_edge_p (loop, e))
- loop->entry_edges[num_entries++] = e;
- }
-
- loop->num_entries = num_entries;
-}
-
-/* Find the exit edges from the LOOP. */
-
-static void
-flow_loop_exit_edges_find (struct loop *loop)
-{
- edge e;
- basic_block node, *bbs;
- unsigned num_exits, i;
-
- loop->exit_edges = NULL;
- loop->num_exits = 0;
-
- /* Check all nodes within the loop to see if there are any
- successors not in the loop. Note that a node may have multiple
- exiting edges. */
- num_exits = 0;
- bbs = get_loop_body (loop);
- for (i = 0; i < loop->num_nodes; i++)
- {
- node = bbs[i];
- for (e = node->succ; e; e = e->succ_next)
- {
- basic_block dest = e->dest;
-
- if (!flow_bb_inside_loop_p (loop, dest))
- num_exits++;
- }
- }
-
- if (! num_exits)
- {
- free (bbs);
- return;
- }
-
- loop->exit_edges = xmalloc (num_exits * sizeof (edge *));
-
- /* Store all exiting edges into an array. */
- num_exits = 0;
- for (i = 0; i < loop->num_nodes; i++)
- {
- node = bbs[i];
- for (e = node->succ; e; e = e->succ_next)
- {
- basic_block dest = e->dest;
-
- if (!flow_bb_inside_loop_p (loop, dest))
- loop->exit_edges[num_exits++] = e;
- }
- }
- free (bbs);
- loop->num_exits = num_exits;
-}
-