summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTrevor Saunders <tsaunders@mozilla.com>2013-12-27 16:44:57 -0500
committerTrevor Saunders <tsaunders@mozilla.com>2014-02-18 22:44:36 -0500
commit414b9e3f0d97367e0ac879ce0973e8672eb0a044 (patch)
tree4faf36d8aba7d8ff7ec8e18c632b3ea67bcebd8f
parent892bdfc2d78a6a57597cc014c61e383ae44fe1c5 (diff)
downloadgcc-414b9e3f0d97367e0ac879ce0973e8672eb0a044.tar.gz
bitmap_count_bits -> bitmap_head::count_bits
-rw-r--r--gcc/bitmap.c4
-rw-r--r--gcc/bitmap.h6
-rw-r--r--gcc/df-problems.c2
-rw-r--r--gcc/dse.c4
-rw-r--r--gcc/ipa-split.c2
-rw-r--r--gcc/lto-cgraph.c4
-rw-r--r--gcc/tree-into-ssa.c2
-rw-r--r--gcc/tree-ssa-live.c2
-rw-r--r--gcc/tree-ssa-loop-ivopts.c4
-rw-r--r--gcc/tree-ssa-pre.c4
-rw-r--r--gcc/tree-ssa-tail-merge.c2
11 files changed, 18 insertions, 18 deletions
diff --git a/gcc/bitmap.c b/gcc/bitmap.c
index 0773acb3438..542f6b462db 100644
--- a/gcc/bitmap.c
+++ b/gcc/bitmap.c
@@ -732,13 +732,13 @@ bitmap_popcount (BITMAP_WORD a)
/* Count the number of bits set in the bitmap, and return it. */
unsigned long
-bitmap_count_bits (const_bitmap a)
+bitmap_head::count_bits () const
{
unsigned long count = 0;
const bitmap_element *elt;
unsigned ix;
- for (elt = a->first; elt; elt = elt->next)
+ for (elt = first; elt; elt = elt->next)
{
for (ix = 0; ix != BITMAP_ELEMENT_WORDS; ix++)
{
diff --git a/gcc/bitmap.h b/gcc/bitmap.h
index 04402205574..9c3038389e8 100644
--- a/gcc/bitmap.h
+++ b/gcc/bitmap.h
@@ -199,6 +199,9 @@ struct GTY(()) bitmap_head {
}
~bitmap_head () { bitmap_clear (this); }
+ /* Count the number of bits set in the bitmap. */
+ unsigned long count_bits () const;
+
unsigned first_set_bit () const;
unsigned last_set_bit () const;
@@ -237,9 +240,6 @@ inline bool bitmap_empty_p (const_bitmap map)
/* True if the bitmap has only a single bit set. */
extern bool bitmap_single_bit_set_p (const_bitmap);
-/* Count the number of bits set in the bitmap. */
-extern unsigned long bitmap_count_bits (const_bitmap);
-
/* Boolean operations on bitmaps. The _into variants are two operand
versions that modify the first source operand. The other variants
are three operand versions that to not destroy the source bitmaps.
diff --git a/gcc/df-problems.c b/gcc/df-problems.c
index 1d4476471bb..cddfba95fe0 100644
--- a/gcc/df-problems.c
+++ b/gcc/df-problems.c
@@ -622,7 +622,7 @@ df_rd_dump_defs_set (bitmap defs_set, const char *prefix, FILE *file)
unsigned int m = DF_REG_SIZE (df);
bool first_reg = true;
- fprintf (file, "%s\t(%d) ", prefix, (int) bitmap_count_bits (defs_set));
+ fprintf (file, "%s\t(%d) ", prefix, (int) defs_set->count_bits ());
for (regno = 0; regno < m; regno++)
{
diff --git a/gcc/dse.c b/gcc/dse.c
index f5c9c7376ea..02518859e89 100644
--- a/gcc/dse.c
+++ b/gcc/dse.c
@@ -2896,8 +2896,8 @@ dse_step2_init (void)
if (dump_file && (dump_flags & TDF_DETAILS))
{
fprintf (dump_file, "group %d(%d+%d): ", i,
- (int)bitmap_count_bits (group->store2_n),
- (int)bitmap_count_bits (group->store2_p));
+ (int)group->store2_n->count_bits (),
+ (int)group->store2_p->count_bits ());
bitmap_print (dump_file, group->store2_n, "n ", " ");
bitmap_print (dump_file, group->store2_p, "p ", "\n");
}
diff --git a/gcc/ipa-split.c b/gcc/ipa-split.c
index a11d57424dd..3e195e4f960 100644
--- a/gcc/ipa-split.c
+++ b/gcc/ipa-split.c
@@ -516,7 +516,7 @@ consider_split (struct split_point *current, bitmap non_ssa_vars,
/* FIXME: we currently can pass only SSA function parameters to the split
arguments. Once parm_adjustment infrastructure is supported by cloning,
we can pass more than that. */
- if (num_args != bitmap_count_bits (current->ssa_names_to_pass))
+ if (num_args != current->ssa_names_to_pass->count_bits ())
{
if (dump_file && (dump_flags & TDF_DETAILS))
diff --git a/gcc/lto-cgraph.c b/gcc/lto-cgraph.c
index ef3890db981..c8d58eabf07 100644
--- a/gcc/lto-cgraph.c
+++ b/gcc/lto-cgraph.c
@@ -1631,7 +1631,7 @@ output_node_opt_summary (struct output_block *ob,
if (node->clone.args_to_skip)
{
- streamer_write_uhwi (ob, bitmap_count_bits (node->clone.args_to_skip));
+ streamer_write_uhwi (ob, node->clone.args_to_skip->count_bits ());
EXECUTE_IF_SET_IN_BITMAP (node->clone.args_to_skip, 0, index, bi)
streamer_write_uhwi (ob, index);
}
@@ -1639,7 +1639,7 @@ output_node_opt_summary (struct output_block *ob,
streamer_write_uhwi (ob, 0);
if (node->clone.combined_args_to_skip)
{
- streamer_write_uhwi (ob, bitmap_count_bits (node->clone.combined_args_to_skip));
+ streamer_write_uhwi (ob, node->clone.combined_args_to_skip->count_bits ());
EXECUTE_IF_SET_IN_BITMAP (node->clone.combined_args_to_skip, 0, index, bi)
streamer_write_uhwi (ob, index);
}
diff --git a/gcc/tree-into-ssa.c b/gcc/tree-into-ssa.c
index 1444fc765b1..7f76b66d63e 100644
--- a/gcc/tree-into-ssa.c
+++ b/gcc/tree-into-ssa.c
@@ -809,7 +809,7 @@ prune_unused_phi_nodes (bitmap phis, bitmap kills, bitmap uses)
If we store the bounds for all the uses to an array and sort it, we can
locate the nearest dominating def in logarithmic time by binary search.*/
bitmap_ior (&to_remove, kills, phis);
- n_defs = bitmap_count_bits (&to_remove);
+ n_defs = to_remove.count_bits ();
defs = XNEWVEC (struct dom_dfsnum, 2 * n_defs + 1);
defs[0].bb_index = 1;
defs[0].dfs_num = 0;
diff --git a/gcc/tree-ssa-live.c b/gcc/tree-ssa-live.c
index a2ee97a34d3..ae7739d0097 100644
--- a/gcc/tree-ssa-live.c
+++ b/gcc/tree-ssa-live.c
@@ -304,7 +304,7 @@ partition_view_fini (var_map map, bitmap selected)
gcc_assert (selected);
- count = bitmap_count_bits (selected);
+ count = selected->count_bits ();
limit = map->partition_size;
/* If its a one-to-one ratio, we don't need any view compaction. */
diff --git a/gcc/tree-ssa-loop-ivopts.c b/gcc/tree-ssa-loop-ivopts.c
index 3e7fd7a294b..23f9923fb58 100644
--- a/gcc/tree-ssa-loop-ivopts.c
+++ b/gcc/tree-ssa-loop-ivopts.c
@@ -2660,7 +2660,7 @@ alloc_use_cost_map (struct ivopts_data *data)
size = n_iv_cands (data);
else
{
- s = bitmap_count_bits (use->related_cands);
+ s = use->related_cands->count_bits ();
/* Round up to the power of two, so that moduling by it is fast. */
size = s ? (1 << ceil_log2 (s)) : 1;
@@ -4826,7 +4826,7 @@ determine_use_iv_cost_condition (struct ivopts_data *data,
'base + n' will be loop invariant, resulting in only one live value
during the loop. So in that case we clear depends_on_elim and set
elim_inv_expr_id instead. */
- if (depends_on_elim && bitmap_count_bits (depends_on_elim) > 1)
+ if (depends_on_elim && depends_on_elim->count_bits () > 1)
{
elim_inv_expr_id = get_expr_id (data, bound);
bitmap_clear (depends_on_elim);
diff --git a/gcc/tree-ssa-pre.c b/gcc/tree-ssa-pre.c
index ba1cc963e11..440bed54b27 100644
--- a/gcc/tree-ssa-pre.c
+++ b/gcc/tree-ssa-pre.c
@@ -718,7 +718,7 @@ sorted_array_from_bitmap_set (bitmap_set_t set)
vec<pre_expr> result;
/* Pre-allocate roughly enough space for the array. */
- result.create (bitmap_count_bits (&set->values));
+ result.create (set->values.count_bits ());
FOR_EACH_VALUE_ID_IN_SET (set, i, bi)
{
@@ -2319,7 +2319,7 @@ compute_partial_antic_aux (basic_block block,
before the translation starts. */
if (max_pa
&& single_succ_p (block)
- && bitmap_count_bits (&PA_IN (single_succ (block))->values) > max_pa)
+ && PA_IN (single_succ (block))->values.count_bits () > max_pa)
goto maybe_dump_sets;
old_PA_IN = PA_IN (block);
diff --git a/gcc/tree-ssa-tail-merge.c b/gcc/tree-ssa-tail-merge.c
index 093f0a1203d..2bd2cf0deb3 100644
--- a/gcc/tree-ssa-tail-merge.c
+++ b/gcc/tree-ssa-tail-merge.c
@@ -682,7 +682,7 @@ add_to_worklist (same_succ same)
if (same->in_worklist)
return;
- if (bitmap_count_bits (same->bbs) < 2)
+ if (same->bbs->count_bits () < 2)
return;
same->in_worklist = true;