diff options
Diffstat (limited to 'gcc/cfgbuild.c')
-rw-r--r-- | gcc/cfgbuild.c | 43 |
1 files changed, 19 insertions, 24 deletions
diff --git a/gcc/cfgbuild.c b/gcc/cfgbuild.c index a4882e2..88a1045 100644 --- a/gcc/cfgbuild.c +++ b/gcc/cfgbuild.c @@ -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); |