summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTrevor Saunders <tsaunders@mozilla.com>2014-01-12 12:07:43 -0500
committerTrevor Saunders <tsaunders@mozilla.com>2014-02-18 22:44:40 -0500
commit1d5764a33e04b45df067df566f8d3a974030946a (patch)
treee46e4075ec032cd0588ec54c5486585b29747f68
parent9119f1d06ac3c74f39d2fb7491ae97449be9e186 (diff)
downloadgcc-1d5764a33e04b45df067df566f8d3a974030946a.tar.gz
remove some bitmap indirection in tree-ssa-uninit.c
-rw-r--r--gcc/tree-ssa-uninit.c19
1 files changed, 6 insertions, 13 deletions
diff --git a/gcc/tree-ssa-uninit.c b/gcc/tree-ssa-uninit.c
index e97c1b5997d..6a8715690b4 100644
--- a/gcc/tree-ssa-uninit.c
+++ b/gcc/tree-ssa-uninit.c
@@ -988,7 +988,7 @@ prune_uninit_phi_opnds_in_unrealizable_paths (gimple phi,
tree boundary_cst,
enum tree_code cmp_code,
pointer_set_t *visited_phis,
- bitmap *visited_flag_phis)
+ bitmap visited_flag_phis)
{
unsigned i;
@@ -1023,15 +1023,11 @@ prune_uninit_phi_opnds_in_unrealizable_paths (gimple phi,
if (gimple_bb (phi_arg_def) != gimple_bb (flag_arg_def))
return false;
- if (!*visited_flag_phis)
- *visited_flag_phis = BITMAP_ALLOC (NULL);
-
- if ((*visited_flag_phis)->bit
- (SSA_NAME_VERSION (gimple_phi_result (flag_arg_def))))
+ int version = SSA_NAME_VERSION (gimple_phi_result (flag_arg_def));
+ if (visited_flag_phis->bit (version))
return false;
- (*visited_flag_phis)->set_bit
- (SSA_NAME_VERSION (gimple_phi_result (flag_arg_def)));
+ visited_flag_phis->set_bit (version);
/* Now recursively prune the uninitialized phi args. */
uninit_opnds_arg_phi = compute_uninit_opnds_pos (phi_arg_def);
@@ -1040,7 +1036,7 @@ prune_uninit_phi_opnds_in_unrealizable_paths (gimple phi,
boundary_cst, cmp_code, visited_phis, visited_flag_phis))
return false;
- (*visited_flag_phis)->clear_bit
+ visited_flag_phis->clear_bit
(SSA_NAME_VERSION (gimple_phi_result (flag_arg_def)));
continue;
}
@@ -1166,7 +1162,6 @@ use_pred_not_overlap_with_undef_path_pred (pred_chain_union preds,
bool swap_cond = false;
bool invert = false;
pred_chain the_pred_chain = vNULL;
- bitmap visited_flag_phis = NULL;
bool all_pruned = false;
size_t num_preds = preds.length ();
@@ -1228,6 +1223,7 @@ use_pred_not_overlap_with_undef_path_pred (pred_chain_union preds,
if (cmp_code == ERROR_MARK)
return false;
+ bitmap_head visited_flag_phis;
all_pruned = prune_uninit_phi_opnds_in_unrealizable_paths (phi,
uninit_opnds,
flag_def,
@@ -1236,9 +1232,6 @@ use_pred_not_overlap_with_undef_path_pred (pred_chain_union preds,
visited_phis,
&visited_flag_phis);
- if (visited_flag_phis)
- BITMAP_FREE (visited_flag_phis);
-
return all_pruned;
}