* 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
+2004-07-16 Richard Henderson <rth@redhat.com>
+
+ * 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.
+
2004-07-16 Richard Henderson <rth@redhat.com>
* tree-ssa-operands.c (get_expr_operands): Fix 2004-07-15
extern void commit_edge_insertions_watch_calls (void);
extern void remove_fake_edges (void);
+extern void remove_fake_exit_edges (void);
extern void add_noreturn_fake_exit_edges (void);
extern void connect_infinite_loops_to_exit (void);
extern edge unchecked_make_edge (basic_block, basic_block, int);
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);
\f
/* Like active_insn_p, except keep the return value clobber around
}
\f
-/* 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);
}
{
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. */
}
if (mode & CLEANUP_CROSSJUMP)
- remove_fake_edges ();
+ remove_fake_exit_edges ();
clear_aux_for_blocks ();
}
free_ldst_mems ();
- remove_fake_edges ();
+ remove_fake_exit_edges ();
free_hash_table (&expr_hash_table);
if (gcse_file)
free_store_memory ();
free_edge_list (edge_list);
- remove_fake_edges ();
+ remove_fake_exit_edges ();
end_alias_analysis ();
}
&& bb->succ->succ_next != NULL)
combine_predictions_for_insn (BB_END (bb), bb);
- remove_fake_edges ();
+ remove_fake_exit_edges ();
/* Fill in the probability values in flowgraph based on the REG_BR_PROB
notes. */
FOR_EACH_BB (bb)
estimate_bb_frequencies (&loops_info);
free_dominance_info (CDI_POST_DOMINATORS);
- remove_fake_edges ();
+ remove_fake_exit_edges ();
flow_loops_free (&loops_info);
if (dump_file && (dump_flags & TDF_DETAILS))
dump_tree_cfg (dump_file, dump_flags);
free_dominance_info (CDI_DOMINATORS);
free (heads);
- remove_fake_edges ();
+ remove_fake_exit_edges ();
}
\f
/* This is used to carry information about basic blocks. It is
int num_edges = NUM_EDGES (el);
basic_block bb;
- remove_fake_edges ();
-
FOR_BB_BETWEEN (bb, ENTRY_BLOCK_PTR, NULL, next_bb)
{
edge e;
compute_value_histograms (n_values, values);
}
+ remove_fake_edges ();
+
/* For each edge not on the spanning tree, add counting code. */
if (profile_arc_flag
&& coverage_counter_alloc (GCOV_COUNTER_ARCS, num_instrumented))
}
}
- remove_fake_edges ();
free_aux_for_edges ();
if (!ir_type ())
/* We do not care about fake edges, so remove any that the CFG
builder inserted for completeness. */
- remove_fake_edges ();
+ remove_fake_exit_edges ();
/* Clean up the graph and warn for unreachable code. */
cleanup_tree_cfg ();
free_alloc_pool (reference_node_pool);
free_alloc_pool (unary_node_pool);
htab_delete (phi_translate_table);
- remove_fake_edges ();
+ remove_fake_exit_edges ();
FOR_ALL_BB (bb)
{
free (bb->aux);
bb->aux = NULL;
}
+
free_dominance_info (CDI_POST_DOMINATORS);
vn_delete ();
}