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
This commit is contained in:
Michael Matz 2003-03-10 12:59:12 +00:00 committed by Michael Matz
parent ac228d4e57
commit e0fd3e7af4
4 changed files with 40 additions and 14 deletions

View File

@ -1,3 +1,10 @@
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>
* fpa.md: New file. Move all patterns relating to FPA co-processor

View File

@ -345,6 +345,8 @@ extern void remove_fake_edges PARAMS ((void));
extern void add_noreturn_fake_exit_edges PARAMS ((void));
extern void connect_infinite_loops_to_exit PARAMS ((void));
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,
basic_block, int));
extern edge make_edge PARAMS ((basic_block,

View File

@ -280,6 +280,32 @@ expunge_block (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
edge cache CACHE. Return the new edge, NULL if already exist. */
@ -320,19 +346,7 @@ cached_make_edge (edge_cache, src, dst, flags)
break;
}
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;
e = unchecked_make_edge (src, dst, flags);
if (use_edge_cache)
SET_BIT (edge_cache[src->index], dst->index);

View File

@ -980,7 +980,10 @@ cfg_layout_duplicate_bb (bb, e)
new_bb->flags = bb->flags;
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;
if (new_count)
/* Take care for overflows! */