diff options
author | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-07-16 22:28:29 +0000 |
---|---|---|
committer | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-07-16 22:28:29 +0000 |
commit | 41d24834b5784dbbb08553f36eaa80386fc75d0a (patch) | |
tree | 6ad911f298df01a4dbc580f0c53b37b1d2a4a63f /gcc/cfganal.c | |
parent | f9c6943bb1d4e5d0333f2d519ecf678898502570 (diff) | |
download | gcc-41d24834b5784dbbb08553f36eaa80386fc75d0a.tar.gz |
* 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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@84840 138bc75d-0d04-0410-961f-82ee72b054a4
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 0bfccae79ec..db0238c68eb 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. */ |