basic-block.h: Update the prototypes of cached_make_edge and rtl_make_eh_edge.

* basic-block.h: Update the prototypes of cached_make_edge and
	rtl_make_eh_edge.
	* cfg.c (cached_make_edge): Take edge_cache representing one
	row of the adjacency matrix of edges.
	* cfgbuild.c (make_label_edge, rtl_make_eh_edge): Likewise.
	(make_edges): Initialize edge_cache to represent one row of
	the adjacency matrix of edges.

From-SVN: r96440
This commit is contained in:
Kazu Hirata 2005-03-14 17:43:01 +00:00 committed by Kazu Hirata
parent 8eaa0f34a3
commit a6ee1a1532
4 changed files with 34 additions and 29 deletions

View File

@ -1,3 +1,13 @@
2005-03-14 Kazu Hirata <kazu@cs.umass.edu>
* basic-block.h: Update the prototypes of cached_make_edge and
rtl_make_eh_edge.
* cfg.c (cached_make_edge): Take edge_cache representing one
row of the adjacency matrix of edges.
* cfgbuild.c (make_label_edge, rtl_make_eh_edge): Likewise.
(make_edges): Initialize edge_cache to represent one row of
the adjacency matrix of edges.
2005-03-14 Zdenek Dvorak <dvorakz@suse.cz>
* tree-ssa-phiopt.c (minmax_replacement, blocks_in_phiopt_order):

View File

@ -449,7 +449,7 @@ extern void remove_fake_exit_edges (void);
extern void add_noreturn_fake_exit_edges (void);
extern void connect_infinite_loops_to_exit (void);
extern edge unchecked_make_edge (basic_block, basic_block, int);
extern edge cached_make_edge (sbitmap *, basic_block, basic_block, int);
extern edge cached_make_edge (sbitmap, basic_block, basic_block, int);
extern edge make_edge (basic_block, basic_block, int);
extern edge make_single_succ_edge (basic_block, basic_block, int);
extern void remove_edge (edge);
@ -817,7 +817,7 @@ extern bool forwarder_block_p (basic_block);
extern bool purge_all_dead_edges (int);
extern bool purge_dead_edges (basic_block);
extern void find_many_sub_basic_blocks (sbitmap);
extern void rtl_make_eh_edge (sbitmap *, basic_block, rtx);
extern void rtl_make_eh_edge (sbitmap, basic_block, rtx);
extern bool can_fallthru (basic_block, basic_block);
extern bool could_fall_through (basic_block, basic_block);
extern void flow_nodes_print (const char *, const sbitmap, FILE *);

View File

@ -327,7 +327,7 @@ unchecked_make_edge (basic_block src, basic_block dst, int flags)
edge cache CACHE. Return the new edge, NULL if already exist. */
edge
cached_make_edge (sbitmap *edge_cache, basic_block src, basic_block dst, int flags)
cached_make_edge (sbitmap edge_cache, basic_block src, basic_block dst, int flags)
{
if (edge_cache == NULL
|| src == ENTRY_BLOCK_PTR
@ -335,11 +335,11 @@ cached_make_edge (sbitmap *edge_cache, basic_block src, basic_block dst, int fla
return make_edge (src, dst, flags);
/* Does the requested edge already exist? */
if (! TEST_BIT (edge_cache[src->index], dst->index))
if (! TEST_BIT (edge_cache, dst->index))
{
/* The edge does not exist. Create one and update the
cache. */
SET_BIT (edge_cache[src->index], dst->index);
SET_BIT (edge_cache, dst->index);
return unchecked_make_edge (src, dst, flags);
}

View File

@ -49,7 +49,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
static int count_basic_blocks (rtx);
static void find_basic_blocks_1 (rtx);
static void make_edges (basic_block, basic_block, int);
static void make_label_edge (sbitmap *, basic_block, rtx, int);
static void make_label_edge (sbitmap, basic_block, rtx, int);
static void find_bb_boundaries (basic_block);
static void compute_outgoing_frequencies (basic_block);
@ -179,7 +179,7 @@ count_basic_blocks (rtx f)
/* Create an edge from a basic block to a label. */
static void
make_label_edge (sbitmap *edge_cache, basic_block src, rtx label, int flags)
make_label_edge (sbitmap edge_cache, basic_block src, rtx label, int flags)
{
gcc_assert (LABEL_P (label));
@ -197,7 +197,7 @@ make_label_edge (sbitmap *edge_cache, basic_block src, rtx label, int flags)
/* Create the edges generated by INSN in REGION. */
void
rtl_make_eh_edge (sbitmap *edge_cache, basic_block src, rtx insn)
rtl_make_eh_edge (sbitmap edge_cache, basic_block src, rtx insn)
{
int is_call = CALL_P (insn) ? EDGE_ABNORMAL_CALL : 0;
rtx handlers, i;
@ -233,46 +233,41 @@ static void
make_edges (basic_block min, basic_block max, int update_p)
{
basic_block bb;
sbitmap *edge_cache = NULL;
sbitmap edge_cache = NULL;
/* Heavy use of computed goto in machine-generated code can lead to
nearly fully-connected CFGs. In that case we spend a significant
amount of time searching the edge lists for duplicates. */
if (forced_labels || cfun->max_jumptable_ents > 100)
{
edge_cache = sbitmap_vector_alloc (last_basic_block, last_basic_block);
sbitmap_vector_zero (edge_cache, last_basic_block);
if (update_p)
{
FOR_BB_BETWEEN (bb, min, max->next_bb, next_bb)
if (STATE (bb) != BLOCK_ORIGINAL)
{
edge e;
edge_iterator ei;
FOR_EACH_EDGE (e, ei, bb->succs)
if (e->dest != EXIT_BLOCK_PTR)
SET_BIT (edge_cache[bb->index], e->dest->index);
}
}
}
edge_cache = sbitmap_alloc (last_basic_block);
/* By nature of the way these get numbered, ENTRY_BLOCK_PTR->next_bb block
is always the entry. */
if (min == ENTRY_BLOCK_PTR->next_bb)
cached_make_edge (edge_cache, ENTRY_BLOCK_PTR, min,
EDGE_FALLTHRU);
make_edge (ENTRY_BLOCK_PTR, min, EDGE_FALLTHRU);
FOR_BB_BETWEEN (bb, min, max->next_bb, next_bb)
{
rtx insn, x;
enum rtx_code code;
edge e;
edge_iterator ei;
if (STATE (bb) == BLOCK_ORIGINAL)
continue;
/* If we have an edge cache, cache edges going out of BB. */
if (edge_cache)
{
sbitmap_zero (edge_cache);
if (update_p)
{
FOR_EACH_EDGE (e, ei, bb->succs)
if (e->dest != EXIT_BLOCK_PTR)
SET_BIT (edge_cache, e->dest->index);
}
}
if (LABEL_P (BB_HEAD (bb))
&& LABEL_ALT_ENTRY_P (BB_HEAD (bb)))
cached_make_edge (NULL, ENTRY_BLOCK_PTR, bb, 0);