summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/ChangeLog15
-rw-r--r--gcc/basic-block.h3
-rw-r--r--gcc/cfghooks.c4
-rw-r--r--gcc/dominance.c22
-rw-r--r--gcc/tree-cfg.c5
-rw-r--r--gcc/tree-complex.c2
-rw-r--r--gcc/tree-mudflap.c2
7 files changed, 35 insertions, 18 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 2ddfb50cad3..ae3a92a3788 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,20 @@
2004-10-16 Zdenek Dvorak <dvorakz@suse.cz>
+ PR tree-optimization/17766
+ * basic-block.h (enum dom_state): DOM_CONS_OK removed.
+ (dom_info_available_p): Declare.
+ * cfghooks.c (split_block, make_forwarder_block): Use
+ dom_info_available_p.
+ * dominance.c (compute_dom_fast_query, calculate_dominance_info,
+ free_dominance_info, verify_dominators): Ditto.
+ (dom_info_available_p): New function.
+ * tree-cfg.c (cleanup_control_expr_graph): Free dominance information.
+ (thread_jumps): Use dom_info_available_p.
+ * tree-complex.c (expand_complex_div_wide): Ditto.
+ * tree-mudflap.c (mf_build_check_statement_for): Ditto.
+
+2004-10-16 Zdenek Dvorak <dvorakz@suse.cz>
+
* tree-ssa-loop-ivopts.c (struct ivopts_data): New field important_candidates.
(find_best_candidate): Take also important candidates into account.
(find_optimal_iv_set): Initialize important_candidates bitmap.
diff --git a/gcc/basic-block.h b/gcc/basic-block.h
index ed03ac95cbb..534fd10364e 100644
--- a/gcc/basic-block.h
+++ b/gcc/basic-block.h
@@ -848,14 +848,13 @@ enum cdi_direction
enum dom_state
{
DOM_NONE, /* Not computed at all. */
- DOM_CONS_OK, /* The data is conservatively OK, i.e. if it says you that A dominates B,
- it indeed does. */
DOM_NO_FAST_QUERY, /* The data is OK, but the fast query data are not usable. */
DOM_OK /* Everything is ok. */
};
extern enum dom_state dom_computed[2];
+extern bool dom_info_available_p (enum cdi_direction);
extern void calculate_dominance_info (enum cdi_direction);
extern void free_dominance_info (enum cdi_direction);
extern basic_block nearest_common_dominator (enum cdi_direction,
diff --git a/gcc/cfghooks.c b/gcc/cfghooks.c
index 948c2b4c13d..46e0f8c67ea 100644
--- a/gcc/cfghooks.c
+++ b/gcc/cfghooks.c
@@ -318,7 +318,7 @@ split_block (basic_block bb, void *i)
new_bb->frequency = bb->frequency;
new_bb->loop_depth = bb->loop_depth;
- if (dom_computed[CDI_DOMINATORS] >= DOM_CONS_OK)
+ if (dom_info_available_p (CDI_DOMINATORS))
{
redirect_immediate_dominators (CDI_DOMINATORS, bb, new_bb);
set_immediate_dominator (CDI_DOMINATORS, new_bb, bb);
@@ -592,7 +592,7 @@ make_forwarder_block (basic_block bb, bool (*redirect_edge_p) (edge),
new_bb_cbk (jump);
}
- if (dom_computed[CDI_DOMINATORS] >= DOM_CONS_OK)
+ if (dom_info_available_p (CDI_DOMINATORS))
{
basic_block doms_to_fix[2];
diff --git a/gcc/dominance.c b/gcc/dominance.c
index 680c4561c9d..47cb4057e65 100644
--- a/gcc/dominance.c
+++ b/gcc/dominance.c
@@ -592,7 +592,7 @@ compute_dom_fast_query (enum cdi_direction dir)
int num = 0;
basic_block bb;
- gcc_assert (dom_computed[dir] >= DOM_NO_FAST_QUERY);
+ gcc_assert (dom_info_available_p (dir));
if (dom_computed[dir] == DOM_OK)
return;
@@ -618,11 +618,8 @@ calculate_dominance_info (enum cdi_direction dir)
if (dom_computed[dir] == DOM_OK)
return;
- if (dom_computed[dir] != DOM_NO_FAST_QUERY)
+ if (!dom_info_available_p (dir))
{
- if (dom_computed[dir] != DOM_NONE)
- free_dominance_info (dir);
-
gcc_assert (!n_bbs_in_dom_tree[dir]);
FOR_ALL_BB (b)
@@ -656,7 +653,7 @@ free_dominance_info (enum cdi_direction dir)
{
basic_block bb;
- if (!dom_computed[dir])
+ if (!dom_info_available_p (dir))
return;
FOR_ALL_BB (bb)
@@ -821,7 +818,7 @@ verify_dominators (enum cdi_direction dir)
int err = 0;
basic_block bb;
- gcc_assert (dom_computed[dir]);
+ gcc_assert (dom_info_available_p (dir));
FOR_EACH_BB (bb)
{
@@ -841,8 +838,7 @@ verify_dominators (enum cdi_direction dir)
}
}
- if (dir == CDI_DOMINATORS
- && dom_computed[dir] >= DOM_NO_FAST_QUERY)
+ if (dir == CDI_DOMINATORS)
{
FOR_EACH_BB (bb)
{
@@ -977,6 +973,14 @@ next_dom_son (enum cdi_direction dir, basic_block bb)
return next->father->son == next ? NULL : next->data;
}
+/* Returns true if dominance information for direction DIR is available. */
+
+bool
+dom_info_available_p (enum cdi_direction dir)
+{
+ return dom_computed[dir] != DOM_NONE;
+}
+
void
debug_dominance_info (enum cdi_direction dir)
{
diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c
index 293b24e1957..7874000a1d5 100644
--- a/gcc/tree-cfg.c
+++ b/gcc/tree-cfg.c
@@ -1927,8 +1927,7 @@ cleanup_control_expr_graph (basic_block bb, block_stmt_iterator bsi)
taken_edge->flags = EDGE_FALLTHRU;
/* We removed some paths from the cfg. */
- if (dom_computed[CDI_DOMINATORS] >= DOM_CONS_OK)
- dom_computed[CDI_DOMINATORS] = DOM_CONS_OK;
+ free_dominance_info (CDI_DOMINATORS);
return retval;
}
@@ -3908,7 +3907,7 @@ thread_jumps (void)
}
/* Update the dominators. */
- if (dom_computed[CDI_DOMINATORS] >= DOM_CONS_OK)
+ if (dom_info_available_p (CDI_DOMINATORS))
{
/* If the dominator of the destination was in the path, set its
dominator to the start of the redirected edge. */
diff --git a/gcc/tree-complex.c b/gcc/tree-complex.c
index 5a4fdf5a668..1b49601d094 100644
--- a/gcc/tree-complex.c
+++ b/gcc/tree-complex.c
@@ -216,7 +216,7 @@ expand_complex_div_wide (block_stmt_iterator *bsi, tree inner_type,
/* Update dominance info. Note that bb_join's data was
updated by split_block. */
- if (dom_computed[CDI_DOMINATORS] >= DOM_CONS_OK)
+ if (dom_info_available_p (CDI_DOMINATORS))
{
set_immediate_dominator (CDI_DOMINATORS, bb_true, bb_cond);
set_immediate_dominator (CDI_DOMINATORS, bb_false, bb_cond);
diff --git a/gcc/tree-mudflap.c b/gcc/tree-mudflap.c
index f4d3d47bdd4..a65d393649b 100644
--- a/gcc/tree-mudflap.c
+++ b/gcc/tree-mudflap.c
@@ -551,7 +551,7 @@ mf_build_check_statement_for (tree base, tree addr, tree limit,
/* Update dominance info. Note that bb_join's data was
updated by split_block. */
- if (dom_computed[CDI_DOMINATORS] >= DOM_CONS_OK)
+ if (dom_info_available_p (CDI_DOMINATORS))
{
set_immediate_dominator (CDI_DOMINATORS, then_bb, cond_bb);
set_immediate_dominator (CDI_DOMINATORS, join_bb, cond_bb);