Commit 0fc555fb by Jan Hubicka Committed by Jan Hubicka

tree-into-ssa.c (insert_phi_nodes): Use bitmap heads for dominance frontiers.


	* tree-into-ssa.c (insert_phi_nodes): Use bitmap heads
	for dominance frontiers.
	(rewrite_into_ssa): Update for bitmap heads in dominance
	frontiers.
	(insert_updated_phi_nodes_for): Likewise.
	(update_ssa): Likewise.
	* cfganal.c (compute_dominance_frontiers_1): Likewise.
	(compute_dominance_frontiers): Likewise.
	(compute_idf): Likewise.
	* df-problems.c (df_md_local_compute): Likewise.

From-SVN: r160327
parent 546a65d9
2010-06-05 Jan Hubicka <jh@suse.cz>
* tree-into-ssa.c (insert_phi_nodes): Use bitmap heads
for dominance frontiers.
(rewrite_into_ssa): Update for bitmap heads in dominance
frontiers.
(insert_updated_phi_nodes_for): Likewise.
(update_ssa): Likewise.
* cfganal.c (compute_dominance_frontiers_1): Likewise.
(compute_dominance_frontiers): Likewise.
(compute_idf): Likewise.
* df-problems.c (df_md_local_compute): Likewise.
2010-06-05 Anatoly Sokolov <aesok@post.ru> 2010-06-05 Anatoly Sokolov <aesok@post.ru>
* target.h (struct gcc_target): Add memory_move_cost field. * target.h (struct gcc_target): Add memory_move_cost field.
......
...@@ -443,8 +443,8 @@ extern int pre_and_rev_post_order_compute (int *, int *, bool); ...@@ -443,8 +443,8 @@ extern int pre_and_rev_post_order_compute (int *, int *, bool);
extern int dfs_enumerate_from (basic_block, int, extern int dfs_enumerate_from (basic_block, int,
bool (*)(const_basic_block, const void *), bool (*)(const_basic_block, const void *),
basic_block *, int, const void *); basic_block *, int, const void *);
extern void compute_dominance_frontiers (bitmap *); extern void compute_dominance_frontiers (struct bitmap_head_def *);
extern bitmap compute_idf (bitmap, bitmap *); extern bitmap compute_idf (bitmap, struct bitmap_head_def *);
extern void dump_bb_info (basic_block, bool, bool, int, const char *, FILE *); extern void dump_bb_info (basic_block, bool, bool, int, const char *, FILE *);
extern void dump_edge_info (FILE *, edge, int); extern void dump_edge_info (FILE *, edge, int);
extern void brief_dump_cfg (FILE *); extern void brief_dump_cfg (FILE *);
......
...@@ -1256,7 +1256,7 @@ dfs_enumerate_from (basic_block bb, int reverse, ...@@ -1256,7 +1256,7 @@ dfs_enumerate_from (basic_block bb, int reverse,
static void static void
compute_dominance_frontiers_1 (bitmap *frontiers) compute_dominance_frontiers_1 (bitmap_head *frontiers)
{ {
edge p; edge p;
edge_iterator ei; edge_iterator ei;
...@@ -1275,7 +1275,7 @@ compute_dominance_frontiers_1 (bitmap *frontiers) ...@@ -1275,7 +1275,7 @@ compute_dominance_frontiers_1 (bitmap *frontiers)
domsb = get_immediate_dominator (CDI_DOMINATORS, b); domsb = get_immediate_dominator (CDI_DOMINATORS, b);
while (runner != domsb) while (runner != domsb)
{ {
if (!bitmap_set_bit (frontiers[runner->index], if (!bitmap_set_bit (&frontiers[runner->index],
b->index)) b->index))
break; break;
runner = get_immediate_dominator (CDI_DOMINATORS, runner = get_immediate_dominator (CDI_DOMINATORS,
...@@ -1288,7 +1288,7 @@ compute_dominance_frontiers_1 (bitmap *frontiers) ...@@ -1288,7 +1288,7 @@ compute_dominance_frontiers_1 (bitmap *frontiers)
void void
compute_dominance_frontiers (bitmap *frontiers) compute_dominance_frontiers (bitmap_head *frontiers)
{ {
timevar_push (TV_DOM_FRONTIERS); timevar_push (TV_DOM_FRONTIERS);
...@@ -1307,7 +1307,7 @@ compute_dominance_frontiers (bitmap *frontiers) ...@@ -1307,7 +1307,7 @@ compute_dominance_frontiers (bitmap *frontiers)
allocated for the return value. */ allocated for the return value. */
bitmap bitmap
compute_idf (bitmap def_blocks, bitmap *dfs) compute_idf (bitmap def_blocks, bitmap_head *dfs)
{ {
bitmap_iterator bi; bitmap_iterator bi;
unsigned bb_index, i; unsigned bb_index, i;
...@@ -1340,7 +1340,7 @@ compute_idf (bitmap def_blocks, bitmap *dfs) ...@@ -1340,7 +1340,7 @@ compute_idf (bitmap def_blocks, bitmap *dfs)
we may pull a non-existing block from the work stack. */ we may pull a non-existing block from the work stack. */
gcc_assert (bb_index < (unsigned) last_basic_block); gcc_assert (bb_index < (unsigned) last_basic_block);
EXECUTE_IF_AND_COMPL_IN_BITMAP (dfs[bb_index], phi_insertion_points, EXECUTE_IF_AND_COMPL_IN_BITMAP (&dfs[bb_index], phi_insertion_points,
0, i, bi) 0, i, bi)
{ {
/* Use a safe push because if there is a definition of VAR /* Use a safe push because if there is a definition of VAR
......
...@@ -4390,7 +4390,7 @@ df_md_local_compute (bitmap all_blocks) ...@@ -4390,7 +4390,7 @@ df_md_local_compute (bitmap all_blocks)
unsigned int bb_index, df_bb_index; unsigned int bb_index, df_bb_index;
bitmap_iterator bi1, bi2; bitmap_iterator bi1, bi2;
basic_block bb; basic_block bb;
bitmap *frontiers; bitmap_head *frontiers;
bitmap_initialize (&seen_in_insn, &bitmap_default_obstack); bitmap_initialize (&seen_in_insn, &bitmap_default_obstack);
...@@ -4401,9 +4401,9 @@ df_md_local_compute (bitmap all_blocks) ...@@ -4401,9 +4401,9 @@ df_md_local_compute (bitmap all_blocks)
bitmap_clear (&seen_in_insn); bitmap_clear (&seen_in_insn);
frontiers = XNEWVEC (bitmap, last_basic_block); frontiers = XNEWVEC (bitmap_head, last_basic_block);
FOR_ALL_BB (bb) FOR_ALL_BB (bb)
frontiers[bb->index] = BITMAP_ALLOC (NULL); bitmap_initialize (&frontiers[bb->index], &bitmap_default_obstack);
compute_dominance_frontiers (frontiers); compute_dominance_frontiers (frontiers);
...@@ -4411,7 +4411,7 @@ df_md_local_compute (bitmap all_blocks) ...@@ -4411,7 +4411,7 @@ df_md_local_compute (bitmap all_blocks)
EXECUTE_IF_SET_IN_BITMAP (all_blocks, 0, bb_index, bi1) EXECUTE_IF_SET_IN_BITMAP (all_blocks, 0, bb_index, bi1)
{ {
bitmap kill = &df_md_get_bb_info (bb_index)->kill; bitmap kill = &df_md_get_bb_info (bb_index)->kill;
EXECUTE_IF_SET_IN_BITMAP (frontiers[bb_index], 0, df_bb_index, bi2) EXECUTE_IF_SET_IN_BITMAP (&frontiers[bb_index], 0, df_bb_index, bi2)
{ {
basic_block bb = BASIC_BLOCK (df_bb_index); basic_block bb = BASIC_BLOCK (df_bb_index);
if (bitmap_bit_p (all_blocks, df_bb_index)) if (bitmap_bit_p (all_blocks, df_bb_index))
...@@ -4421,7 +4421,7 @@ df_md_local_compute (bitmap all_blocks) ...@@ -4421,7 +4421,7 @@ df_md_local_compute (bitmap all_blocks)
} }
FOR_ALL_BB (bb) FOR_ALL_BB (bb)
BITMAP_FREE (frontiers[bb->index]); bitmap_clear (&frontiers[bb->index]);
free (frontiers); free (frontiers);
} }
......
...@@ -1143,7 +1143,7 @@ insert_phi_nodes_for (tree var, bitmap phi_insertion_points, bool update_p) ...@@ -1143,7 +1143,7 @@ insert_phi_nodes_for (tree var, bitmap phi_insertion_points, bool update_p)
the flowgraph. */ the flowgraph. */
static void static void
insert_phi_nodes (bitmap *dfs) insert_phi_nodes (bitmap_head *dfs)
{ {
referenced_var_iterator rvi; referenced_var_iterator rvi;
bitmap_iterator bi; bitmap_iterator bi;
...@@ -2349,7 +2349,7 @@ fini_ssa_renamer (void) ...@@ -2349,7 +2349,7 @@ fini_ssa_renamer (void)
static unsigned int static unsigned int
rewrite_into_ssa (void) rewrite_into_ssa (void)
{ {
bitmap *dfs; bitmap_head *dfs;
basic_block bb; basic_block bb;
timevar_push (TV_TREE_SSA_OTHER); timevar_push (TV_TREE_SSA_OTHER);
...@@ -2367,9 +2367,9 @@ rewrite_into_ssa (void) ...@@ -2367,9 +2367,9 @@ rewrite_into_ssa (void)
sbitmap_zero (interesting_blocks); sbitmap_zero (interesting_blocks);
/* Initialize dominance frontier. */ /* Initialize dominance frontier. */
dfs = XNEWVEC (bitmap, last_basic_block); dfs = XNEWVEC (bitmap_head, last_basic_block);
FOR_EACH_BB (bb) FOR_EACH_BB (bb)
dfs[bb->index] = BITMAP_ALLOC (NULL); bitmap_initialize (&dfs[bb->index], &bitmap_default_obstack);
/* 1- Compute dominance frontiers. */ /* 1- Compute dominance frontiers. */
calculate_dominance_info (CDI_DOMINATORS); calculate_dominance_info (CDI_DOMINATORS);
...@@ -2386,7 +2386,7 @@ rewrite_into_ssa (void) ...@@ -2386,7 +2386,7 @@ rewrite_into_ssa (void)
/* Free allocated memory. */ /* Free allocated memory. */
FOR_EACH_BB (bb) FOR_EACH_BB (bb)
BITMAP_FREE (dfs[bb->index]); bitmap_clear (&dfs[bb->index]);
free (dfs); free (dfs);
sbitmap_free (interesting_blocks); sbitmap_free (interesting_blocks);
...@@ -3005,7 +3005,7 @@ release_ssa_name_after_update_ssa (tree name) ...@@ -3005,7 +3005,7 @@ release_ssa_name_after_update_ssa (tree name)
names is not pruned. PHI nodes are inserted at every IDF block. */ names is not pruned. PHI nodes are inserted at every IDF block. */
static void static void
insert_updated_phi_nodes_for (tree var, bitmap *dfs, bitmap blocks, insert_updated_phi_nodes_for (tree var, bitmap_head *dfs, bitmap blocks,
unsigned update_flags) unsigned update_flags)
{ {
basic_block entry; basic_block entry;
...@@ -3332,13 +3332,13 @@ update_ssa (unsigned update_flags) ...@@ -3332,13 +3332,13 @@ update_ssa (unsigned update_flags)
and for symbols in SYMS_TO_RENAME. */ and for symbols in SYMS_TO_RENAME. */
if (insert_phi_p) if (insert_phi_p)
{ {
bitmap *dfs; bitmap_head *dfs;
/* If the caller requested PHI nodes to be added, compute /* If the caller requested PHI nodes to be added, compute
dominance frontiers. */ dominance frontiers. */
dfs = XNEWVEC (bitmap, last_basic_block); dfs = XNEWVEC (bitmap_head, last_basic_block);
FOR_EACH_BB (bb) FOR_EACH_BB (bb)
dfs[bb->index] = BITMAP_ALLOC (NULL); bitmap_initialize (&dfs[bb->index], &bitmap_default_obstack);
compute_dominance_frontiers (dfs); compute_dominance_frontiers (dfs);
if (sbitmap_first_set_bit (old_ssa_names) >= 0) if (sbitmap_first_set_bit (old_ssa_names) >= 0)
...@@ -3363,7 +3363,7 @@ update_ssa (unsigned update_flags) ...@@ -3363,7 +3363,7 @@ update_ssa (unsigned update_flags)
update_flags); update_flags);
FOR_EACH_BB (bb) FOR_EACH_BB (bb)
BITMAP_FREE (dfs[bb->index]); bitmap_clear (&dfs[bb->index]);
free (dfs); free (dfs);
/* Insertion of PHI nodes may have added blocks to the region. /* Insertion of PHI nodes may have added blocks to the region.
......
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