diff options
author | Richard Henderson <rth@redhat.com> | 2004-07-16 15:28:29 -0700 |
---|---|---|
committer | Richard Henderson <rth@gcc.gnu.org> | 2004-07-16 15:28:29 -0700 |
commit | 6809cbf90dffd5a6fccf96d67c5f520e1a162eb6 (patch) | |
tree | 6ad911f298df01a4dbc580f0c53b37b1d2a4a63f /gcc/cfganal.c | |
parent | 7b48e1e0f0ea539efeca2a5be7f8fc93714d41bd (diff) | |
download | gcc-6809cbf90dffd5a6fccf96d67c5f520e1a162eb6.zip gcc-6809cbf90dffd5a6fccf96d67c5f520e1a162eb6.tar.gz gcc-6809cbf90dffd5a6fccf96d67c5f520e1a162eb6.tar.bz2 |
basic-block.h (remove_fake_exit_edges): Declare.
* basic-block.h (remove_fake_exit_edges): Declare.
* cfganal.c (remove_fake_predecessors): Rename from
remove_fake_successors; iterate over predecessors.
(remove_fake_exit_edges): New.
* cfgcleanup.c (try_optimize_cfg): Use it.
* gcse.c (one_pre_gcse_pass, store_motion): Likewise.
* predict.c (estimate_probability): Likewise.
(tree_estimate_probability, note_prediction_to_br_prob): Likewise.
* tree-cfg.c (make_edges): Likewise.
* tree-ssa-pre.c (fini_pre): Likewise.
* profile.c (instrument_edges): Don't remove_fake_edges.
(branch_prob): Do it earlier here.
From-SVN: r84840
Diffstat (limited to 'gcc/cfganal.c')
-rw-r--r-- | gcc/cfganal.c | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/gcc/cfganal.c b/gcc/cfganal.c index 0bfccae..db0238c 100644 --- a/gcc/cfganal.c +++ b/gcc/cfganal.c @@ -51,7 +51,6 @@ static void flow_dfs_compute_reverse_add_bb (depth_first_search_ds, basic_block); static basic_block flow_dfs_compute_reverse_execute (depth_first_search_ds); static void flow_dfs_compute_reverse_finish (depth_first_search_ds); -static void remove_fake_successors (basic_block); static bool flow_active_insn_p (rtx); /* Like active_insn_p, except keep the return value clobber around @@ -529,20 +528,20 @@ flow_edge_list_print (const char *str, const edge *edge_list, int num_edges, FIL } -/* This routine will remove any fake successor edges for a basic block. - When the edge is removed, it is also removed from whatever predecessor +/* This routine will remove any fake predecessor edges for a basic block. + When the edge is removed, it is also removed from whatever successor list it is in. */ static void -remove_fake_successors (basic_block bb) +remove_fake_predecessors (basic_block bb) { edge e; - for (e = bb->succ; e;) + for (e = bb->pred; e;) { edge tmp = e; - e = e->succ_next; + e = e->pred_next; if ((tmp->flags & EDGE_FAKE) == EDGE_FAKE) remove_edge (tmp); } @@ -557,10 +556,19 @@ remove_fake_edges (void) { basic_block bb; - FOR_BB_BETWEEN (bb, ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR, next_bb) - remove_fake_successors (bb); + FOR_BB_BETWEEN (bb, ENTRY_BLOCK_PTR->next_bb, NULL, next_bb) + remove_fake_predecessors (bb); } +/* This routine will remove all fake edges to the EXIT_BLOCK. */ + +void +remove_fake_exit_edges (void) +{ + remove_fake_predecessors (EXIT_BLOCK_PTR); +} + + /* This function will add a fake edge between any block which has no successors, and the exit block. Some data flow equations require these edges to exist. */ |