Commit 5e91f7a3 by Kazu Hirata Committed by Kazu Hirata

cfgbuild.c (state, [...]): Move just before make_edges.

	* cfgbuild.c (state, STATE, SET_STATE,
	BLOCK_USED_BY_TABLEJUMP, FULL_STATE): Move just before
	make_edges.
	(make_edges): Speed up by skipping blocks with BLOCK_ORIGINAL.
	(find_basic_blocks): Set the state of each basic block to
	BLOCK_NEW.

From-SVN: r96193
parent 974b30f0
......@@ -34,6 +34,13 @@
* tree-ssa-loop-im.c (lhs): Remove.
* cfgbuild.c (state, STATE, SET_STATE,
BLOCK_USED_BY_TABLEJUMP, FULL_STATE): Move just before
make_edges.
(make_edges): Speed up by skipping blocks with BLOCK_ORIGINAL.
(find_basic_blocks): Set the state of each basic block to
BLOCK_NEW.
2005-03-08 Jeff Law <law@redhat.com>
* tree-cfg.c (cleanup_control_flow): If removal of a computed
......
......@@ -211,6 +211,16 @@ rtl_make_eh_edge (sbitmap *edge_cache, basic_block src, rtx insn)
free_INSN_LIST_list (&handlers);
}
/* State of basic block as seen by find_many_sub_basic_blocks. */
enum state {BLOCK_NEW = 0, BLOCK_ORIGINAL, BLOCK_TO_SPLIT};
#define STATE(BB) (enum state) ((size_t) (BB)->aux)
#define SET_STATE(BB, STATE) ((BB)->aux = (void *) (size_t) (STATE))
/* Used internally by purge_dead_tablejump_edges, ORed into state. */
#define BLOCK_USED_BY_TABLEJUMP 32
#define FULL_STATE(BB) ((size_t) (BB)->aux)
/* Identify the edges between basic blocks MIN to MAX.
NONLOCAL_LABEL_LIST is a list of non-local labels in the function. Blocks
......@@ -234,15 +244,18 @@ make_edges (basic_block min, basic_block max, int update_p)
sbitmap_vector_zero (edge_cache, last_basic_block);
if (update_p)
FOR_BB_BETWEEN (bb, min, max->next_bb, next_bb)
{
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);
}
{
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);
}
}
}
/* By nature of the way these get numbered, ENTRY_BLOCK_PTR->next_bb block
......@@ -257,6 +270,9 @@ make_edges (basic_block min, basic_block max, int update_p)
enum rtx_code code;
edge e;
if (STATE (bb) == BLOCK_ORIGINAL)
continue;
if (LABEL_P (BB_HEAD (bb))
&& LABEL_ALT_ENTRY_P (BB_HEAD (bb)))
cached_make_edge (NULL, ENTRY_BLOCK_PTR, bb, 0);
......@@ -522,6 +538,9 @@ find_basic_blocks (rtx f)
profile_status = PROFILE_ABSENT;
FOR_EACH_BB (bb)
SET_STATE (bb, BLOCK_NEW);
/* Discover the edges of our cfg. */
make_edges (ENTRY_BLOCK_PTR->next_bb, EXIT_BLOCK_PTR->prev_bb, 0);
......@@ -535,16 +554,6 @@ find_basic_blocks (rtx f)
timevar_pop (TV_CFG);
}
/* State of basic block as seen by find_many_sub_basic_blocks. */
enum state {BLOCK_NEW = 0, BLOCK_ORIGINAL, BLOCK_TO_SPLIT};
#define STATE(BB) (enum state) ((size_t) (BB)->aux)
#define SET_STATE(BB, STATE) ((BB)->aux = (void *) (size_t) (STATE))
/* Used internally by purge_dead_tablejump_edges, ORed into state. */
#define BLOCK_USED_BY_TABLEJUMP 32
#define FULL_STATE(BB) ((size_t) (BB)->aux)
static void
mark_tablejump_edge (rtx label)
{
......
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