Commit 648b5f85 by Richard Guenther Committed by Richard Biener

tree-ssa-structalias.c (changed_count): Remove.

2011-04-27  Richard Guenther  <rguenther@suse.de>

	* tree-ssa-structalias.c (changed_count): Remove.
	(changed): Use a bitmap.
	(unify_nodes): Adjust.
	(do_sd_constraint): Likewise.
	(do_ds_constraint): Likewise.
	(do_complex_constraint): Likewise.
	(solve_graph): Likewise.

From-SVN: r173040
parent 4d5dcfb2
2011-04-27 Richard Guenther <rguenther@suse.de>
* tree-ssa-structalias.c (changed_count): Remove.
(changed): Use a bitmap.
(unify_nodes): Adjust.
(do_sd_constraint): Likewise.
(do_ds_constraint): Likewise.
(do_complex_constraint): Likewise.
(solve_graph): Likewise.
2011-04-27 Jan Hubicka <jh@suse.cz> 2011-04-27 Jan Hubicka <jh@suse.cz>
* cgraphunit.c (cgraph_process_new_functions): Fix ordering issue. * cgraphunit.c (cgraph_process_new_functions): Fix ordering issue.
......
...@@ -1360,8 +1360,7 @@ build_succ_graph (void) ...@@ -1360,8 +1360,7 @@ build_succ_graph (void)
/* Changed variables on the last iteration. */ /* Changed variables on the last iteration. */
static unsigned int changed_count; static bitmap changed;
static sbitmap changed;
/* Strongly Connected Component visitation info. */ /* Strongly Connected Component visitation info. */
...@@ -1492,16 +1491,11 @@ unify_nodes (constraint_graph_t graph, unsigned int to, unsigned int from, ...@@ -1492,16 +1491,11 @@ unify_nodes (constraint_graph_t graph, unsigned int to, unsigned int from,
/* Mark TO as changed if FROM was changed. If TO was already marked /* Mark TO as changed if FROM was changed. If TO was already marked
as changed, decrease the changed count. */ as changed, decrease the changed count. */
if (update_changed && TEST_BIT (changed, from)) if (update_changed
&& bitmap_bit_p (changed, from))
{ {
RESET_BIT (changed, from); bitmap_clear_bit (changed, from);
if (!TEST_BIT (changed, to)) bitmap_set_bit (changed, to);
SET_BIT (changed, to);
else
{
gcc_assert (changed_count > 0);
changed_count--;
}
} }
if (get_varinfo (from)->solution) if (get_varinfo (from)->solution)
{ {
...@@ -1510,11 +1504,8 @@ unify_nodes (constraint_graph_t graph, unsigned int to, unsigned int from, ...@@ -1510,11 +1504,8 @@ unify_nodes (constraint_graph_t graph, unsigned int to, unsigned int from,
if (bitmap_ior_into (get_varinfo (to)->solution, if (bitmap_ior_into (get_varinfo (to)->solution,
get_varinfo (from)->solution)) get_varinfo (from)->solution))
{ {
if (update_changed && !TEST_BIT (changed, to)) if (update_changed)
{ bitmap_set_bit (changed, to);
SET_BIT (changed, to);
changed_count++;
}
} }
BITMAP_FREE (get_varinfo (from)->solution); BITMAP_FREE (get_varinfo (from)->solution);
...@@ -1675,11 +1666,7 @@ done: ...@@ -1675,11 +1666,7 @@ done:
if (flag) if (flag)
{ {
get_varinfo (lhs)->solution = sol; get_varinfo (lhs)->solution = sol;
if (!TEST_BIT (changed, lhs)) bitmap_set_bit (changed, lhs);
{
SET_BIT (changed, lhs);
changed_count++;
}
} }
} }
...@@ -1713,13 +1700,7 @@ do_ds_constraint (constraint_t c, bitmap delta) ...@@ -1713,13 +1700,7 @@ do_ds_constraint (constraint_t c, bitmap delta)
if (add_graph_edge (graph, t, rhs)) if (add_graph_edge (graph, t, rhs))
{ {
if (bitmap_ior_into (get_varinfo (t)->solution, sol)) if (bitmap_ior_into (get_varinfo (t)->solution, sol))
{ bitmap_set_bit (changed, t);
if (!TEST_BIT (changed, t))
{
SET_BIT (changed, t);
changed_count++;
}
}
} }
return; return;
} }
...@@ -1759,12 +1740,8 @@ do_ds_constraint (constraint_t c, bitmap delta) ...@@ -1759,12 +1740,8 @@ do_ds_constraint (constraint_t c, bitmap delta)
{ {
t = find (escaped_id); t = find (escaped_id);
if (add_graph_edge (graph, t, rhs) if (add_graph_edge (graph, t, rhs)
&& bitmap_ior_into (get_varinfo (t)->solution, sol) && bitmap_ior_into (get_varinfo (t)->solution, sol))
&& !TEST_BIT (changed, t)) bitmap_set_bit (changed, t);
{
SET_BIT (changed, t);
changed_count++;
}
/* Enough to let rhs escape once. */ /* Enough to let rhs escape once. */
escaped_p = true; escaped_p = true;
} }
...@@ -1774,12 +1751,8 @@ do_ds_constraint (constraint_t c, bitmap delta) ...@@ -1774,12 +1751,8 @@ do_ds_constraint (constraint_t c, bitmap delta)
t = find (v->id); t = find (v->id);
if (add_graph_edge (graph, t, rhs) if (add_graph_edge (graph, t, rhs)
&& bitmap_ior_into (get_varinfo (t)->solution, sol) && bitmap_ior_into (get_varinfo (t)->solution, sol))
&& !TEST_BIT (changed, t)) bitmap_set_bit (changed, t);
{
SET_BIT (changed, t);
changed_count++;
}
} }
/* If the variable is not exactly at the requested offset /* If the variable is not exactly at the requested offset
...@@ -1834,11 +1807,7 @@ do_complex_constraint (constraint_graph_t graph, constraint_t c, bitmap delta) ...@@ -1834,11 +1807,7 @@ do_complex_constraint (constraint_graph_t graph, constraint_t c, bitmap delta)
if (flag) if (flag)
{ {
get_varinfo (c->lhs.var)->solution = tmp; get_varinfo (c->lhs.var)->solution = tmp;
if (!TEST_BIT (changed, c->lhs.var)) bitmap_set_bit (changed, c->lhs.var);
{
SET_BIT (changed, c->lhs.var);
changed_count++;
}
} }
} }
} }
...@@ -2531,9 +2500,7 @@ solve_graph (constraint_graph_t graph) ...@@ -2531,9 +2500,7 @@ solve_graph (constraint_graph_t graph)
unsigned int i; unsigned int i;
bitmap pts; bitmap pts;
changed_count = 0; changed = BITMAP_ALLOC (NULL);
changed = sbitmap_alloc (size);
sbitmap_zero (changed);
/* Mark all initial non-collapsed nodes as changed. */ /* Mark all initial non-collapsed nodes as changed. */
for (i = 0; i < size; i++) for (i = 0; i < size; i++)
...@@ -2542,16 +2509,13 @@ solve_graph (constraint_graph_t graph) ...@@ -2542,16 +2509,13 @@ solve_graph (constraint_graph_t graph)
if (find (i) == i && !bitmap_empty_p (ivi->solution) if (find (i) == i && !bitmap_empty_p (ivi->solution)
&& ((graph->succs[i] && !bitmap_empty_p (graph->succs[i])) && ((graph->succs[i] && !bitmap_empty_p (graph->succs[i]))
|| VEC_length (constraint_t, graph->complex[i]) > 0)) || VEC_length (constraint_t, graph->complex[i]) > 0))
{ bitmap_set_bit (changed, i);
SET_BIT (changed, i);
changed_count++;
}
} }
/* Allocate a bitmap to be used to store the changed bits. */ /* Allocate a bitmap to be used to store the changed bits. */
pts = BITMAP_ALLOC (&pta_obstack); pts = BITMAP_ALLOC (&pta_obstack);
while (changed_count > 0) while (!bitmap_empty_p (changed))
{ {
unsigned int i; unsigned int i;
struct topo_info *ti = init_topo_info (); struct topo_info *ti = init_topo_info ();
...@@ -2577,7 +2541,7 @@ solve_graph (constraint_graph_t graph) ...@@ -2577,7 +2541,7 @@ solve_graph (constraint_graph_t graph)
/* If the node has changed, we need to process the /* If the node has changed, we need to process the
complex constraints and outgoing edges again. */ complex constraints and outgoing edges again. */
if (TEST_BIT (changed, i)) if (bitmap_clear_bit (changed, i))
{ {
unsigned int j; unsigned int j;
constraint_t c; constraint_t c;
...@@ -2585,9 +2549,6 @@ solve_graph (constraint_graph_t graph) ...@@ -2585,9 +2549,6 @@ solve_graph (constraint_graph_t graph)
VEC(constraint_t,heap) *complex = graph->complex[i]; VEC(constraint_t,heap) *complex = graph->complex[i];
bool solution_empty; bool solution_empty;
RESET_BIT (changed, i);
changed_count--;
/* Compute the changed set of solution bits. */ /* Compute the changed set of solution bits. */
bitmap_and_compl (pts, get_varinfo (i)->solution, bitmap_and_compl (pts, get_varinfo (i)->solution,
get_varinfo (i)->oldsolution); get_varinfo (i)->oldsolution);
...@@ -2650,11 +2611,7 @@ solve_graph (constraint_graph_t graph) ...@@ -2650,11 +2611,7 @@ solve_graph (constraint_graph_t graph)
if (flag) if (flag)
{ {
get_varinfo (to)->solution = tmp; get_varinfo (to)->solution = tmp;
if (!TEST_BIT (changed, to)) bitmap_set_bit (changed, to);
{
SET_BIT (changed, to);
changed_count++;
}
} }
} }
} }
...@@ -2665,7 +2622,7 @@ solve_graph (constraint_graph_t graph) ...@@ -2665,7 +2622,7 @@ solve_graph (constraint_graph_t graph)
} }
BITMAP_FREE (pts); BITMAP_FREE (pts);
sbitmap_free (changed); BITMAP_FREE (changed);
bitmap_obstack_release (&oldpta_obstack); bitmap_obstack_release (&oldpta_obstack);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment