Commit e0fd3e7a by Michael Matz Committed by Michael Matz

cfg.c (unchecked_make_edge): New.

        * cfg.c (unchecked_make_edge): New.
        (cached_make_edge): Use it.
        * basic-block.h (unchecked_make_edge): Declare.
        * cfglayout.c (cfg_layout_duplicate_bb): Use it.

From-SVN: r64077
parent ac228d4e
2003-03-10 Michael Matz <matz@suse.de>
* cfg.c (unchecked_make_edge): New.
(cached_make_edge): Use it.
* basic-block.h (unchecked_make_edge): Declare.
* cfglayout.c (cfg_layout_duplicate_bb): Use it.
2003-03-10 Richard Earnshaw <rearnsha@arm.com> 2003-03-10 Richard Earnshaw <rearnsha@arm.com>
* fpa.md: New file. Move all patterns relating to FPA co-processor * fpa.md: New file. Move all patterns relating to FPA co-processor
......
...@@ -345,6 +345,8 @@ extern void remove_fake_edges PARAMS ((void)); ...@@ -345,6 +345,8 @@ extern void remove_fake_edges PARAMS ((void));
extern void add_noreturn_fake_exit_edges PARAMS ((void)); extern void add_noreturn_fake_exit_edges PARAMS ((void));
extern void connect_infinite_loops_to_exit PARAMS ((void)); extern void connect_infinite_loops_to_exit PARAMS ((void));
extern int flow_call_edges_add PARAMS ((sbitmap)); extern int flow_call_edges_add PARAMS ((sbitmap));
extern edge unchecked_make_edge PARAMS ((basic_block,
basic_block, int));
extern edge cached_make_edge PARAMS ((sbitmap *, basic_block, extern edge cached_make_edge PARAMS ((sbitmap *, basic_block,
basic_block, int)); basic_block, int));
extern edge make_edge PARAMS ((basic_block, extern edge make_edge PARAMS ((basic_block,
......
...@@ -280,6 +280,32 @@ expunge_block (b) ...@@ -280,6 +280,32 @@ expunge_block (b)
pool_free (bb_pool, b); pool_free (bb_pool, b);
} }
/* Create an edge connecting SRC and DEST with flags FLAGS. Return newly
created edge. Use this only if you are sure that this edge can't
possibly already exist. */
edge
unchecked_make_edge (src, dst, flags)
basic_block src, dst;
int flags;
{
edge e;
e = pool_alloc (edge_pool);
memset (e, 0, sizeof (*e));
n_edges++;
e->succ_next = src->succ;
e->pred_next = dst->pred;
e->src = src;
e->dest = dst;
e->flags = flags;
src->succ = e;
dst->pred = e;
return e;
}
/* Create an edge connecting SRC and DST with FLAGS optionally using /* Create an edge connecting SRC and DST with FLAGS optionally using
edge cache CACHE. Return the new edge, NULL if already exist. */ edge cache CACHE. Return the new edge, NULL if already exist. */
...@@ -320,19 +346,7 @@ cached_make_edge (edge_cache, src, dst, flags) ...@@ -320,19 +346,7 @@ cached_make_edge (edge_cache, src, dst, flags)
break; break;
} }
e = unchecked_make_edge (src, dst, flags);
e = pool_alloc (edge_pool);
memset (e, 0, sizeof (*e));
n_edges++;
e->succ_next = src->succ;
e->pred_next = dst->pred;
e->src = src;
e->dest = dst;
e->flags = flags;
src->succ = e;
dst->pred = e;
if (use_edge_cache) if (use_edge_cache)
SET_BIT (edge_cache[src->index], dst->index); SET_BIT (edge_cache[src->index], dst->index);
......
...@@ -980,7 +980,10 @@ cfg_layout_duplicate_bb (bb, e) ...@@ -980,7 +980,10 @@ cfg_layout_duplicate_bb (bb, e)
new_bb->flags = bb->flags; new_bb->flags = bb->flags;
for (s = bb->succ; s; s = s->succ_next) for (s = bb->succ; s; s = s->succ_next)
{ {
n = make_edge (new_bb, s->dest, s->flags); /* Since we are creating edges from a new block to successors
of another block (which therefore are known to be disjoint), there
is no need to actually check for duplicated edges. */
n = unchecked_make_edge (new_bb, s->dest, s->flags);
n->probability = s->probability; n->probability = s->probability;
if (new_count) if (new_count)
/* Take care for overflows! */ /* Take care for overflows! */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment