diff options
author | Jan Hubicka <jh@suse.cz> | 2001-09-11 18:58:57 +0200 |
---|---|---|
committer | Jan Hubicka <hubicka@gcc.gnu.org> | 2001-09-11 16:58:57 +0000 |
commit | 4262e6231adab0ff8a3da565bf620037ce9b1343 (patch) | |
tree | e55ae3fa06b243cd5fe8bf5b133011184ac58d17 /gcc/bb-reorder.c | |
parent | 201556f0e005802b8ebb206a193a6feb55a555af (diff) | |
download | gcc-4262e6231adab0ff8a3da565bf620037ce9b1343.zip gcc-4262e6231adab0ff8a3da565bf620037ce9b1343.tar.gz gcc-4262e6231adab0ff8a3da565bf620037ce9b1343.tar.bz2 |
basic-block.h (EDGE_CRITICAL): Remove; renumber other flags.
* basic-block.h (EDGE_CRITICAL): Remove; renumber other flags.
(EDGE_CRITICAL_P): New predicate.
* cfg.c (force_nonfallthru_and_redirect, split_edge): Kill EDGE_CRITICAL
handling.
(insert_insn_on_edge): Use EDGE_CRITICAL_P.
(dump_edge_info): Remove "crit".
* cfganal.c (mark_critical_edges): Kill.
* cfgbuild.c (find_basic_blocks): Remove mark_critical_edges call.
* cfgcleanup.c (cleanup_cfg): Likewise.
* profile.c (instrument_edges): Use EDGE_CRITICAL_P.
(find_spanning_tree): Likewise.
* reg-stack.c (convert_regs_1): Likewise.
* ssa.c (mark_regs_equivalent_over_bad_edges): Likewise.
* basic-block.h (create_basic_block_structure): New.
(create_basic_block): Update prototype.
(force_nonfallthru): New.
* bb-reorder.c (fixup_reorder_chain): Fixup use force_nonfallthru.
* cfg.c (create_basic_block_structure): Rename from create_basic_block;
handle updating of block_for_insn, creating of empty BBs and BBs at
the end of INSN chain.
(create_basic_block): New function.
(split_block): Use create_basic_block.
(force_nonfallthru_and_redirect): Break out from ...; cleanup
(redirect_edge_and_branch_force): ... here.
(force_nonfallthru): New.
(split_edge): Rewrite to use force_nonfallthru and create_block.
* cfgbuild.c (find_basic_blocks_1): Use create_basic_block_structure.
(find_basic_blocks): Free basic_block_for_insn.
* cfgcleanup.c (merge_blocks): Use force_nonfallthru.
* cfg.c: Fix formating.
* cfgcleanup.c: Fix formating.
(merge_blocks, tail_recursion_label_p): Return bool.
(merge_blocks_move_predecessor_nojumps,
merge_blocks_move_successor_nojumps): Return void.
From-SVN: r45549
Diffstat (limited to 'gcc/bb-reorder.c')
-rw-r--r-- | gcc/bb-reorder.c | 60 |
1 files changed, 15 insertions, 45 deletions
diff --git a/gcc/bb-reorder.c b/gcc/bb-reorder.c index 96c3896..f51294b 100644 --- a/gcc/bb-reorder.c +++ b/gcc/bb-reorder.c @@ -610,7 +610,7 @@ fixup_reorder_chain () for (bb = BASIC_BLOCK (0); bb ; bb = RBI (bb)->next) { edge e_fall, e_taken, e; - rtx jump_insn, barrier_insn, bb_end_insn; + rtx bb_end_insn; basic_block nb; if (bb->succ == NULL) @@ -698,54 +698,24 @@ fixup_reorder_chain () /* An fallthru to exit block. */ if (!RBI (bb)->next && e_fall->dest == EXIT_BLOCK_PTR) continue; - - /* We need a new jump insn. If the block has only one outgoing - edge, then we can stuff the new jump insn in directly. */ - if (bb->succ->succ_next == NULL) - { - e_fall->flags &= ~EDGE_FALLTHRU; - - jump_insn = emit_jump_to_block_after (e_fall->dest, bb_end_insn); - bb->end = jump_insn; - barrier_insn = emit_barrier_after (jump_insn); - RBI (bb)->eff_end = barrier_insn; - continue; - } } - /* We got here if we need to add a new jump insn in a new block - across the edge e_fall. */ - - jump_insn = emit_jump_to_block_after (e_fall->dest, bb_end_insn); - barrier_insn = emit_barrier_after (jump_insn); + /* We got here if we need to add a new jump insn. */ - VARRAY_GROW (basic_block_info, ++n_basic_blocks); - create_basic_block (n_basic_blocks - 1, jump_insn, jump_insn, NULL); + nb = force_nonfallthru (e_fall); - nb = BASIC_BLOCK (n_basic_blocks - 1); - nb->local_set = 0; - nb->count = e_fall->count; - nb->frequency = EDGE_FREQUENCY (e_fall); - - nb->global_live_at_start = OBSTACK_ALLOC_REG_SET (&flow_obstack); - nb->global_live_at_end = OBSTACK_ALLOC_REG_SET (&flow_obstack); - COPY_REG_SET (nb->global_live_at_start, bb->global_live_at_start); - COPY_REG_SET (nb->global_live_at_end, bb->global_live_at_start); - - nb->aux = xmalloc (sizeof (struct reorder_block_def)); - RBI (nb)->eff_head = nb->head; - RBI (nb)->eff_end = barrier_insn; - RBI (nb)->scope = RBI (bb)->scope; - RBI (nb)->visited = 1; - RBI (nb)->next = RBI (bb)->next; - RBI (bb)->next = nb; - - /* Link to new block. */ - make_single_succ_edge (nb, e_fall->dest, 0); - redirect_edge_succ (e_fall, nb); - - /* Don't process this new block. */ - bb = nb; + if (nb) + { + nb->aux = xmalloc (sizeof (struct reorder_block_def)); + RBI (nb)->eff_head = nb->head; + RBI (nb)->eff_end = NEXT_INSN (nb->end); + RBI (nb)->scope = RBI (bb)->scope; + RBI (nb)->visited = 1; + RBI (nb)->next = RBI (bb)->next; + RBI (bb)->next = nb; + /* Don't process this new block. */ + bb = nb; + } } /* Put basic_block_info in the new order. */ |