summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/ChangeLog39
-rw-r--r--gcc/alias.c2
-rw-r--r--gcc/bitmap.h12
-rw-r--r--gcc/bt-load.c28
-rw-r--r--gcc/calls.c4
-rw-r--r--gcc/cfganal.c30
-rw-r--r--gcc/cfgbuild.c4
-rw-r--r--gcc/cfgexpand.c2
-rw-r--r--gcc/cfgloop.c4
-rw-r--r--gcc/cfgloopmanip.c8
-rw-r--r--gcc/cfgrtl.c2
-rw-r--r--gcc/config/epiphany/resolve-sw-modes.c2
-rw-r--r--gcc/config/i386/i386.c10
-rw-r--r--gcc/config/mips/mips.c2
-rw-r--r--gcc/config/spu/spu.c4
-rw-r--r--gcc/cprop.c4
-rw-r--r--gcc/cse.c2
-rw-r--r--gcc/dce.c4
-rw-r--r--gcc/ddg.c52
-rw-r--r--gcc/df-core.c2
-rw-r--r--gcc/domwalk.c2
-rw-r--r--gcc/dse.c2
-rw-r--r--gcc/ebitmap.c134
-rw-r--r--gcc/ebitmap.h48
-rw-r--r--gcc/except.c2
-rw-r--r--gcc/function.c2
-rw-r--r--gcc/gcse.c36
-rw-r--r--gcc/graphite-sese-to-poly.c2
-rw-r--r--gcc/ira-lives.c6
-rw-r--r--gcc/ira.c6
-rw-r--r--gcc/lcm.c128
-rw-r--r--gcc/loop-unroll.c14
-rw-r--r--gcc/lower-subreg.c2
-rw-r--r--gcc/lra-lives.c6
-rw-r--r--gcc/lra.c4
-rw-r--r--gcc/mode-switching.c8
-rw-r--r--gcc/modulo-sched.c84
-rw-r--r--gcc/recog.c2
-rw-r--r--gcc/regcprop.c2
-rw-r--r--gcc/reload1.c2
-rw-r--r--gcc/sbitmap.c188
-rw-r--r--gcc/sbitmap.h99
-rw-r--r--gcc/sched-rgn.c36
-rw-r--r--gcc/sel-sched-ir.c2
-rw-r--r--gcc/sel-sched.c4
-rw-r--r--gcc/store-motion.c18
-rw-r--r--gcc/testsuite/gcc.dg/sms-4.c2
-rw-r--r--gcc/tracer.c2
-rw-r--r--gcc/tree-eh.c10
-rw-r--r--gcc/tree-into-ssa.c22
-rw-r--r--gcc/tree-outof-ssa.c4
-rw-r--r--gcc/tree-ssa-dce.c8
-rw-r--r--gcc/tree-ssa-dom.c2
-rw-r--r--gcc/tree-ssa-live.c2
-rw-r--r--gcc/tree-ssa-live.h2
-rw-r--r--gcc/tree-ssa-loop-im.c2
-rw-r--r--gcc/tree-ssa-loop-ivcanon.c2
-rw-r--r--gcc/tree-ssa-loop-ivopts.c2
-rw-r--r--gcc/tree-ssa-loop-manip.c2
-rw-r--r--gcc/tree-ssa-phiopt.c2
-rw-r--r--gcc/tree-ssa-pre.c6
-rw-r--r--gcc/tree-ssa-propagate.c4
-rw-r--r--gcc/tree-ssa-reassoc.c8
-rw-r--r--gcc/tree-ssa-structalias.c10
-rw-r--r--gcc/tree-stdarg.c2
-rw-r--r--gcc/tree-vect-slp.c4
-rw-r--r--gcc/tree-vrp.c8
-rw-r--r--gcc/var-tracking.c6
68 files changed, 562 insertions, 606 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 9daf727ed80..4ad17e712bd 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,42 @@
+2012-10-29 Lawrence Crowl <crowl@google.com>
+
+ * sbitmap.h (sbitmap_copy): Rename bitmap_copy.
+ (sbitmap_copy_n): Rename bitmap_copy_n.
+ (sbitmap_equal): Rename bitmap_equal_p.
+ (sbitmap_empty_p): Rename bitmap_empty_p.
+ (sbitmap_range_empty_p): Rename bitmap_range_empty_p.
+ (sbitmap_zero): Rename bitmap_clear.
+ (sbitmap_ones): Rename bitmap_ones.
+ (sbitmap_vector_zero): Rename bitmap_vector_clear.
+ (sbitmap_vector_ones): Rename bitmap_vector_ones.
+ (sbitmap_not): Rename bitmap_not.
+ (sbitmap_a_and_b_cg): Commented out.
+ (sbitmap_a_and_b): Rename bitmap_and. Add bool return.
+ (sbitmap_difference): Rename bitmap_and_compl.
+ (sbitmap_a_or_b_cg): Commented out.
+ (sbitmap_a_or_b): Rename bitmap_xor. Add bool return.
+ (sbitmap_a_xor_b_cg): Commented out.
+ (sbitmap_a_xor_b): Rename bitmap_xor. Add bool return.
+ (sbitmap_a_and_b_or_c_cg): Rename bitmap_and_or.
+ (sbitmap_a_and_b_or_c): Commented out.
+ (sbitmap_a_or_b_and_c_cg): Rename bitmap_or_and.
+ (sbitmap_a_or_b_and_c): Commented out.
+ (sbitmap_union_of_diff_cg): Rename bitmap_ior_and_compl.
+ (sbitmap_union_of_diff): Commented out.
+ (dump_sbitmap): Rename dump_bitmap.
+ (dump_sbitmap_file): Rename dump_bitmap_file.
+ (debug_sbitmap): Rename debug_bitmap.
+ (dump_sbitmap_vector): Rename dump_bitmap_vector.
+ (sbitmap_first_set_bit): Rename bitmap_first_set_bit.
+ (sbitmap_last_set_bit): Rename bitmap_last_set_bit.
+ (sbitmap_a_subset_b_p): Rename bitmap_subset_p.
+ (sbitmap_any_common_bits): Rename bitmap_intersect_p.
+ (#define sbitmap_free): Reimplement as inline function.
+ (#define sbitmap_vector_free): Reimplement as inline function.
+ * bitmap.h (#define bitmap_zero): Remove as redundant.
+ (#define bitmap_empty_p): Reimplement as inline function.
+ (#define dump_bitmap): Reimplement as inline function.
+
2012-10-29 Jonathan Wakely <jwakely.gcc@gmail.com>
PR c++/54930
diff --git a/gcc/alias.c b/gcc/alias.c
index c5e64176313..af482eecc66 100644
--- a/gcc/alias.c
+++ b/gcc/alias.c
@@ -2869,7 +2869,7 @@ init_alias_analysis (void)
memset (new_reg_base_value, 0, maxreg * sizeof (rtx));
/* Wipe the reg_seen array clean. */
- sbitmap_zero (reg_seen);
+ bitmap_clear (reg_seen);
/* Mark all hard registers which may contain an address.
The stack, frame and argument pointers may contain an address.
diff --git a/gcc/bitmap.h b/gcc/bitmap.h
index 3e369b077c6..7ed5d745d1e 100644
--- a/gcc/bitmap.h
+++ b/gcc/bitmap.h
@@ -211,7 +211,10 @@ extern bool bitmap_intersect_p (const_bitmap, const_bitmap);
extern bool bitmap_intersect_compl_p (const_bitmap, const_bitmap);
/* True if MAP is an empty bitmap. */
-#define bitmap_empty_p(MAP) (!(MAP)->first)
+inline bool bitmap_empty_p (const_bitmap map)
+{
+ return !map->first;
+}
/* True if the bitmap has only a single bit set. */
extern bool bitmap_single_bit_set_p (const_bitmap);
@@ -288,8 +291,11 @@ extern bitmap bitmap_gc_alloc_stat (ALONE_MEM_STAT_DECL);
extern void bitmap_obstack_free (bitmap);
/* A few compatibility/functions macros for compatibility with sbitmaps */
-#define dump_bitmap(file, bitmap) bitmap_print (file, bitmap, "", "\n")
-#define bitmap_zero(a) bitmap_clear (a)
+inline void dump_bitmap (FILE *file, const_bitmap map)
+{
+ bitmap_print (file, map, "", "\n");
+}
+
extern unsigned bitmap_first_set_bit (const_bitmap);
extern unsigned bitmap_last_set_bit (const_bitmap);
diff --git a/gcc/bt-load.c b/gcc/bt-load.c
index 385bc6c45ac..2aeb1c0f023 100644
--- a/gcc/bt-load.c
+++ b/gcc/bt-load.c
@@ -436,7 +436,7 @@ note_btr_set (rtx dest, const_rtx set ATTRIBUTE_UNUSED, void *data)
note_other_use_this_block (regno, info->users_this_bb);
SET_HARD_REG_BIT (info->btrs_written_in_block, regno);
SET_HARD_REG_BIT (info->btrs_live_in_block, regno);
- sbitmap_difference (info->bb_gen, info->bb_gen,
+ bitmap_and_compl (info->bb_gen, info->bb_gen,
info->btr_defset[regno - first_btr]);
}
}
@@ -457,7 +457,7 @@ compute_defs_uses_and_gen (fibheap_t all_btr_defs, btr_def *def_array,
btr_def_group all_btr_def_groups = NULL;
defs_uses_info info;
- sbitmap_vector_zero (bb_gen, last_basic_block);
+ bitmap_vector_clear (bb_gen, last_basic_block);
for (i = NUM_FIXED_BLOCKS; i < last_basic_block; i++)
{
basic_block bb = BASIC_BLOCK (i);
@@ -497,7 +497,7 @@ compute_defs_uses_and_gen (fibheap_t all_btr_defs, btr_def *def_array,
def_array[insn_uid] = def;
SET_HARD_REG_BIT (info.btrs_written_in_block, regno);
SET_HARD_REG_BIT (info.btrs_live_in_block, regno);
- sbitmap_difference (bb_gen[i], bb_gen[i],
+ bitmap_and_compl (bb_gen[i], bb_gen[i],
btr_defset[regno - first_btr]);
SET_BIT (bb_gen[i], insn_uid);
def->next_this_bb = defs_this_bb;
@@ -519,7 +519,7 @@ compute_defs_uses_and_gen (fibheap_t all_btr_defs, btr_def *def_array,
user->other_use_this_block = 1;
IOR_HARD_REG_SET (info.btrs_written_in_block, all_btrs);
IOR_HARD_REG_SET (info.btrs_live_in_block, all_btrs);
- sbitmap_zero (info.bb_gen);
+ bitmap_clear (info.bb_gen);
}
else
{
@@ -618,13 +618,13 @@ compute_kill (sbitmap *bb_kill, sbitmap *btr_defset,
/* For each basic block, form the set BB_KILL - the set
of definitions that the block kills. */
- sbitmap_vector_zero (bb_kill, last_basic_block);
+ bitmap_vector_clear (bb_kill, last_basic_block);
for (i = NUM_FIXED_BLOCKS; i < last_basic_block; i++)
{
for (regno = first_btr; regno <= last_btr; regno++)
if (TEST_HARD_REG_BIT (all_btrs, regno)
&& TEST_HARD_REG_BIT (btrs_written[i], regno))
- sbitmap_a_or_b (bb_kill[i], bb_kill[i],
+ bitmap_ior (bb_kill[i], bb_kill[i],
btr_defset[regno - first_btr]);
}
}
@@ -643,7 +643,7 @@ compute_out (sbitmap *bb_out, sbitmap *bb_gen, sbitmap *bb_kill, int max_uid)
sbitmap bb_in = sbitmap_alloc (max_uid);
for (i = NUM_FIXED_BLOCKS; i < last_basic_block; i++)
- sbitmap_copy (bb_out[i], bb_gen[i]);
+ bitmap_copy (bb_out[i], bb_gen[i]);
changed = 1;
while (changed)
@@ -652,7 +652,7 @@ compute_out (sbitmap *bb_out, sbitmap *bb_gen, sbitmap *bb_kill, int max_uid)
for (i = NUM_FIXED_BLOCKS; i < last_basic_block; i++)
{
sbitmap_union_of_preds (bb_in, bb_out, BASIC_BLOCK (i));
- changed |= sbitmap_union_of_diff_cg (bb_out[i], bb_gen[i],
+ changed |= bitmap_ior_and_compl (bb_out[i], bb_gen[i],
bb_in, bb_kill[i]);
}
}
@@ -689,7 +689,7 @@ link_btr_uses (btr_def *def_array, btr_user *use_array, sbitmap *bb_out,
{
/* Remove all reaching defs of regno except
for this one. */
- sbitmap_difference (reaching_defs, reaching_defs,
+ bitmap_and_compl (reaching_defs, reaching_defs,
btr_defset[def->btr - first_btr]);
SET_BIT(reaching_defs, insn_uid);
}
@@ -702,7 +702,7 @@ link_btr_uses (btr_def *def_array, btr_user *use_array, sbitmap *bb_out,
sbitmap_iterator sbi;
if (user->use)
- sbitmap_a_and_b (
+ bitmap_and (
reaching_defs_of_reg,
reaching_defs,
btr_defset[REGNO (user->use) - first_btr]);
@@ -710,12 +710,12 @@ link_btr_uses (btr_def *def_array, btr_user *use_array, sbitmap *bb_out,
{
int reg;
- sbitmap_zero (reaching_defs_of_reg);
+ bitmap_clear (reaching_defs_of_reg);
for (reg = first_btr; reg <= last_btr; reg++)
if (TEST_HARD_REG_BIT (all_btrs, reg)
&& refers_to_regno_p (reg, reg + 1, user->insn,
NULL))
- sbitmap_a_or_b_and_c (reaching_defs_of_reg,
+ bitmap_or_and (reaching_defs_of_reg,
reaching_defs_of_reg,
reaching_defs,
btr_defset[reg - first_btr]);
@@ -763,7 +763,7 @@ link_btr_uses (btr_def *def_array, btr_user *use_array, sbitmap *bb_out,
for (regno = first_btr; regno <= last_btr; regno++)
if (TEST_HARD_REG_BIT (all_btrs, regno)
&& TEST_HARD_REG_BIT (call_used_reg_set, regno))
- sbitmap_difference (reaching_defs, reaching_defs,
+ bitmap_and_compl (reaching_defs, reaching_defs,
btr_defset[regno - first_btr]);
}
}
@@ -785,7 +785,7 @@ build_btr_def_use_webs (fibheap_t all_btr_defs)
sbitmap *bb_kill;
sbitmap *bb_out;
- sbitmap_vector_zero (btr_defset, (last_btr - first_btr) + 1);
+ bitmap_vector_clear (btr_defset, (last_btr - first_btr) + 1);
compute_defs_uses_and_gen (all_btr_defs, def_array, use_array, btr_defset,
bb_gen, btrs_written);
diff --git a/gcc/calls.c b/gcc/calls.c
index 01706c3e79a..fb520c6906c 100644
--- a/gcc/calls.c
+++ b/gcc/calls.c
@@ -1822,7 +1822,7 @@ mem_overlaps_already_clobbered_arg_p (rtx addr, unsigned HOST_WIDE_INT size)
HOST_WIDE_INT i;
rtx val;
- if (sbitmap_empty_p (stored_args_map))
+ if (bitmap_empty_p (stored_args_map))
return false;
val = internal_arg_pointer_based_exp (addr, true);
if (val == NULL_RTX)
@@ -2749,7 +2749,7 @@ expand_call (tree exp, rtx target, int ignore)
= plus_constant (Pmode, argblock, -crtl->args.pretend_args_size);
#endif
stored_args_map = sbitmap_alloc (args_size.constant);
- sbitmap_zero (stored_args_map);
+ bitmap_clear (stored_args_map);
}
/* If we have no actual push instructions, or shouldn't use them,
diff --git a/gcc/cfganal.c b/gcc/cfganal.c
index 7cf9ca85606..58c763f8454 100644
--- a/gcc/cfganal.c
+++ b/gcc/cfganal.c
@@ -84,7 +84,7 @@ mark_dfs_back_edges (void)
visited = sbitmap_alloc (last_basic_block);
/* None of the nodes in the CFG have been visited yet. */
- sbitmap_zero (visited);
+ bitmap_clear (visited);
/* Push the first edge on to the stack. */
stack[sp++] = ei_start (ENTRY_BLOCK_PTR->succs);
@@ -501,7 +501,7 @@ post_order_compute (int *post_order, bool include_entry_exit,
visited = sbitmap_alloc (last_basic_block);
/* None of the nodes in the CFG have been visited yet. */
- sbitmap_zero (visited);
+ bitmap_clear (visited);
/* Push the first edge on to the stack. */
stack[sp++] = ei_start (ENTRY_BLOCK_PTR->succs);
@@ -597,7 +597,7 @@ static basic_block
dfs_find_deadend (basic_block bb)
{
sbitmap visited = sbitmap_alloc (last_basic_block);
- sbitmap_zero (visited);
+ bitmap_clear (visited);
for (;;)
{
@@ -654,7 +654,7 @@ inverted_post_order_compute (int *post_order)
visited = sbitmap_alloc (last_basic_block);
/* None of the nodes in the CFG have been visited yet. */
- sbitmap_zero (visited);
+ bitmap_clear (visited);
/* Put all blocks that have no successor into the initial work list. */
FOR_ALL_BB (bb)
@@ -803,7 +803,7 @@ pre_and_rev_post_order_compute (int *pre_order, int *rev_post_order,
visited = sbitmap_alloc (last_basic_block);
/* None of the nodes in the CFG have been visited yet. */
- sbitmap_zero (visited);
+ bitmap_clear (visited);
/* Push the first edge on to the stack. */
stack[sp++] = ei_start (ENTRY_BLOCK_PTR->succs);
@@ -916,7 +916,7 @@ flow_dfs_compute_reverse_init (depth_first_search_ds data)
data->visited_blocks = sbitmap_alloc (last_basic_block);
/* None of the nodes in the CFG have been visited yet. */
- sbitmap_zero (data->visited_blocks);
+ bitmap_clear (data->visited_blocks);
return;
}
@@ -1006,7 +1006,7 @@ dfs_enumerate_from (basic_block bb, int reverse,
{
visited = sbitmap_alloc (size);
- sbitmap_zero (visited);
+ bitmap_clear (visited);
v_size = size;
}
else if (v_size < size)
@@ -1208,12 +1208,12 @@ sbitmap_intersection_of_succs (sbitmap dst, sbitmap *src,
if (e->dest == EXIT_BLOCK_PTR)
continue;
- sbitmap_copy (dst, src[e->dest->index]);
+ bitmap_copy (dst, src[e->dest->index]);
break;
}
if (e == 0)
- sbitmap_ones (dst);
+ bitmap_ones (dst);
else
for (++ix; ix < EDGE_COUNT (b->succs); ix++)
{
@@ -1250,12 +1250,12 @@ sbitmap_intersection_of_preds (sbitmap dst, sbitmap *src,
if (e->src == ENTRY_BLOCK_PTR)
continue;
- sbitmap_copy (dst, src[e->src->index]);
+ bitmap_copy (dst, src[e->src->index]);
break;
}
if (e == 0)
- sbitmap_ones (dst);
+ bitmap_ones (dst);
else
for (++ix; ix < EDGE_COUNT (b->preds); ix++)
{
@@ -1292,12 +1292,12 @@ sbitmap_union_of_succs (sbitmap dst, sbitmap *src,
if (e->dest == EXIT_BLOCK_PTR)
continue;
- sbitmap_copy (dst, src[e->dest->index]);
+ bitmap_copy (dst, src[e->dest->index]);
break;
}
if (ix == EDGE_COUNT (b->succs))
- sbitmap_zero (dst);
+ bitmap_clear (dst);
else
for (ix++; ix < EDGE_COUNT (b->succs); ix++)
{
@@ -1334,12 +1334,12 @@ sbitmap_union_of_preds (sbitmap dst, sbitmap *src,
if (e->src== ENTRY_BLOCK_PTR)
continue;
- sbitmap_copy (dst, src[e->src->index]);
+ bitmap_copy (dst, src[e->src->index]);
break;
}
if (ix == EDGE_COUNT (b->preds))
- sbitmap_zero (dst);
+ bitmap_clear (dst);
else
for (ix++; ix < EDGE_COUNT (b->preds); ix++)
{
diff --git a/gcc/cfgbuild.c b/gcc/cfgbuild.c
index 6e5c6ef75a7..09dad6fa467 100644
--- a/gcc/cfgbuild.c
+++ b/gcc/cfgbuild.c
@@ -236,7 +236,7 @@ make_edges (basic_block min, basic_block max, int update_p)
/* If we have an edge cache, cache edges going out of BB. */
if (edge_cache)
{
- sbitmap_zero (edge_cache);
+ bitmap_clear (edge_cache);
if (update_p)
{
FOR_EACH_EDGE (e, ei, bb->succs)
@@ -385,7 +385,7 @@ make_edges (basic_block min, basic_block max, int update_p)
}
if (edge_cache)
- sbitmap_vector_free (edge_cache);
+ sbitmap_free (edge_cache);
}
static void
diff --git a/gcc/cfgexpand.c b/gcc/cfgexpand.c
index ba86eb571ea..5c06c1f2eff 100644
--- a/gcc/cfgexpand.c
+++ b/gcc/cfgexpand.c
@@ -4581,7 +4581,7 @@ gimple_expand_cfg (void)
}
blocks = sbitmap_alloc (last_basic_block);
- sbitmap_ones (blocks);
+ bitmap_ones (blocks);
find_many_sub_basic_blocks (blocks);
sbitmap_free (blocks);
purge_all_dead_edges ();
diff --git a/gcc/cfgloop.c b/gcc/cfgloop.c
index 44df99b8f33..83ac28d5713 100644
--- a/gcc/cfgloop.c
+++ b/gcc/cfgloop.c
@@ -393,7 +393,7 @@ flow_loops_find (struct loops *loops)
/* Count the number of loop headers. This should be the
same as the number of natural loops. */
headers = sbitmap_alloc (last_basic_block);
- sbitmap_zero (headers);
+ bitmap_clear (headers);
num_loops = 0;
FOR_EACH_BB (header)
@@ -1351,7 +1351,7 @@ verify_loop_structure (void)
}
free (bbs);
}
- sbitmap_zero (visited);
+ bitmap_clear (visited);
FOR_EACH_LOOP (li, loop, LI_FROM_INNERMOST)
{
bbs = get_loop_body (loop);
diff --git a/gcc/cfgloopmanip.c b/gcc/cfgloopmanip.c
index b48e85883ce..713a2ef5da7 100644
--- a/gcc/cfgloopmanip.c
+++ b/gcc/cfgloopmanip.c
@@ -190,7 +190,7 @@ fix_bb_placements (basic_block from,
return;
in_queue = sbitmap_alloc (last_basic_block);
- sbitmap_zero (in_queue);
+ bitmap_clear (in_queue);
SET_BIT (in_queue, from->index);
/* Prevent us from going out of the base_loop. */
SET_BIT (in_queue, base_loop->header->index);
@@ -327,7 +327,7 @@ remove_path (edge e)
n_bord_bbs = 0;
bord_bbs = XNEWVEC (basic_block, n_basic_blocks);
seen = sbitmap_alloc (last_basic_block);
- sbitmap_zero (seen);
+ bitmap_clear (seen);
/* Find "border" hexes -- i.e. those with predecessor in removed path. */
for (i = 0; i < nrem; i++)
@@ -365,7 +365,7 @@ remove_path (edge e)
free (rem_bbs);
/* Find blocks whose dominators may be affected. */
- sbitmap_zero (seen);
+ bitmap_clear (seen);
for (i = 0; i < n_bord_bbs; i++)
{
basic_block ldom;
@@ -594,7 +594,7 @@ update_dominators_in_loop (struct loop *loop)
unsigned i;
seen = sbitmap_alloc (last_basic_block);
- sbitmap_zero (seen);
+ bitmap_clear (seen);
body = get_loop_body (loop);
for (i = 0; i < loop->num_nodes; i++)
diff --git a/gcc/cfgrtl.c b/gcc/cfgrtl.c
index b58562fcc5f..5eec5e05f4b 100644
--- a/gcc/cfgrtl.c
+++ b/gcc/cfgrtl.c
@@ -3725,7 +3725,7 @@ break_superblocks (void)
basic_block bb;
superblocks = sbitmap_alloc (last_basic_block);
- sbitmap_zero (superblocks);
+ bitmap_clear (superblocks);
FOR_EACH_BB (bb)
if (bb->flags & BB_SUPERBLOCK)
diff --git a/gcc/config/epiphany/resolve-sw-modes.c b/gcc/config/epiphany/resolve-sw-modes.c
index 9564d752c4f..14c64d44cbe 100644
--- a/gcc/config/epiphany/resolve-sw-modes.c
+++ b/gcc/config/epiphany/resolve-sw-modes.c
@@ -63,7 +63,7 @@ resolve_sw_modes (void)
todo = VEC_alloc (basic_block, heap, last_basic_block);
pushed = sbitmap_alloc (last_basic_block);
- sbitmap_zero (pushed);
+ bitmap_clear (pushed);
if (!finalize_fp_sets)
{
df_note_add_problem ();
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 6542161b8b7..7fbf3a73ad2 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -401,10 +401,10 @@ move_or_delete_vzeroupper (void)
visited = sbitmap_alloc (last_basic_block);
in_worklist = sbitmap_alloc (last_basic_block);
in_pending = sbitmap_alloc (last_basic_block);
- sbitmap_zero (in_worklist);
+ bitmap_clear (in_worklist);
/* Don't check outgoing edges of entry point. */
- sbitmap_ones (in_pending);
+ bitmap_ones (in_pending);
FOR_EACH_BB (bb)
if (BLOCK_INFO (bb)->processed)
RESET_BIT (in_pending, bb->index);
@@ -426,7 +426,7 @@ move_or_delete_vzeroupper (void)
in_pending = in_worklist;
in_worklist = sbitmap_swap;
- sbitmap_zero (visited);
+ bitmap_clear (visited);
cfun->machine->rescan_vzeroupper_p = 0;
@@ -24783,7 +24783,7 @@ core2i7_first_cycle_multipass_issue (void *_data, char *ready_try, int n_ready,
n_ready, 0);
data->ready_try_change_size = n_ready;
}
- sbitmap_zero (data->ready_try_change);
+ bitmap_clear (data->ready_try_change);
/* Filter out insns from ready_try that the core will not be able to issue
on current cycle due to decoder. */
@@ -24802,7 +24802,7 @@ core2i7_first_cycle_multipass_backtrack (const void *_data,
unsigned int i = 0;
sbitmap_iterator sbi;
- gcc_assert (sbitmap_last_set_bit (data->ready_try_change) < n_ready);
+ gcc_assert (bitmap_last_set_bit (data->ready_try_change) < n_ready);
EXECUTE_IF_SET_IN_SBITMAP (data->ready_try_change, 0, i, sbi)
{
ready_try[i] = 0;
diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c
index b8675927715..cc90e06b067 100644
--- a/gcc/config/mips/mips.c
+++ b/gcc/config/mips/mips.c
@@ -14828,7 +14828,7 @@ r10k_insert_cache_barriers (void)
/* Bit X of PROTECTED_BBS is set if the last operation in basic block
X is protected by a cache barrier. */
protected_bbs = sbitmap_alloc (last_basic_block);
- sbitmap_zero (protected_bbs);
+ bitmap_clear (protected_bbs);
/* Iterate over the basic blocks in reverse post-order. */
rev_post_order = XNEWVEC (int, last_basic_block);
diff --git a/gcc/config/spu/spu.c b/gcc/config/spu/spu.c
index 831d2b08a61..720cc0299b9 100644
--- a/gcc/config/spu/spu.c
+++ b/gcc/config/spu/spu.c
@@ -2454,7 +2454,7 @@ spu_machine_dependent_reorg (void)
}
blocks = sbitmap_alloc (last_basic_block);
- sbitmap_zero (blocks);
+ bitmap_clear (blocks);
in_spu_reorg = 1;
compute_bb_for_insn ();
@@ -2625,7 +2625,7 @@ spu_machine_dependent_reorg (void)
}
free (spu_bb_info);
- if (!sbitmap_empty_p (blocks))
+ if (!bitmap_empty_p (blocks))
find_many_sub_basic_blocks (blocks);
/* We have to schedule to make sure alignment is ok. */
diff --git a/gcc/cprop.c b/gcc/cprop.c
index 0d3e1f9e09c..e90a13ca878 100644
--- a/gcc/cprop.c
+++ b/gcc/cprop.c
@@ -600,8 +600,8 @@ compute_local_properties (sbitmap *kill, sbitmap *comp,
unsigned int i;
/* Initialize the bitmaps that were passed in. */
- sbitmap_vector_zero (kill, last_basic_block);
- sbitmap_vector_zero (comp, last_basic_block);
+ bitmap_vector_clear (kill, last_basic_block);
+ bitmap_vector_clear (comp, last_basic_block);
for (i = 0; i < table->size; i++)
{
diff --git a/gcc/cse.c b/gcc/cse.c
index af66c370e13..c7a75eae454 100644
--- a/gcc/cse.c
+++ b/gcc/cse.c
@@ -6546,7 +6546,7 @@ cse_main (rtx f ATTRIBUTE_UNUSED, int nregs)
/* Set up the table of already visited basic blocks. */
cse_visited_basic_blocks = sbitmap_alloc (last_basic_block);
- sbitmap_zero (cse_visited_basic_blocks);
+ bitmap_clear (cse_visited_basic_blocks);
/* Loop over basic blocks in reverse completion order (RPO),
excluding the ENTRY and EXIT blocks. */
diff --git a/gcc/dce.c b/gcc/dce.c
index 9a42da761c2..4c088a48fa4 100644
--- a/gcc/dce.c
+++ b/gcc/dce.c
@@ -724,7 +724,7 @@ init_dce (bool fast)
can_alter_cfg = true;
marked = sbitmap_alloc (get_max_uid () + 1);
- sbitmap_zero (marked);
+ bitmap_clear (marked);
}
@@ -1082,7 +1082,7 @@ fast_dce (bool word_level)
/* So something was deleted that requires a redo. Do it on
the cheap. */
delete_unmarked_insns ();
- sbitmap_zero (marked);
+ bitmap_clear (marked);
bitmap_clear (processed);
bitmap_clear (redo_out);
diff --git a/gcc/ddg.c b/gcc/ddg.c
index a7d3e665a85..8fcb98263bb 100644
--- a/gcc/ddg.c
+++ b/gcc/ddg.c
@@ -660,9 +660,9 @@ create_ddg (basic_block bb, int closing_branch_deps)
g->nodes[i].cuid = i;
g->nodes[i].successors = sbitmap_alloc (num_nodes);
- sbitmap_zero (g->nodes[i].successors);
+ bitmap_clear (g->nodes[i].successors);
g->nodes[i].predecessors = sbitmap_alloc (num_nodes);
- sbitmap_zero (g->nodes[i].predecessors);
+ bitmap_clear (g->nodes[i].predecessors);
g->nodes[i].first_note = (first_note ? first_note : insn);
g->nodes[i++].insn = insn;
first_note = NULL_RTX;
@@ -890,7 +890,7 @@ create_scc (ddg_ptr g, sbitmap nodes)
scc->backarcs = NULL;
scc->num_backarcs = 0;
scc->nodes = sbitmap_alloc (g->num_nodes);
- sbitmap_copy (scc->nodes, nodes);
+ bitmap_copy (scc->nodes, nodes);
/* Mark the backarcs that belong to this SCC. */
EXECUTE_IF_SET_IN_SBITMAP (nodes, 0, u, sbi)
@@ -980,11 +980,11 @@ find_successors (sbitmap succ, ddg_ptr g, sbitmap ops)
EXECUTE_IF_SET_IN_SBITMAP (ops, 0, i, sbi)
{
const sbitmap node_succ = NODE_SUCCESSORS (&g->nodes[i]);
- sbitmap_a_or_b (succ, succ, node_succ);
+ bitmap_ior (succ, succ, node_succ);
};
/* We want those that are not in ops. */
- sbitmap_difference (succ, succ, ops);
+ bitmap_and_compl (succ, succ, ops);
}
/* Given a set OPS of nodes in the DDG, find the set of their predecessors
@@ -999,11 +999,11 @@ find_predecessors (sbitmap preds, ddg_ptr g, sbitmap ops)
EXECUTE_IF_SET_IN_SBITMAP (ops, 0, i, sbi)
{
const sbitmap node_preds = NODE_PREDECESSORS (&g->nodes[i]);
- sbitmap_a_or_b (preds, preds, node_preds);
+ bitmap_ior (preds, preds, node_preds);
};
/* We want those that are not in ops. */
- sbitmap_difference (preds, preds, ops);
+ bitmap_and_compl (preds, preds, ops);
}
@@ -1035,14 +1035,14 @@ check_sccs (ddg_all_sccs_ptr sccs, int num_nodes)
int i = 0;
sbitmap tmp = sbitmap_alloc (num_nodes);
- sbitmap_zero (tmp);
+ bitmap_clear (tmp);
for (i = 0; i < sccs->num_sccs; i++)
{
- gcc_assert (!sbitmap_empty_p (sccs->sccs[i]->nodes));
+ gcc_assert (!bitmap_empty_p (sccs->sccs[i]->nodes));
/* Verify that every node in sccs is in exactly one strongly
connected component. */
- gcc_assert (!sbitmap_any_common_bits (tmp, sccs->sccs[i]->nodes));
- sbitmap_a_or_b (tmp, tmp, sccs->sccs[i]->nodes);
+ gcc_assert (!bitmap_intersect_p (tmp, sccs->sccs[i]->nodes));
+ bitmap_ior (tmp, tmp, sccs->sccs[i]->nodes);
}
sbitmap_free (tmp);
}
@@ -1076,9 +1076,9 @@ create_ddg_all_sccs (ddg_ptr g)
if (backarc->aux.count == IN_SCC)
continue;
- sbitmap_zero (scc_nodes);
- sbitmap_zero (from);
- sbitmap_zero (to);
+ bitmap_clear (scc_nodes);
+ bitmap_clear (from);
+ bitmap_clear (to);
SET_BIT (from, dest->cuid);
SET_BIT (to, src->cuid);
@@ -1132,15 +1132,15 @@ find_nodes_on_paths (sbitmap result, ddg_ptr g, sbitmap from, sbitmap to)
sbitmap reach_to = sbitmap_alloc (num_nodes);
sbitmap tmp = sbitmap_alloc (num_nodes);
- sbitmap_copy (reachable_from, from);
- sbitmap_copy (tmp, from);
+ bitmap_copy (reachable_from, from);
+ bitmap_copy (tmp, from);
change = 1;
while (change)
{
change = 0;
- sbitmap_copy (workset, tmp);
- sbitmap_zero (tmp);
+ bitmap_copy (workset, tmp);
+ bitmap_clear (tmp);
EXECUTE_IF_SET_IN_SBITMAP (workset, 0, u, sbi)
{
ddg_edge_ptr e;
@@ -1161,15 +1161,15 @@ find_nodes_on_paths (sbitmap result, ddg_ptr g, sbitmap from, sbitmap to)
}
}
- sbitmap_copy (reach_to, to);
- sbitmap_copy (tmp, to);
+ bitmap_copy (reach_to, to);
+ bitmap_copy (tmp, to);
change = 1;
while (change)
{
change = 0;
- sbitmap_copy (workset, tmp);
- sbitmap_zero (tmp);
+ bitmap_copy (workset, tmp);
+ bitmap_clear (tmp);
EXECUTE_IF_SET_IN_SBITMAP (workset, 0, u, sbi)
{
ddg_edge_ptr e;
@@ -1190,7 +1190,7 @@ find_nodes_on_paths (sbitmap result, ddg_ptr g, sbitmap from, sbitmap to)
}
}
- answer = sbitmap_a_and_b_cg (result, reachable_from, reach_to);
+ answer = bitmap_and (result, reachable_from, reach_to);
sbitmap_free (workset);
sbitmap_free (reachable_from);
sbitmap_free (reach_to);
@@ -1247,7 +1247,7 @@ longest_simple_path (struct ddg * g, int src, int dest, sbitmap nodes)
g->nodes[i].aux.count = -1;
g->nodes[src].aux.count = 0;
- sbitmap_zero (tmp);
+ bitmap_clear (tmp);
SET_BIT (tmp, src);
while (change)
@@ -1255,8 +1255,8 @@ longest_simple_path (struct ddg * g, int src, int dest, sbitmap nodes)
sbitmap_iterator sbi;
change = 0;
- sbitmap_copy (workset, tmp);
- sbitmap_zero (tmp);
+ bitmap_copy (workset, tmp);
+ bitmap_clear (tmp);
EXECUTE_IF_SET_IN_SBITMAP (workset, 0, u, sbi)
{
ddg_node_ptr u_node = &g->nodes[u];
diff --git a/gcc/df-core.c b/gcc/df-core.c
index 34f1ea351c1..2ac11e42e58 100644
--- a/gcc/df-core.c
+++ b/gcc/df-core.c
@@ -1080,7 +1080,7 @@ df_worklist_dataflow (struct dataflow *dataflow,
bbindex_to_postorder[i] = last_basic_block;
/* Initialize the considered map. */
- sbitmap_zero (considered);
+ bitmap_clear (considered);
EXECUTE_IF_SET_IN_BITMAP (blocks_to_consider, 0, index, bi)
{
SET_BIT (considered, index);
diff --git a/gcc/domwalk.c b/gcc/domwalk.c
index 5f99436c26b..6e8c3968715 100644
--- a/gcc/domwalk.c
+++ b/gcc/domwalk.c
@@ -145,7 +145,7 @@ walk_dominator_tree (struct dom_walk_data *walk_data, basic_block bb)
basic_block *worklist = XNEWVEC (basic_block, n_basic_blocks * 2);
int sp = 0;
sbitmap visited = sbitmap_alloc (last_basic_block + 1);
- sbitmap_zero (visited);
+ bitmap_clear (visited);
SET_BIT (visited, ENTRY_BLOCK_PTR->index);
while (true)
diff --git a/gcc/dse.c b/gcc/dse.c
index 3ae8353770f..a987f3cc38f 100644
--- a/gcc/dse.c
+++ b/gcc/dse.c
@@ -3384,7 +3384,7 @@ dse_step3 (bool for_spills)
bitmap all_ones = NULL;
unsigned int i;
- sbitmap_ones (unreachable_blocks);
+ bitmap_ones (unreachable_blocks);
FOR_ALL_BB (bb)
{
diff --git a/gcc/ebitmap.c b/gcc/ebitmap.c
index 977d4ef0f6d..7c7d58b96dc 100644
--- a/gcc/ebitmap.c
+++ b/gcc/ebitmap.c
@@ -79,7 +79,7 @@ along with GCC; see the file COPYING3. If not see
/* Find the last set bit in ebitmap MAP. */
int
-ebitmap_last_set_bit (ebitmap map)
+bitmap_last_set_bit (ebitmap map)
{
unsigned int i = 0;
ebitmap_iterator ebi;
@@ -183,10 +183,10 @@ ebitmap_array_clear (ebitmap map)
/* Clear ebitmap MAP. */
void
-ebitmap_clear (ebitmap map)
+bitmap_clear (ebitmap map)
{
ebitmap_array_clear (map);
- sbitmap_zero (map->wordmask);
+ bitmap_clear (map->wordmask);
map->wordmask = sbitmap_resize (map->wordmask, 1, 0);
map->numwords = 0;
map->cache = NULL;
@@ -203,7 +203,7 @@ ebitmap_alloc (unsigned int size)
size = EBITMAP_ELT_BITS;
ebitmap_array_init (ret, (size + EBITMAP_ELT_BITS - 1) / EBITMAP_ELT_BITS);
ret->wordmask = sbitmap_alloc_with_popcount (size);
- sbitmap_zero (ret->wordmask);
+ bitmap_clear (ret->wordmask);
ret->numwords = 0;
ret->cache = NULL;
ret->cacheindex = 0;
@@ -214,7 +214,7 @@ ebitmap_alloc (unsigned int size)
/* Clear BIT from ebitmap MAP. */
void
-ebitmap_clear_bit (ebitmap map, unsigned int bit)
+bitmap_clear_bit (ebitmap map, unsigned int bit)
{
unsigned int wordindex = bit / EBITMAP_ELT_BITS;
unsigned int eltwordindex = 0;
@@ -269,7 +269,7 @@ ebitmap_clear_bit (ebitmap map, unsigned int bit)
/* Set BIT in ebitmap MAP. */
void
-ebitmap_set_bit (ebitmap map, unsigned int bit)
+bitmap_set_bit (ebitmap map, unsigned int bit)
{
unsigned int wordindex = bit / EBITMAP_ELT_BITS;
unsigned int eltwordindex;
@@ -325,7 +325,7 @@ ebitmap_set_bit (ebitmap map, unsigned int bit)
/* Return true if MAP contains BIT. */
bool
-ebitmap_bit_p (ebitmap map, unsigned int bit)
+bitmap_bit_p (ebitmap map, unsigned int bit)
{
unsigned int wordindex = bit / EBITMAP_ELT_BITS;
unsigned int bitindex= bit % EBITMAP_ELT_BITS;
@@ -355,12 +355,12 @@ ebitmap_bit_p (ebitmap map, unsigned int bit)
/* Copy ebitmap SRC to DST. */
void
-ebitmap_copy (ebitmap dst, ebitmap src)
+bitmap_copy (ebitmap dst, ebitmap src)
{
/* Blow away any existing wordmask, and copy the new one. */
sbitmap_free (dst->wordmask);
dst->wordmask = sbitmap_alloc_with_popcount (src->wordmask->n_bits);
- sbitmap_copy (dst->wordmask, src->wordmask);
+ bitmap_copy (dst->wordmask, src->wordmask);
/* Make sure our destination array is big enough, and then copy the
actual words. */
@@ -374,14 +374,14 @@ ebitmap_copy (ebitmap dst, ebitmap src)
/* Dump ebitmap BMAP to FILE. */
void
-dump_ebitmap (FILE *file, ebitmap bmap)
+dump_bitmap (FILE *file, ebitmap bmap)
{
unsigned int pos;
unsigned int i;
int res;
unsigned int size;
- res = sbitmap_last_set_bit (bmap->wordmask);
+ res = bitmap_last_set_bit (bmap->wordmask);
if (res == -1)
size = 0;
else
@@ -390,7 +390,7 @@ dump_ebitmap (FILE *file, ebitmap bmap)
fprintf (file, "n_words = %d, set = {", bmap->numwords);
for (pos = 30, i = 0; i < size; i++)
- if (ebitmap_bit_p (bmap, i))
+ if (bitmap_bit_p (bmap, i))
{
if (pos > 70)
{
@@ -407,15 +407,15 @@ dump_ebitmap (FILE *file, ebitmap bmap)
/* Dump ebitmap BMAP to stderr. */
DEBUG_FUNCTION void
-debug_ebitmap (ebitmap bmap)
+debug_bitmap (ebitmap bmap)
{
- dump_ebitmap (stderr, bmap);
+ dump_bitmap (stderr, bmap);
}
/* Perform the operation DST &= SRC. */
void
-ebitmap_and_into (ebitmap dst, ebitmap src)
+bitmap_and_into (ebitmap dst, ebitmap src)
{
sbitmap_iterator sbi;
unsigned int i;
@@ -430,13 +430,13 @@ ebitmap_and_into (ebitmap dst, ebitmap src)
/* Short circuit the empty bitmap cases. */
if (src->numwords == 0 || dst->numwords == 0)
{
- ebitmap_clear (dst);
+ bitmap_clear (dst);
return;
}
/* AND the masks, then walk the words that may actually appear in
the result, AND'ing them. */
- sbitmap_a_and_b (dst->wordmask, dst->wordmask, src->wordmask);
+ bitmap_and (dst->wordmask, dst->wordmask, src->wordmask);
EXECUTE_IF_SET_IN_SBITMAP (dst->wordmask, 0, i, sbi)
{
@@ -469,7 +469,7 @@ ebitmap_and_into (ebitmap dst, ebitmap src)
/* Perform the operation DST = SRC1 & SRC2. */
void
-ebitmap_and (ebitmap dst, ebitmap src1, ebitmap src2)
+bitmap_and (ebitmap dst, ebitmap src1, ebitmap src2)
{
sbitmap_iterator sbi;
unsigned int i;
@@ -480,7 +480,7 @@ ebitmap_and (ebitmap dst, ebitmap src1, ebitmap src2)
dst->cache = NULL;
if (src1->numwords == 0 || src2->numwords == 0)
{
- ebitmap_clear (dst);
+ bitmap_clear (dst);
return;
}
@@ -488,7 +488,7 @@ ebitmap_and (ebitmap dst, ebitmap src1, ebitmap src2)
= sbitmap_resize (dst->wordmask,
MIN (src1->wordmask->n_bits, src2->wordmask->n_bits),
0);
- sbitmap_a_and_b (dst->wordmask, src1->wordmask, src2->wordmask);
+ bitmap_and (dst->wordmask, src1->wordmask, src2->wordmask);
EXECUTE_IF_SET_IN_SBITMAP (dst->wordmask, 0, i, sbi)
{
@@ -524,8 +524,8 @@ ebitmap_and (ebitmap dst, ebitmap src1, ebitmap src2)
gcc_assert (dst->elts[i] != 0);
EXECUTE_IF_SET_IN_EBITMAP (src1, 0, i, ebi)
- if (ebitmap_bit_p (src2, i))
- gcc_assert (ebitmap_bit_p (dst, i));
+ if (bitmap_bit_p (src2, i))
+ gcc_assert (bitmap_bit_p (dst, i));
for (i = 0; i < dst->numwords; i++)
gcc_assert (dst->elts[i] != 0);
@@ -542,7 +542,7 @@ ebitmap_and (ebitmap dst, ebitmap src1, ebitmap src2)
changed. */
bool
-ebitmap_ior_into (ebitmap dst, ebitmap src)
+bitmap_ior_into (ebitmap dst, ebitmap src)
{
unsigned int dstsize = dst->wordmask->n_bits;
unsigned int srcsize = src->wordmask->n_bits;
@@ -557,7 +557,7 @@ ebitmap_ior_into (ebitmap dst, ebitmap src)
unsigned int newarraysize;
#ifdef EBITMAP_DEBUGGING
ebitmap dstcopy = ebitmap_alloc (1);
- ebitmap_copy (dstcopy, dst);
+ bitmap_copy (dstcopy, dst);
#endif
dst->cache = NULL;
@@ -566,7 +566,7 @@ ebitmap_ior_into (ebitmap dst, ebitmap src)
if (dst->numwords == 0 && src->numwords != 0)
{
- ebitmap_copy (dst, src);
+ bitmap_copy (dst, src);
return true;
}
else if (src->numwords == 0)
@@ -575,10 +575,10 @@ ebitmap_ior_into (ebitmap dst, ebitmap src)
/* We can do without the temp mask if it's faster, but it would mean
touching more words in the actual dense vector. */
tempmask = sbitmap_alloc (MAX (srcsize, dstsize));
- sbitmap_zero (tempmask);
+ bitmap_clear (tempmask);
if (srcsize == dstsize)
{
- sbitmap_a_or_b (tempmask, dst->wordmask, src->wordmask);
+ bitmap_ior (tempmask, dst->wordmask, src->wordmask);
}
else
{
@@ -586,13 +586,13 @@ ebitmap_ior_into (ebitmap dst, ebitmap src)
0);
if (srcsize >= dstsize)
{
- sbitmap_copy_n (tempmask, dst->wordmask, dst->wordmask->size);
- sbitmap_a_or_b (tempmask, tempmask, src->wordmask);
+ bitmap_copy_n (tempmask, dst->wordmask, dst->wordmask->size);
+ bitmap_ior (tempmask, tempmask, src->wordmask);
}
else
{
- sbitmap_copy_n (tempmask, src->wordmask, src->wordmask->size);
- sbitmap_a_or_b (tempmask, tempmask, dst->wordmask);
+ bitmap_copy_n (tempmask, src->wordmask, src->wordmask->size);
+ bitmap_ior (tempmask, tempmask, dst->wordmask);
}
}
newarraysize = src->numwords + dst->numwords;
@@ -649,12 +649,12 @@ ebitmap_ior_into (ebitmap dst, ebitmap src)
gcc_assert (dst->elts[i] != 0);
EXECUTE_IF_SET_IN_EBITMAP (src, 0, i, ebi)
- gcc_assert (ebitmap_bit_p (dst, i));
+ gcc_assert (bitmap_bit_p (dst, i));
EXECUTE_IF_SET_IN_EBITMAP (dstcopy, 0, i, ebi)
- gcc_assert (ebitmap_bit_p (dst, i));
+ gcc_assert (bitmap_bit_p (dst, i));
sbitmap_verify_popcount (dst->wordmask);
- gcc_assert (changed == !ebitmap_equal_p (dst, dstcopy));
+ gcc_assert (changed == !bitmap_equal_p (dst, dstcopy));
gcc_assert (sbitmap_popcount (dst->wordmask,
dst->wordmask->n_bits) == dst->numwords);
}
@@ -666,7 +666,7 @@ ebitmap_ior_into (ebitmap dst, ebitmap src)
in DST has changed. */
bool
-ebitmap_ior (ebitmap dst, ebitmap src1, ebitmap src2)
+bitmap_ior (ebitmap dst, ebitmap src1, ebitmap src2)
{
unsigned int src1size = src1->wordmask->n_bits;
unsigned int src2size = src2->wordmask->n_bits;
@@ -681,27 +681,27 @@ ebitmap_ior (ebitmap dst, ebitmap src1, ebitmap src2)
unsigned int newarraysize;
#ifdef EBITMAP_DEBUGGING
ebitmap dstcopy = ebitmap_alloc (1);
- ebitmap_copy (dstcopy, dst);
+ bitmap_copy (dstcopy, dst);
#endif
dst->cache = NULL;
tempmask = sbitmap_alloc_with_popcount (MAX (src1size, src2size));
- sbitmap_zero (tempmask);
+ bitmap_clear (tempmask);
if (src1size == src2size)
{
- sbitmap_a_or_b (tempmask, src1->wordmask, src2->wordmask);
+ bitmap_ior (tempmask, src1->wordmask, src2->wordmask);
}
else
{
if (src1size >= src2size)
{
- sbitmap_copy_n (tempmask, src2->wordmask, src2->wordmask->size);
- sbitmap_a_or_b (tempmask, tempmask, src1->wordmask);
+ bitmap_copy_n (tempmask, src2->wordmask, src2->wordmask->size);
+ bitmap_ior (tempmask, tempmask, src1->wordmask);
}
else
{
- sbitmap_copy_n (tempmask, src1->wordmask, src1->wordmask->size);
- sbitmap_a_or_b (tempmask, tempmask, src2->wordmask);
+ bitmap_copy_n (tempmask, src1->wordmask, src1->wordmask->size);
+ bitmap_ior (tempmask, tempmask, src2->wordmask);
}
}
newarraysize = src1->numwords + src2->numwords;
@@ -768,13 +768,13 @@ ebitmap_ior (ebitmap dst, ebitmap src1, ebitmap src2)
gcc_assert (dst->elts[i] != 0);
EXECUTE_IF_SET_IN_EBITMAP (src1, 0, i, ebi)
- gcc_assert (ebitmap_bit_p (dst, i));
+ gcc_assert (bitmap_bit_p (dst, i));
EXECUTE_IF_SET_IN_EBITMAP (src2, 0, i, ebi)
- gcc_assert (ebitmap_bit_p (dst, i));
+ gcc_assert (bitmap_bit_p (dst, i));
}
sbitmap_verify_popcount (dst->wordmask);
- gcc_assert (changed == !ebitmap_equal_p (dst, dstcopy));
+ gcc_assert (changed == !bitmap_equal_p (dst, dstcopy));
gcc_assert (sbitmap_popcount (dst->wordmask,
dst->wordmask->n_bits) == dst->numwords);
#endif
@@ -786,7 +786,7 @@ ebitmap_ior (ebitmap dst, ebitmap src1, ebitmap src2)
has changed. */
bool
-ebitmap_and_compl_into (ebitmap dst, ebitmap src)
+bitmap_and_compl_into (ebitmap dst, ebitmap src)
{
bool changed = false;
unsigned int i;
@@ -795,7 +795,7 @@ ebitmap_and_compl_into (ebitmap dst, ebitmap src)
sbitmap_iterator sbi;
#ifdef EBITMAP_DEBUGGING
ebitmap dstcopy = ebitmap_alloc (1);
- ebitmap_copy (dstcopy, dst);
+ bitmap_copy (dstcopy, dst);
#endif
gcc_assert (dst != src);
@@ -840,8 +840,8 @@ ebitmap_and_compl_into (ebitmap dst, ebitmap src)
EXECUTE_IF_SET_IN_EBITMAP (dstcopy, 0, i, ebi)
{
- if (!ebitmap_bit_p (src, i))
- gcc_assert (ebitmap_bit_p (dst, i));
+ if (!bitmap_bit_p (src, i))
+ gcc_assert (bitmap_bit_p (dst, i));
}
for (i = 0; i < dst->numwords; i++)
@@ -850,7 +850,7 @@ ebitmap_and_compl_into (ebitmap dst, ebitmap src)
gcc_assert (sbitmap_popcount (dst->wordmask,
dst->wordmask->n_bits) == neweltindex);
sbitmap_verify_popcount (dst->wordmask);
- gcc_assert (changed == !ebitmap_equal_p (dst, dstcopy));
+ gcc_assert (changed == !bitmap_equal_p (dst, dstcopy));
gcc_assert (sbitmap_popcount (dst->wordmask,
dst->wordmask->n_bits) == dst->numwords);
}
@@ -865,7 +865,7 @@ ebitmap_and_compl_into (ebitmap dst, ebitmap src)
in DST has changed. */
bool
-ebitmap_and_compl (ebitmap dst, ebitmap src1, ebitmap src2)
+bitmap_and_compl (ebitmap dst, ebitmap src1, ebitmap src2)
{
unsigned int src1size = src1->wordmask->n_bits;
sbitmap_iterator sbi;
@@ -880,8 +880,8 @@ ebitmap_and_compl (ebitmap dst, ebitmap src1, ebitmap src2)
/* XXX: Optimize like the into version. */
dst->cache = NULL;
tempmask = sbitmap_alloc_with_popcount (src1size);
- sbitmap_zero (tempmask);
- sbitmap_copy (tempmask, src1->wordmask);
+ bitmap_clear (tempmask);
+ bitmap_copy (tempmask, src1->wordmask);
newarraysize = src1->numwords;
newarray = XNEWVEC (EBITMAP_ELT_TYPE, newarraysize);
@@ -945,8 +945,8 @@ ebitmap_and_compl (ebitmap dst, ebitmap src1, ebitmap src2)
EXECUTE_IF_SET_IN_EBITMAP (src1, 0, i, ebi)
{
- if (!ebitmap_bit_p (src2, i))
- gcc_assert (ebitmap_bit_p (dst, i));
+ if (!bitmap_bit_p (src2, i))
+ gcc_assert (bitmap_bit_p (dst, i));
}
for (i = 0; i < dst->numwords; i++)
gcc_assert (dst->elts[i] != 0);
@@ -962,30 +962,30 @@ ebitmap_and_compl (ebitmap dst, ebitmap src1, ebitmap src2)
/* Perform the operation DST = A | (B & ~C). */
bool
-ebitmap_ior_and_compl (ebitmap dst, ebitmap a, ebitmap b, ebitmap c)
+bitmap_ior_and_compl (ebitmap dst, ebitmap a, ebitmap b, ebitmap c)
{
bool changed;
ebitmap temp = ebitmap_alloc (1);
#ifdef EBITMAP_DEBUGGING
ebitmap dstcopy = ebitmap_alloc (1);
- ebitmap_copy (dstcopy, dst);
+ bitmap_copy (dstcopy, dst);
#endif
dst->cache = NULL;
- ebitmap_and_compl (temp, b, c);
- changed = ebitmap_ior (dst, a, temp);
+ bitmap_and_compl (temp, b, c);
+ changed = bitmap_ior (dst, a, temp);
#ifdef EBITMAP_DEBUGGING
{
ebitmap_iterator ebi;
unsigned int i;
EXECUTE_IF_SET_IN_EBITMAP (a, 0, i, ebi)
- gcc_assert (ebitmap_bit_p (dst, i));
+ gcc_assert (bitmap_bit_p (dst, i));
EXECUTE_IF_SET_IN_EBITMAP (b, 0, i, ebi)
- if (!ebitmap_bit_p (c, i))
- gcc_assert (ebitmap_bit_p (dst, i));
- gcc_assert (changed == !ebitmap_equal_p (dst, dstcopy));
+ if (!bitmap_bit_p (c, i))
+ gcc_assert (bitmap_bit_p (dst, i));
+ gcc_assert (changed == !bitmap_equal_p (dst, dstcopy));
}
#endif
ebitmap_free (temp);
@@ -996,21 +996,21 @@ ebitmap_ior_and_compl (ebitmap dst, ebitmap a, ebitmap b, ebitmap c)
/* Return true if ebitmap DST is equal to ebitmap SRC. */
bool
-ebitmap_equal_p (ebitmap dst, ebitmap src)
+bitmap_equal_p (ebitmap dst, ebitmap src)
{
unsigned int which = MIN (dst->wordmask->size, src->wordmask->size);
if (dst->numwords != src->numwords)
return false;
- /* sbitmap_equal compares up to the size of the first argument, so
+ /* bitmap_equal_p compares up to the size of the first argument, so
if the two sbitmaps are not equally sized, we need to pass the
smaller one as the first argument, or it will crash. */
if (which == dst->wordmask->size
- && !sbitmap_equal (dst->wordmask, src->wordmask))
+ && !bitmap_equal_p (dst->wordmask, src->wordmask))
return false;
else if (which == src->wordmask->size
- && !sbitmap_equal (src->wordmask, dst->wordmask))
+ && !bitmap_equal_p (src->wordmask, dst->wordmask))
return false;
return memcmp (dst->elts, src->elts,
diff --git a/gcc/ebitmap.h b/gcc/ebitmap.h
index b067ddb892a..a755312a025 100644
--- a/gcc/ebitmap.h
+++ b/gcc/ebitmap.h
@@ -37,34 +37,38 @@ typedef struct ebitmap_def
} *ebitmap;
-#define ebitmap_empty_p(MAP) ((MAP)->numwords == 0)
+inline bool bitmap_empty_p (ebitmap map)
+{
+ return map->numwords == 0;
+}
+
#define ebitmap_free(MAP) (free((MAP)->elts), \
sbitmap_free ((MAP)->wordmask), \
free((MAP)))
-extern void ebitmap_set_bit (ebitmap, unsigned int);
-extern void ebitmap_clear_bit (ebitmap, unsigned int);
-extern bool ebitmap_bit_p (ebitmap, unsigned int);
-extern void dump_ebitmap (FILE *, ebitmap);
-extern void dump_ebitmap_file (FILE *, ebitmap);
-extern void dump_ebitmap_vector (FILE *, const char *, const char *, ebitmap *,
- int);
+extern void bitmap_set_bit (ebitmap, unsigned int);
+extern void bitmap_clear_bit (ebitmap, unsigned int);
+extern bool bitmap_bit_p (ebitmap, unsigned int);
+extern void dump_bitmap (FILE *, ebitmap);
+extern void dump_bitmap_file (FILE *, ebitmap);
+extern void dump_bitmap_vector (FILE *, const char *, const char *, ebitmap *,
+ int);
extern ebitmap ebitmap_alloc (unsigned int);
extern ebitmap *ebitmap_vector_alloc (unsigned int, unsigned int);
-extern void ebitmap_copy (ebitmap, ebitmap);
-extern void ebitmap_and (ebitmap, ebitmap, ebitmap);
-extern void ebitmap_and_into (ebitmap, ebitmap);
-extern bool ebitmap_and_compl (ebitmap, ebitmap, ebitmap);
-extern bool ebitmap_and_compl_into (ebitmap, ebitmap);
-extern bool ebitmap_ior_into (ebitmap, ebitmap);
-extern bool ebitmap_ior (ebitmap, ebitmap, ebitmap);
-extern bool ebitmap_ior_and_compl (ebitmap, ebitmap, ebitmap, ebitmap);
-extern bool ebitmap_ior_and_compl_into (ebitmap, ebitmap, ebitmap);
-extern bool ebitmap_equal_p (ebitmap, ebitmap);
-extern void ebitmap_clear (ebitmap);
-extern int ebitmap_last_set_bit (ebitmap);
-extern void debug_ebitmap (ebitmap);
-extern unsigned long ebitmap_popcount(ebitmap, unsigned long);
+extern void bitmap_copy (ebitmap, ebitmap);
+extern void bitmap_and (ebitmap, ebitmap, ebitmap);
+extern void bitmap_and_into (ebitmap, ebitmap);
+extern bool bitmap_and_compl (ebitmap, ebitmap, ebitmap);
+extern bool bitmap_and_compl_into (ebitmap, ebitmap);
+extern bool bitmap_ior_into (ebitmap, ebitmap);
+extern bool bitmap_ior (ebitmap, ebitmap, ebitmap);
+extern bool bitmap_ior_and_compl (ebitmap, ebitmap, ebitmap, ebitmap);
+extern bool bitmap_ior_and_compl_into (ebitmap, ebitmap, ebitmap);
+extern bool bitmap_equal_p (ebitmap, ebitmap);
+extern void bitmap_clear (ebitmap);
+extern int bitmap_last_set_bit (ebitmap);
+extern void debug_bitmap (ebitmap);
+extern unsigned long bitmap_popcount(ebitmap, unsigned long);
/* The iterator for ebitmap. */
typedef struct {
diff --git a/gcc/except.c b/gcc/except.c
index a4673531995..7e18c19ec14 100644
--- a/gcc/except.c
+++ b/gcc/except.c
@@ -610,7 +610,7 @@ eh_region_outermost (struct function *ifun, eh_region region_a,
gcc_assert (ifun->eh->region_tree);
b_outer = sbitmap_alloc (VEC_length (eh_region, ifun->eh->region_array));
- sbitmap_zero (b_outer);
+ bitmap_clear (b_outer);
do
{
diff --git a/gcc/function.c b/gcc/function.c
index e23ac91daf3..8a3904b7aae 100644
--- a/gcc/function.c
+++ b/gcc/function.c
@@ -6489,7 +6489,7 @@ epilogue_done:
/* Look for basic blocks within the prologue insns. */
blocks = sbitmap_alloc (last_basic_block);
- sbitmap_zero (blocks);
+ bitmap_clear (blocks);
SET_BIT (blocks, entry_edge->dest->index);
SET_BIT (blocks, orig_entry_edge->dest->index);
find_many_sub_basic_blocks (blocks);
diff --git a/gcc/gcse.c b/gcc/gcse.c
index 90b551bbc4d..6d0a47ef313 100644
--- a/gcc/gcse.c
+++ b/gcc/gcse.c
@@ -658,13 +658,13 @@ compute_local_properties (sbitmap *transp, sbitmap *comp, sbitmap *antloc,
/* Initialize any bitmaps that were passed in. */
if (transp)
{
- sbitmap_vector_ones (transp, last_basic_block);
+ bitmap_vector_ones (transp, last_basic_block);
}
if (comp)
- sbitmap_vector_zero (comp, last_basic_block);
+ bitmap_vector_clear (comp, last_basic_block);
if (antloc)
- sbitmap_vector_zero (antloc, last_basic_block);
+ bitmap_vector_clear (antloc, last_basic_block);
for (i = 0; i < table->size; i++)
{
@@ -1823,7 +1823,7 @@ prune_expressions (bool pre_p)
basic_block bb;
prune_exprs = sbitmap_alloc (expr_hash_table.n_elems);
- sbitmap_zero (prune_exprs);
+ bitmap_clear (prune_exprs);
for (ui = 0; ui < expr_hash_table.size; ui++)
{
for (expr = expr_hash_table.table[ui]; expr; expr = expr->next_same_hash)
@@ -1886,9 +1886,9 @@ prune_expressions (bool pre_p)
if ((e->flags & EDGE_ABNORMAL)
&& (pre_p || CALL_P (BB_END (e->src))))
{
- sbitmap_difference (antloc[bb->index],
+ bitmap_and_compl (antloc[bb->index],
antloc[bb->index], prune_exprs);
- sbitmap_difference (transp[bb->index],
+ bitmap_and_compl (transp[bb->index],
transp[bb->index], prune_exprs);
break;
}
@@ -1924,7 +1924,7 @@ prune_insertions_deletions (int n_elems)
the number of deletions achieved. We will prune these out of the
insertion/deletion sets. */
prune_exprs = sbitmap_alloc (n_elems);
- sbitmap_zero (prune_exprs);
+ bitmap_clear (prune_exprs);
/* Iterate over the edges counting the number of times each expression
needs to be inserted. */
@@ -1976,7 +1976,7 @@ compute_pre_data (void)
compute_local_properties (transp, comp, antloc, &expr_hash_table);
prune_expressions (true);
- sbitmap_vector_zero (ae_kill, last_basic_block);
+ bitmap_vector_clear (ae_kill, last_basic_block);
/* Compute ae_kill for each basic block using:
@@ -1985,8 +1985,8 @@ compute_pre_data (void)
FOR_EACH_BB (bb)
{
- sbitmap_a_or_b (ae_kill[bb->index], transp[bb->index], comp[bb->index]);
- sbitmap_not (ae_kill[bb->index], ae_kill[bb->index]);
+ bitmap_ior (ae_kill[bb->index], transp[bb->index], comp[bb->index]);
+ bitmap_not (ae_kill[bb->index], ae_kill[bb->index]);
}
edge_list = pre_edge_lcm (expr_hash_table.n_elems, transp, comp, antloc,
@@ -2235,7 +2235,7 @@ pre_edge_insert (struct edge_list *edge_list, struct expr **index_map)
set_size = pre_insert_map[0]->size;
num_edges = NUM_EDGES (edge_list);
inserted = sbitmap_vector_alloc (num_edges, expr_hash_table.n_elems);
- sbitmap_vector_zero (inserted, num_edges);
+ bitmap_vector_clear (inserted, num_edges);
for (e = 0; e < num_edges; e++)
{
@@ -2786,8 +2786,8 @@ compute_code_hoist_vbeinout (void)
int changed, passes;
basic_block bb;
- sbitmap_vector_zero (hoist_vbeout, last_basic_block);
- sbitmap_vector_zero (hoist_vbein, last_basic_block);
+ bitmap_vector_clear (hoist_vbeout, last_basic_block);
+ bitmap_vector_clear (hoist_vbein, last_basic_block);
passes = 0;
changed = 1;
@@ -2807,11 +2807,11 @@ compute_code_hoist_vbeinout (void)
/* Include expressions in VBEout that are calculated
in BB and available at its end. */
- sbitmap_a_or_b (hoist_vbeout[bb->index],
+ bitmap_ior (hoist_vbeout[bb->index],
hoist_vbeout[bb->index], comp[bb->index]);
}
- changed |= sbitmap_a_or_b_and_c_cg (hoist_vbein[bb->index],
+ changed |= bitmap_or_and (hoist_vbein[bb->index],
antloc[bb->index],
hoist_vbeout[bb->index],
transp[bb->index]);
@@ -2827,9 +2827,9 @@ compute_code_hoist_vbeinout (void)
FOR_EACH_BB (bb)
{
fprintf (dump_file, "vbein (%d): ", bb->index);
- dump_sbitmap_file (dump_file, hoist_vbein[bb->index]);
+ dump_bitmap_file (dump_file, hoist_vbein[bb->index]);
fprintf (dump_file, "vbeout(%d): ", bb->index);
- dump_sbitmap_file (dump_file, hoist_vbeout[bb->index]);
+ dump_bitmap_file (dump_file, hoist_vbeout[bb->index]);
}
}
}
@@ -2911,7 +2911,7 @@ should_hoist_expr_to_dom (basic_block expr_bb, struct expr *expr,
{
visited_allocated_locally = 1;
visited = sbitmap_alloc (last_basic_block);
- sbitmap_zero (visited);
+ bitmap_clear (visited);
}
FOR_EACH_EDGE (pred, ei, bb->preds)
diff --git a/gcc/graphite-sese-to-poly.c b/gcc/graphite-sese-to-poly.c
index 3a7b9101db9..228be811a75 100644
--- a/gcc/graphite-sese-to-poly.c
+++ b/gcc/graphite-sese-to-poly.c
@@ -405,7 +405,7 @@ build_scop_bbs (scop_p scop)
sbitmap visited = sbitmap_alloc (last_basic_block);
sese region = SCOP_REGION (scop);
- sbitmap_zero (visited);
+ bitmap_clear (visited);
build_scop_bbs_1 (scop, visited, SESE_ENTRY_BB (region));
sbitmap_free (visited);
}
diff --git a/gcc/ira-lives.c b/gcc/ira-lives.c
index 940cd681f2a..41fd07637bf 100644
--- a/gcc/ira-lives.c
+++ b/gcc/ira-lives.c
@@ -1465,8 +1465,8 @@ remove_some_program_points_and_update_live_ranges (void)
born = sbitmap_alloc (ira_max_point);
dead = sbitmap_alloc (ira_max_point);
- sbitmap_zero (born);
- sbitmap_zero (dead);
+ bitmap_clear (born);
+ bitmap_clear (dead);
FOR_EACH_OBJECT (obj, oi)
for (r = OBJECT_LIVE_RANGES (obj); r != NULL; r = r->next)
{
@@ -1476,7 +1476,7 @@ remove_some_program_points_and_update_live_ranges (void)
}
born_or_dead = sbitmap_alloc (ira_max_point);
- sbitmap_a_or_b (born_or_dead, born, dead);
+ bitmap_ior (born_or_dead, born, dead);
map = (int *) ira_allocate (sizeof (int) * ira_max_point);
n = -1;
prev_born_p = prev_dead_p = false;
diff --git a/gcc/ira.c b/gcc/ira.c
index 8dcdbf57549..aeef5c4b924 100644
--- a/gcc/ira.c
+++ b/gcc/ira.c
@@ -3492,9 +3492,9 @@ init_live_subregs (bool init_value, sbitmap *live_subregs,
/* If the entire reg was live before blasting into subregs, we need
to init all of the subregs to ones else init to 0. */
if (init_value)
- sbitmap_ones (live_subregs[allocnum]);
+ bitmap_ones (live_subregs[allocnum]);
else
- sbitmap_zero (live_subregs[allocnum]);
+ bitmap_clear (live_subregs[allocnum]);
bitmap_set_bit (live_subregs_used, allocnum);
}
@@ -3624,7 +3624,7 @@ build_insn_chain (void)
start++;
}
- if (sbitmap_empty_p (live_subregs[regno]))
+ if (bitmap_empty_p (live_subregs[regno]))
{
bitmap_clear_bit (live_subregs_used, regno);
bitmap_clear_bit (live_relevant_regs, regno);
diff --git a/gcc/lcm.c b/gcc/lcm.c
index fec2ba45d30..2a2b48f7edc 100644
--- a/gcc/lcm.c
+++ b/gcc/lcm.c
@@ -106,7 +106,7 @@ compute_antinout_edge (sbitmap *antloc, sbitmap *transp, sbitmap *antin,
/* We want a maximal solution, so make an optimistic initialization of
ANTIN. */
- sbitmap_vector_ones (antin, last_basic_block);
+ bitmap_vector_ones (antin, last_basic_block);
/* Put every block on the worklist; this is necessary because of the
optimistic initialization of ANTIN above. */
@@ -139,7 +139,7 @@ compute_antinout_edge (sbitmap *antloc, sbitmap *transp, sbitmap *antin,
/* Do not clear the aux field for blocks which are predecessors of
the EXIT block. That way we never add then to the worklist
again. */
- sbitmap_zero (antout[bb->index]);
+ bitmap_clear (antout[bb->index]);
else
{
/* Clear the aux field of this block so that it can be added to
@@ -148,7 +148,7 @@ compute_antinout_edge (sbitmap *antloc, sbitmap *transp, sbitmap *antin,
sbitmap_intersection_of_succs (antout[bb->index], antin, bb);
}
- if (sbitmap_a_or_b_and_c_cg (antin[bb->index], antloc[bb->index],
+ if (bitmap_or_and (antin[bb->index], antloc[bb->index],
transp[bb->index], antout[bb->index]))
/* If the in state of this block changed, then we need
to add the predecessors of this block to the worklist
@@ -190,17 +190,17 @@ compute_earliest (struct edge_list *edge_list, int n_exprs, sbitmap *antin,
pred = INDEX_EDGE_PRED_BB (edge_list, x);
succ = INDEX_EDGE_SUCC_BB (edge_list, x);
if (pred == ENTRY_BLOCK_PTR)
- sbitmap_copy (earliest[x], antin[succ->index]);
+ bitmap_copy (earliest[x], antin[succ->index]);
else
{
if (succ == EXIT_BLOCK_PTR)
- sbitmap_zero (earliest[x]);
+ bitmap_clear (earliest[x]);
else
{
- sbitmap_difference (difference, antin[succ->index],
+ bitmap_and_compl (difference, antin[succ->index],
avout[pred->index]);
- sbitmap_not (temp_bitmap, antout[pred->index]);
- sbitmap_a_and_b_or_c (earliest[x], difference,
+ bitmap_not (temp_bitmap, antout[pred->index]);
+ bitmap_and_or (earliest[x], difference,
kill[pred->index], temp_bitmap);
}
}
@@ -271,14 +271,14 @@ compute_laterin (struct edge_list *edge_list, sbitmap *earliest,
example the expression is ANTLOC in a block within the loop) then
this algorithm will detect it when we process the block at the head
of the optimistic edge. That will requeue the affected blocks. */
- sbitmap_vector_ones (later, num_edges);
+ bitmap_vector_ones (later, num_edges);
/* Note that even though we want an optimistic setting of LATER, we
do not want to be overly optimistic. Consider an outgoing edge from
the entry block. That edge should always have a LATER value the
same as EARLIEST for that edge. */
FOR_EACH_EDGE (e, ei, ENTRY_BLOCK_PTR->succs)
- sbitmap_copy (later[(size_t) e->aux], earliest[(size_t) e->aux]);
+ bitmap_copy (later[(size_t) e->aux], earliest[(size_t) e->aux]);
/* Add all the blocks to the worklist. This prevents an early exit from
the loop given our optimistic initialization of LATER above. */
@@ -305,14 +305,14 @@ compute_laterin (struct edge_list *edge_list, sbitmap *earliest,
qout = worklist;
/* Compute the intersection of LATERIN for each incoming edge to B. */
- sbitmap_ones (laterin[bb->index]);
+ bitmap_ones (laterin[bb->index]);
FOR_EACH_EDGE (e, ei, bb->preds)
- sbitmap_a_and_b (laterin[bb->index], laterin[bb->index],
+ bitmap_and (laterin[bb->index], laterin[bb->index],
later[(size_t)e->aux]);
/* Calculate LATER for all outgoing edges. */
FOR_EACH_EDGE (e, ei, bb->succs)
- if (sbitmap_union_of_diff_cg (later[(size_t) e->aux],
+ if (bitmap_ior_and_compl (later[(size_t) e->aux],
earliest[(size_t) e->aux],
laterin[e->src->index],
antloc[e->src->index])
@@ -331,9 +331,9 @@ compute_laterin (struct edge_list *edge_list, sbitmap *earliest,
/* Computation of insertion and deletion points requires computing LATERIN
for the EXIT block. We allocated an extra entry in the LATERIN array
for just this purpose. */
- sbitmap_ones (laterin[last_basic_block]);
+ bitmap_ones (laterin[last_basic_block]);
FOR_EACH_EDGE (e, ei, EXIT_BLOCK_PTR->preds)
- sbitmap_a_and_b (laterin[last_basic_block],
+ bitmap_and (laterin[last_basic_block],
laterin[last_basic_block],
later[(size_t) e->aux]);
@@ -352,7 +352,7 @@ compute_insert_delete (struct edge_list *edge_list, sbitmap *antloc,
basic_block bb;
FOR_EACH_BB (bb)
- sbitmap_difference (del[bb->index], antloc[bb->index],
+ bitmap_and_compl (del[bb->index], antloc[bb->index],
laterin[bb->index]);
for (x = 0; x < NUM_EDGES (edge_list); x++)
@@ -360,9 +360,9 @@ compute_insert_delete (struct edge_list *edge_list, sbitmap *antloc,
basic_block b = INDEX_EDGE_SUCC_BB (edge_list, x);
if (b == EXIT_BLOCK_PTR)
- sbitmap_difference (insert[x], later[x], laterin[last_basic_block]);
+ bitmap_and_compl (insert[x], later[x], laterin[last_basic_block]);
else
- sbitmap_difference (insert[x], later[x], laterin[b->index]);
+ bitmap_and_compl (insert[x], later[x], laterin[b->index]);
}
}
@@ -390,10 +390,10 @@ pre_edge_lcm (int n_exprs, sbitmap *transp,
fprintf (dump_file, "Edge List:\n");
verify_edge_list (dump_file, edge_list);
print_edge_list (dump_file, edge_list);
- dump_sbitmap_vector (dump_file, "transp", "", transp, last_basic_block);
- dump_sbitmap_vector (dump_file, "antloc", "", antloc, last_basic_block);
- dump_sbitmap_vector (dump_file, "avloc", "", avloc, last_basic_block);
- dump_sbitmap_vector (dump_file, "kill", "", kill, last_basic_block);
+ dump_bitmap_vector (dump_file, "transp", "", transp, last_basic_block);
+ dump_bitmap_vector (dump_file, "antloc", "", antloc, last_basic_block);
+ dump_bitmap_vector (dump_file, "avloc", "", avloc, last_basic_block);
+ dump_bitmap_vector (dump_file, "kill", "", kill, last_basic_block);
}
#endif
@@ -411,8 +411,8 @@ pre_edge_lcm (int n_exprs, sbitmap *transp,
#ifdef LCM_DEBUG_INFO
if (dump_file)
{
- dump_sbitmap_vector (dump_file, "antin", "", antin, last_basic_block);
- dump_sbitmap_vector (dump_file, "antout", "", antout, last_basic_block);
+ dump_bitmap_vector (dump_file, "antin", "", antin, last_basic_block);
+ dump_bitmap_vector (dump_file, "antout", "", antout, last_basic_block);
}
#endif
@@ -422,7 +422,7 @@ pre_edge_lcm (int n_exprs, sbitmap *transp,
#ifdef LCM_DEBUG_INFO
if (dump_file)
- dump_sbitmap_vector (dump_file, "earliest", "", earliest, num_edges);
+ dump_bitmap_vector (dump_file, "earliest", "", earliest, num_edges);
#endif
sbitmap_vector_free (antout);
@@ -438,8 +438,8 @@ pre_edge_lcm (int n_exprs, sbitmap *transp,
#ifdef LCM_DEBUG_INFO
if (dump_file)
{
- dump_sbitmap_vector (dump_file, "laterin", "", laterin, last_basic_block + 1);
- dump_sbitmap_vector (dump_file, "later", "", later, num_edges);
+ dump_bitmap_vector (dump_file, "laterin", "", laterin, last_basic_block + 1);
+ dump_bitmap_vector (dump_file, "later", "", later, num_edges);
}
#endif
@@ -447,8 +447,8 @@ pre_edge_lcm (int n_exprs, sbitmap *transp,
*insert = sbitmap_vector_alloc (num_edges, n_exprs);
*del = sbitmap_vector_alloc (last_basic_block, n_exprs);
- sbitmap_vector_zero (*insert, num_edges);
- sbitmap_vector_zero (*del, last_basic_block);
+ bitmap_vector_clear (*insert, num_edges);
+ bitmap_vector_clear (*del, last_basic_block);
compute_insert_delete (edge_list, antloc, later, laterin, *insert, *del);
sbitmap_vector_free (laterin);
@@ -457,8 +457,8 @@ pre_edge_lcm (int n_exprs, sbitmap *transp,
#ifdef LCM_DEBUG_INFO
if (dump_file)
{
- dump_sbitmap_vector (dump_file, "pre_insert_map", "", *insert, num_edges);
- dump_sbitmap_vector (dump_file, "pre_delete_map", "", *del,
+ dump_bitmap_vector (dump_file, "pre_insert_map", "", *insert, num_edges);
+ dump_bitmap_vector (dump_file, "pre_delete_map", "", *del,
last_basic_block);
}
#endif
@@ -485,7 +485,7 @@ compute_available (sbitmap *avloc, sbitmap *kill, sbitmap *avout,
XNEWVEC (basic_block, n_basic_blocks - NUM_FIXED_BLOCKS);
/* We want a maximal solution. */
- sbitmap_vector_ones (avout, last_basic_block);
+ bitmap_vector_ones (avout, last_basic_block);
/* Put every block on the worklist; this is necessary because of the
optimistic initialization of AVOUT above. */
@@ -520,7 +520,7 @@ compute_available (sbitmap *avloc, sbitmap *kill, sbitmap *avout,
if (bb->aux == ENTRY_BLOCK_PTR)
/* Do not clear the aux field for blocks which are successors of the
ENTRY block. That way we never add then to the worklist again. */
- sbitmap_zero (avin[bb->index]);
+ bitmap_clear (avin[bb->index]);
else
{
/* Clear the aux field of this block so that it can be added to
@@ -529,7 +529,7 @@ compute_available (sbitmap *avloc, sbitmap *kill, sbitmap *avout,
sbitmap_intersection_of_preds (avin[bb->index], avout, bb);
}
- if (sbitmap_union_of_diff_cg (avout[bb->index], avloc[bb->index],
+ if (bitmap_ior_and_compl (avout[bb->index], avloc[bb->index],
avin[bb->index], kill[bb->index]))
/* If the out state of this block changed, then we need
to add the successors of this block to the worklist
@@ -572,17 +572,17 @@ compute_farthest (struct edge_list *edge_list, int n_exprs,
pred = INDEX_EDGE_PRED_BB (edge_list, x);
succ = INDEX_EDGE_SUCC_BB (edge_list, x);
if (succ == EXIT_BLOCK_PTR)
- sbitmap_copy (farthest[x], st_avout[pred->index]);
+ bitmap_copy (farthest[x], st_avout[pred->index]);
else
{
if (pred == ENTRY_BLOCK_PTR)
- sbitmap_zero (farthest[x]);
+ bitmap_clear (farthest[x]);
else
{
- sbitmap_difference (difference, st_avout[pred->index],
+ bitmap_and_compl (difference, st_avout[pred->index],
st_antin[succ->index]);
- sbitmap_not (temp_bitmap, st_avin[succ->index]);
- sbitmap_a_and_b_or_c (farthest[x], difference,
+ bitmap_not (temp_bitmap, st_avin[succ->index]);
+ bitmap_and_or (farthest[x], difference,
kill[succ->index], temp_bitmap);
}
}
@@ -619,14 +619,14 @@ compute_nearerout (struct edge_list *edge_list, sbitmap *farthest,
INDEX_EDGE (edge_list, i)->aux = (void *) (size_t) i;
/* We want a maximal solution. */
- sbitmap_vector_ones (nearer, num_edges);
+ bitmap_vector_ones (nearer, num_edges);
/* Note that even though we want an optimistic setting of NEARER, we
do not want to be overly optimistic. Consider an incoming edge to
the exit block. That edge should always have a NEARER value the
same as FARTHEST for that edge. */
FOR_EACH_EDGE (e, ei, EXIT_BLOCK_PTR->preds)
- sbitmap_copy (nearer[(size_t)e->aux], farthest[(size_t)e->aux]);
+ bitmap_copy (nearer[(size_t)e->aux], farthest[(size_t)e->aux]);
/* Add all the blocks to the worklist. This prevents an early exit
from the loop given our optimistic initialization of NEARER. */
@@ -644,14 +644,14 @@ compute_nearerout (struct edge_list *edge_list, sbitmap *farthest,
bb->aux = NULL;
/* Compute the intersection of NEARER for each outgoing edge from B. */
- sbitmap_ones (nearerout[bb->index]);
+ bitmap_ones (nearerout[bb->index]);
FOR_EACH_EDGE (e, ei, bb->succs)
- sbitmap_a_and_b (nearerout[bb->index], nearerout[bb->index],
+ bitmap_and (nearerout[bb->index], nearerout[bb->index],
nearer[(size_t) e->aux]);
/* Calculate NEARER for all incoming edges. */
FOR_EACH_EDGE (e, ei, bb->preds)
- if (sbitmap_union_of_diff_cg (nearer[(size_t) e->aux],
+ if (bitmap_ior_and_compl (nearer[(size_t) e->aux],
farthest[(size_t) e->aux],
nearerout[e->dest->index],
st_avloc[e->dest->index])
@@ -667,9 +667,9 @@ compute_nearerout (struct edge_list *edge_list, sbitmap *farthest,
/* Computation of insertion and deletion points requires computing NEAREROUT
for the ENTRY block. We allocated an extra entry in the NEAREROUT array
for just this purpose. */
- sbitmap_ones (nearerout[last_basic_block]);
+ bitmap_ones (nearerout[last_basic_block]);
FOR_EACH_EDGE (e, ei, ENTRY_BLOCK_PTR->succs)
- sbitmap_a_and_b (nearerout[last_basic_block],
+ bitmap_and (nearerout[last_basic_block],
nearerout[last_basic_block],
nearer[(size_t) e->aux]);
@@ -688,16 +688,16 @@ compute_rev_insert_delete (struct edge_list *edge_list, sbitmap *st_avloc,
basic_block bb;
FOR_EACH_BB (bb)
- sbitmap_difference (del[bb->index], st_avloc[bb->index],
+ bitmap_and_compl (del[bb->index], st_avloc[bb->index],
nearerout[bb->index]);
for (x = 0; x < NUM_EDGES (edge_list); x++)
{
basic_block b = INDEX_EDGE_PRED_BB (edge_list, x);
if (b == ENTRY_BLOCK_PTR)
- sbitmap_difference (insert[x], nearer[x], nearerout[last_basic_block]);
+ bitmap_and_compl (insert[x], nearer[x], nearerout[last_basic_block]);
else
- sbitmap_difference (insert[x], nearer[x], nearerout[b->index]);
+ bitmap_and_compl (insert[x], nearer[x], nearerout[b->index]);
}
}
@@ -722,8 +722,8 @@ pre_edge_rev_lcm (int n_exprs, sbitmap *transp,
st_antin = sbitmap_vector_alloc (last_basic_block, n_exprs);
st_antout = sbitmap_vector_alloc (last_basic_block, n_exprs);
- sbitmap_vector_zero (st_antin, last_basic_block);
- sbitmap_vector_zero (st_antout, last_basic_block);
+ bitmap_vector_clear (st_antin, last_basic_block);
+ bitmap_vector_clear (st_antout, last_basic_block);
compute_antinout_edge (st_antloc, transp, st_antin, st_antout);
/* Compute global anticipatability. */
@@ -737,20 +737,20 @@ pre_edge_rev_lcm (int n_exprs, sbitmap *transp,
fprintf (dump_file, "Edge List:\n");
verify_edge_list (dump_file, edge_list);
print_edge_list (dump_file, edge_list);
- dump_sbitmap_vector (dump_file, "transp", "", transp, last_basic_block);
- dump_sbitmap_vector (dump_file, "st_avloc", "", st_avloc, last_basic_block);
- dump_sbitmap_vector (dump_file, "st_antloc", "", st_antloc, last_basic_block);
- dump_sbitmap_vector (dump_file, "st_antin", "", st_antin, last_basic_block);
- dump_sbitmap_vector (dump_file, "st_antout", "", st_antout, last_basic_block);
- dump_sbitmap_vector (dump_file, "st_kill", "", kill, last_basic_block);
+ dump_bitmap_vector (dump_file, "transp", "", transp, last_basic_block);
+ dump_bitmap_vector (dump_file, "st_avloc", "", st_avloc, last_basic_block);
+ dump_bitmap_vector (dump_file, "st_antloc", "", st_antloc, last_basic_block);
+ dump_bitmap_vector (dump_file, "st_antin", "", st_antin, last_basic_block);
+ dump_bitmap_vector (dump_file, "st_antout", "", st_antout, last_basic_block);
+ dump_bitmap_vector (dump_file, "st_kill", "", kill, last_basic_block);
}
#endif
#ifdef LCM_DEBUG_INFO
if (dump_file)
{
- dump_sbitmap_vector (dump_file, "st_avout", "", st_avout, last_basic_block);
- dump_sbitmap_vector (dump_file, "st_avin", "", st_avin, last_basic_block);
+ dump_bitmap_vector (dump_file, "st_avout", "", st_avout, last_basic_block);
+ dump_bitmap_vector (dump_file, "st_avin", "", st_avin, last_basic_block);
}
#endif
@@ -761,7 +761,7 @@ pre_edge_rev_lcm (int n_exprs, sbitmap *transp,
#ifdef LCM_DEBUG_INFO
if (dump_file)
- dump_sbitmap_vector (dump_file, "farthest", "", farthest, num_edges);
+ dump_bitmap_vector (dump_file, "farthest", "", farthest, num_edges);
#endif
sbitmap_vector_free (st_antin);
@@ -779,9 +779,9 @@ pre_edge_rev_lcm (int n_exprs, sbitmap *transp,
#ifdef LCM_DEBUG_INFO
if (dump_file)
{
- dump_sbitmap_vector (dump_file, "nearerout", "", nearerout,
+ dump_bitmap_vector (dump_file, "nearerout", "", nearerout,
last_basic_block + 1);
- dump_sbitmap_vector (dump_file, "nearer", "", nearer, num_edges);
+ dump_bitmap_vector (dump_file, "nearer", "", nearer, num_edges);
}
#endif
@@ -798,8 +798,8 @@ pre_edge_rev_lcm (int n_exprs, sbitmap *transp,
#ifdef LCM_DEBUG_INFO
if (dump_file)
{
- dump_sbitmap_vector (dump_file, "pre_insert_map", "", *insert, num_edges);
- dump_sbitmap_vector (dump_file, "pre_delete_map", "", *del,
+ dump_bitmap_vector (dump_file, "pre_insert_map", "", *insert, num_edges);
+ dump_bitmap_vector (dump_file, "pre_delete_map", "", *del,
last_basic_block);
}
#endif
diff --git a/gcc/loop-unroll.c b/gcc/loop-unroll.c
index a539b42a3da..9506b3d6bbe 100644
--- a/gcc/loop-unroll.c
+++ b/gcc/loop-unroll.c
@@ -465,7 +465,7 @@ peel_loop_completely (struct loop *loop)
bool ok;
wont_exit = sbitmap_alloc (npeel + 1);
- sbitmap_ones (wont_exit);
+ bitmap_ones (wont_exit);
RESET_BIT (wont_exit, 0);
if (desc->noloop_assumptions)
RESET_BIT (wont_exit, 1);
@@ -655,7 +655,7 @@ unroll_loop_constant_iterations (struct loop *loop)
exit_mod = niter % (max_unroll + 1);
wont_exit = sbitmap_alloc (max_unroll + 1);
- sbitmap_ones (wont_exit);
+ bitmap_ones (wont_exit);
remove_edges = NULL;
if (flag_split_ivs_in_unroller
@@ -1066,7 +1066,7 @@ unroll_loop_runtime_iterations (struct loop *loop)
here; the only exception is when we have extra zero check and the number
of iterations is reliable. Also record the place of (possible) extra
zero check. */
- sbitmap_zero (wont_exit);
+ bitmap_clear (wont_exit);
if (extra_zero_check
&& !desc->noloop_assumptions)
SET_BIT (wont_exit, 1);
@@ -1083,7 +1083,7 @@ unroll_loop_runtime_iterations (struct loop *loop)
for (i = 0; i < n_peel; i++)
{
/* Peel the copy. */
- sbitmap_zero (wont_exit);
+ bitmap_clear (wont_exit);
if (i != n_peel - 1 || !last_may_exit)
SET_BIT (wont_exit, 1);
ok = duplicate_loop_to_header_edge (loop, loop_preheader_edge (loop),
@@ -1139,7 +1139,7 @@ unroll_loop_runtime_iterations (struct loop *loop)
/* And unroll loop. */
- sbitmap_ones (wont_exit);
+ bitmap_ones (wont_exit);
RESET_BIT (wont_exit, may_exit_copy);
opt_info_start_duplication (opt_info);
@@ -1340,7 +1340,7 @@ peel_loop_simple (struct loop *loop)
opt_info = analyze_insns_in_loop (loop);
wont_exit = sbitmap_alloc (npeel + 1);
- sbitmap_zero (wont_exit);
+ bitmap_clear (wont_exit);
opt_info_start_duplication (opt_info);
@@ -1498,7 +1498,7 @@ unroll_loop_stupid (struct loop *loop)
wont_exit = sbitmap_alloc (nunroll + 1);
- sbitmap_zero (wont_exit);
+ bitmap_clear (wont_exit);
opt_info_start_duplication (opt_info);
ok = duplicate_loop_to_header_edge (loop, loop_latch_edge (loop),
diff --git a/gcc/lower-subreg.c b/gcc/lower-subreg.c
index ab4ca36cdcb..06c0b577a02 100644
--- a/gcc/lower-subreg.c
+++ b/gcc/lower-subreg.c
@@ -1485,7 +1485,7 @@ decompose_multiword_subregs (bool decompose_copies)
propagate_pseudo_copies ();
sub_blocks = sbitmap_alloc (last_basic_block);
- sbitmap_zero (sub_blocks);
+ bitmap_clear (sub_blocks);
EXECUTE_IF_SET_IN_BITMAP (decomposable_context, 0, regno, iter)
decompose_register (regno);
diff --git a/gcc/lra-lives.c b/gcc/lra-lives.c
index 6e00250c7ed..501e205ffd5 100644
--- a/gcc/lra-lives.c
+++ b/gcc/lra-lives.c
@@ -772,8 +772,8 @@ remove_some_program_points_and_update_live_ranges (void)
born = sbitmap_alloc (lra_live_max_point);
dead = sbitmap_alloc (lra_live_max_point);
- sbitmap_zero (born);
- sbitmap_zero (dead);
+ bitmap_clear (born);
+ bitmap_clear (dead);
max_regno = max_reg_num ();
for (i = FIRST_PSEUDO_REGISTER; i < (unsigned) max_regno; i++)
{
@@ -785,7 +785,7 @@ remove_some_program_points_and_update_live_ranges (void)
}
}
born_or_dead = sbitmap_alloc (lra_live_max_point);
- sbitmap_a_or_b (born_or_dead, born, dead);
+ bitmap_ior (born_or_dead, born, dead);
map = XCNEWVEC (int, lra_live_max_point);
n = -1;
prev_born_p = prev_dead_p = false;
diff --git a/gcc/lra.c b/gcc/lra.c
index 33f48d5d4e4..c1cc64e8fed 100644
--- a/gcc/lra.c
+++ b/gcc/lra.c
@@ -2259,7 +2259,7 @@ lra (FILE *f)
df_set_flags (DF_NO_INSN_RESCAN);
lra_constraint_insn_stack = VEC_alloc (rtx, heap, get_max_uid ());
lra_constraint_insn_stack_bitmap = sbitmap_alloc (get_max_uid ());
- sbitmap_zero (lra_constraint_insn_stack_bitmap);
+ bitmap_clear (lra_constraint_insn_stack_bitmap);
lra_live_ranges_init ();
lra_constraints_init ();
lra_curr_reload_num = 0;
@@ -2355,7 +2355,7 @@ lra (FILE *f)
{
sbitmap blocks;
blocks = sbitmap_alloc (last_basic_block);
- sbitmap_ones (blocks);
+ bitmap_ones (blocks);
find_many_sub_basic_blocks (blocks);
sbitmap_free (blocks);
}
diff --git a/gcc/mode-switching.c b/gcc/mode-switching.c
index 1984a694c89..61afdc87835 100644
--- a/gcc/mode-switching.c
+++ b/gcc/mode-switching.c
@@ -482,7 +482,7 @@ optimize_mode_switching (void)
transp = sbitmap_vector_alloc (last_basic_block, n_entities);
comp = sbitmap_vector_alloc (last_basic_block, n_entities);
- sbitmap_vector_ones (transp, last_basic_block);
+ bitmap_vector_ones (transp, last_basic_block);
for (j = n_entities - 1; j >= 0; j--)
{
@@ -591,8 +591,8 @@ optimize_mode_switching (void)
sbitmap *insert;
/* Set the anticipatable and computing arrays. */
- sbitmap_vector_zero (antic, last_basic_block);
- sbitmap_vector_zero (comp, last_basic_block);
+ bitmap_vector_clear (antic, last_basic_block);
+ bitmap_vector_clear (comp, last_basic_block);
for (j = n_entities - 1; j >= 0; j--)
{
int m = current_mode[j] = MODE_PRIORITY_TO_MODE (entity_map[j], i);
@@ -612,7 +612,7 @@ optimize_mode_switching (void)
placement mode switches to modes with priority I. */
FOR_EACH_BB (bb)
- sbitmap_not (kill[bb->index], transp[bb->index]);
+ bitmap_not (kill[bb->index], transp[bb->index]);
edge_list = pre_edge_lcm (n_entities, transp, comp, antic,
kill, &insert, &del);
diff --git a/gcc/modulo-sched.c b/gcc/modulo-sched.c
index 34d2e830225..88ac28d5907 100644
--- a/gcc/modulo-sched.c
+++ b/gcc/modulo-sched.c
@@ -643,7 +643,7 @@ schedule_reg_move (partial_schedule_ptr ps, int i_reg_move,
fprintf (dump_file, "%11d %11d %5s %s\n", start, end, "", "(max, min)");
}
- sbitmap_zero (must_follow);
+ bitmap_clear (must_follow);
SET_BIT (must_follow, move->def);
start = MAX (start, end - (ii - 1));
@@ -767,7 +767,7 @@ schedule_reg_moves (partial_schedule_ptr ps)
move->new_reg = gen_reg_rtx (GET_MODE (prev_reg));
move->num_consecutive_stages = distances[0] && distances[1] ? 2 : 1;
move->insn = gen_move_insn (move->new_reg, copy_rtx (prev_reg));
- sbitmap_zero (move->uses);
+ bitmap_clear (move->uses);
prev_reg = move->new_reg;
}
@@ -982,7 +982,7 @@ optimize_sc (partial_schedule_ptr ps, ddg_ptr g)
goto clear;
}
- sbitmap_ones (sched_nodes);
+ bitmap_ones (sched_nodes);
/* Calculate the new placement of the branch. It should be in row
ii-1 and fall into it's scheduling window. */
@@ -1880,10 +1880,10 @@ get_sched_window (partial_schedule_ptr ps, ddg_node_ptr u_node,
int count_succs;
/* 1. compute sched window for u (start, end, step). */
- sbitmap_zero (psp);
- sbitmap_zero (pss);
- psp_not_empty = sbitmap_a_and_b_cg (psp, u_node_preds, sched_nodes);
- pss_not_empty = sbitmap_a_and_b_cg (pss, u_node_succs, sched_nodes);
+ bitmap_clear (psp);
+ bitmap_clear (pss);
+ psp_not_empty = bitmap_and (psp, u_node_preds, sched_nodes);
+ pss_not_empty = bitmap_and (pss, u_node_succs, sched_nodes);
/* We first compute a forward range (start <= end), then decide whether
to reverse it. */
@@ -2050,8 +2050,8 @@ calculate_must_precede_follow (ddg_node_ptr u_node, int start, int end,
first_cycle_in_window = (step == 1) ? start : end - step;
last_cycle_in_window = (step == 1) ? end - step : start;
- sbitmap_zero (must_precede);
- sbitmap_zero (must_follow);
+ bitmap_clear (must_precede);
+ bitmap_clear (must_follow);
if (dump_file)
fprintf (dump_file, "\nmust_precede: ");
@@ -2159,8 +2159,8 @@ sms_schedule_by_order (ddg_ptr g, int mii, int maxii, int *nodes_order)
partial_schedule_ptr ps = create_partial_schedule (ii, g, DFA_HISTORY);
- sbitmap_ones (tobe_scheduled);
- sbitmap_zero (sched_nodes);
+ bitmap_ones (tobe_scheduled);
+ bitmap_clear (sched_nodes);
while (flush_and_start_over && (ii < maxii))
{
@@ -2168,7 +2168,7 @@ sms_schedule_by_order (ddg_ptr g, int mii, int maxii, int *nodes_order)
if (dump_file)
fprintf (dump_file, "Starting with ii=%d\n", ii);
flush_and_start_over = false;
- sbitmap_zero (sched_nodes);
+ bitmap_clear (sched_nodes);
for (i = 0; i < num_nodes; i++)
{
@@ -2264,7 +2264,7 @@ sms_schedule_by_order (ddg_ptr g, int mii, int maxii, int *nodes_order)
ps = NULL;
}
else
- gcc_assert (sbitmap_equal (tobe_scheduled, sched_nodes));
+ gcc_assert (bitmap_equal_p (tobe_scheduled, sched_nodes));
sbitmap_free (sched_nodes);
sbitmap_free (must_precede);
@@ -2482,7 +2482,7 @@ check_nodes_order (int *node_order, int num_nodes)
int i;
sbitmap tmp = sbitmap_alloc (num_nodes);
- sbitmap_zero (tmp);
+ bitmap_clear (tmp);
if (dump_file)
fprintf (dump_file, "SMS final nodes order: \n");
@@ -2550,8 +2550,8 @@ order_nodes_of_sccs (ddg_all_sccs_ptr all_sccs, int * node_order)
sbitmap tmp = sbitmap_alloc (num_nodes);
sbitmap ones = sbitmap_alloc (num_nodes);
- sbitmap_zero (prev_sccs);
- sbitmap_ones (ones);
+ bitmap_clear (prev_sccs);
+ bitmap_ones (ones);
/* Perform the node ordering starting from the SCC with the highest recMII.
For each SCC order the nodes according to their ASAP/ALAP/HEIGHT etc. */
@@ -2561,14 +2561,14 @@ order_nodes_of_sccs (ddg_all_sccs_ptr all_sccs, int * node_order)
/* Add nodes on paths from previous SCCs to the current SCC. */
find_nodes_on_paths (on_path, g, prev_sccs, scc->nodes);
- sbitmap_a_or_b (tmp, scc->nodes, on_path);
+ bitmap_ior (tmp, scc->nodes, on_path);
/* Add nodes on paths from the current SCC to previous SCCs. */
find_nodes_on_paths (on_path, g, scc->nodes, prev_sccs);
- sbitmap_a_or_b (tmp, tmp, on_path);
+ bitmap_ior (tmp, tmp, on_path);
/* Remove nodes of previous SCCs from current extended SCC. */
- sbitmap_difference (tmp, tmp, prev_sccs);
+ bitmap_and_compl (tmp, tmp, prev_sccs);
pos = order_nodes_in_scc (g, prev_sccs, tmp, node_order, pos);
/* Above call to order_nodes_in_scc updated prev_sccs |= tmp. */
@@ -2578,7 +2578,7 @@ order_nodes_of_sccs (ddg_all_sccs_ptr all_sccs, int * node_order)
to order_nodes_in_scc handles a single connected component. */
while (pos < g->num_nodes)
{
- sbitmap_difference (tmp, ones, prev_sccs);
+ bitmap_and_compl (tmp, ones, prev_sccs);
pos = order_nodes_in_scc (g, prev_sccs, tmp, node_order, pos);
}
sbitmap_free (prev_sccs);
@@ -2751,35 +2751,35 @@ order_nodes_in_scc (ddg_ptr g, sbitmap nodes_ordered, sbitmap scc,
sbitmap predecessors = sbitmap_alloc (num_nodes);
sbitmap successors = sbitmap_alloc (num_nodes);
- sbitmap_zero (predecessors);
+ bitmap_clear (predecessors);
find_predecessors (predecessors, g, nodes_ordered);
- sbitmap_zero (successors);
+ bitmap_clear (successors);
find_successors (successors, g, nodes_ordered);
- sbitmap_zero (tmp);
- if (sbitmap_a_and_b_cg (tmp, predecessors, scc))
+ bitmap_clear (tmp);
+ if (bitmap_and (tmp, predecessors, scc))
{
- sbitmap_copy (workset, tmp);
+ bitmap_copy (workset, tmp);
dir = BOTTOMUP;
}
- else if (sbitmap_a_and_b_cg (tmp, successors, scc))
+ else if (bitmap_and (tmp, successors, scc))
{
- sbitmap_copy (workset, tmp);
+ bitmap_copy (workset, tmp);
dir = TOPDOWN;
}
else
{
int u;
- sbitmap_zero (workset);
+ bitmap_clear (workset);
if ((u = find_max_asap (g, scc)) >= 0)
SET_BIT (workset, u);
dir = BOTTOMUP;
}
- sbitmap_zero (zero_bitmap);
- while (!sbitmap_equal (workset, zero_bitmap))
+ bitmap_clear (zero_bitmap);
+ while (!bitmap_equal_p (workset, zero_bitmap))
{
int v;
ddg_node_ptr v_node;
@@ -2788,45 +2788,45 @@ order_nodes_in_scc (ddg_ptr g, sbitmap nodes_ordered, sbitmap scc,
if (dir == TOPDOWN)
{
- while (!sbitmap_equal (workset, zero_bitmap))
+ while (!bitmap_equal_p (workset, zero_bitmap))
{
v = find_max_hv_min_mob (g, workset);
v_node = &g->nodes[v];
node_order[pos++] = v;
v_node_succs = NODE_SUCCESSORS (v_node);
- sbitmap_a_and_b (tmp, v_node_succs, scc);
+ bitmap_and (tmp, v_node_succs, scc);
/* Don't consider the already ordered successors again. */
- sbitmap_difference (tmp, tmp, nodes_ordered);
- sbitmap_a_or_b (workset, workset, tmp);
+ bitmap_and_compl (tmp, tmp, nodes_ordered);
+ bitmap_ior (workset, workset, tmp);
RESET_BIT (workset, v);
SET_BIT (nodes_ordered, v);
}
dir = BOTTOMUP;
- sbitmap_zero (predecessors);
+ bitmap_clear (predecessors);
find_predecessors (predecessors, g, nodes_ordered);
- sbitmap_a_and_b (workset, predecessors, scc);
+ bitmap_and (workset, predecessors, scc);
}
else
{
- while (!sbitmap_equal (workset, zero_bitmap))
+ while (!bitmap_equal_p (workset, zero_bitmap))
{
v = find_max_dv_min_mob (g, workset);
v_node = &g->nodes[v];
node_order[pos++] = v;
v_node_preds = NODE_PREDECESSORS (v_node);
- sbitmap_a_and_b (tmp, v_node_preds, scc);
+ bitmap_and (tmp, v_node_preds, scc);
/* Don't consider the already ordered predecessors again. */
- sbitmap_difference (tmp, tmp, nodes_ordered);
- sbitmap_a_or_b (workset, workset, tmp);
+ bitmap_and_compl (tmp, tmp, nodes_ordered);
+ bitmap_ior (workset, workset, tmp);
RESET_BIT (workset, v);
SET_BIT (nodes_ordered, v);
}
dir = TOPDOWN;
- sbitmap_zero (successors);
+ bitmap_clear (successors);
find_successors (successors, g, nodes_ordered);
- sbitmap_a_and_b (workset, successors, scc);
+ bitmap_and (workset, successors, scc);
}
}
sbitmap_free (tmp);
diff --git a/gcc/recog.c b/gcc/recog.c
index 466ac6c3e2a..4186183ee54 100644
--- a/gcc/recog.c
+++ b/gcc/recog.c
@@ -2874,7 +2874,7 @@ split_all_insns (void)
basic_block bb;
blocks = sbitmap_alloc (last_basic_block);
- sbitmap_zero (blocks);
+ bitmap_clear (blocks);
changed = false;
FOR_EACH_BB_REVERSE (bb)
diff --git a/gcc/regcprop.c b/gcc/regcprop.c
index 3cda1a7c24e..c2fc79dbfdb 100644
--- a/gcc/regcprop.c
+++ b/gcc/regcprop.c
@@ -1045,7 +1045,7 @@ copyprop_hardreg_forward (void)
all_vd = XNEWVEC (struct value_data, last_basic_block);
visited = sbitmap_alloc (last_basic_block);
- sbitmap_zero (visited);
+ bitmap_clear (visited);
if (MAY_HAVE_DEBUG_INSNS)
debug_insn_changes_pool
diff --git a/gcc/reload1.c b/gcc/reload1.c
index c4c1426b43a..03bd7247795 100644
--- a/gcc/reload1.c
+++ b/gcc/reload1.c
@@ -1302,7 +1302,7 @@ reload (rtx first, int global)
{
sbitmap blocks;
blocks = sbitmap_alloc (last_basic_block);
- sbitmap_ones (blocks);
+ bitmap_ones (blocks);
find_many_sub_basic_blocks (blocks);
sbitmap_free (blocks);
}
diff --git a/gcc/sbitmap.c b/gcc/sbitmap.c
index 6aac459f826..737b0cd7fa7 100644
--- a/gcc/sbitmap.c
+++ b/gcc/sbitmap.c
@@ -238,7 +238,7 @@ sbitmap_vector_alloc (unsigned int n_vecs, unsigned int n_elms)
/* Copy sbitmap SRC to DST. */
void
-sbitmap_copy (sbitmap dst, const_sbitmap src)
+bitmap_copy (sbitmap dst, const_sbitmap src)
{
memcpy (dst->elms, src->elms, sizeof (SBITMAP_ELT_TYPE) * dst->size);
if (dst->popcount)
@@ -248,7 +248,7 @@ sbitmap_copy (sbitmap dst, const_sbitmap src)
/* Copy the first N elements of sbitmap SRC to DST. */
void
-sbitmap_copy_n (sbitmap dst, const_sbitmap src, unsigned int n)
+bitmap_copy_n (sbitmap dst, const_sbitmap src, unsigned int n)
{
memcpy (dst->elms, src->elms, sizeof (SBITMAP_ELT_TYPE) * n);
if (dst->popcount)
@@ -257,7 +257,7 @@ sbitmap_copy_n (sbitmap dst, const_sbitmap src, unsigned int n)
/* Determine if a == b. */
int
-sbitmap_equal (const_sbitmap a, const_sbitmap b)
+bitmap_equal_p (const_sbitmap a, const_sbitmap b)
{
return !memcmp (a->elms, b->elms, sizeof (SBITMAP_ELT_TYPE) * a->size);
}
@@ -265,7 +265,7 @@ sbitmap_equal (const_sbitmap a, const_sbitmap b)
/* Return true if the bitmap is empty. */
bool
-sbitmap_empty_p (const_sbitmap bmap)
+bitmap_empty_p (const_sbitmap bmap)
{
unsigned int i;
for (i=0; i<bmap->size; i++)
@@ -279,7 +279,7 @@ sbitmap_empty_p (const_sbitmap bmap)
START. */
bool
-sbitmap_range_empty_p (const_sbitmap bmap, unsigned int start, unsigned int n)
+bitmap_range_empty_p (const_sbitmap bmap, unsigned int start, unsigned int n)
{
unsigned int i = start / SBITMAP_ELT_BITS;
SBITMAP_ELT_TYPE elm;
@@ -329,7 +329,7 @@ sbitmap_range_empty_p (const_sbitmap bmap, unsigned int start, unsigned int n)
/* Zero all elements in a bitmap. */
void
-sbitmap_zero (sbitmap bmap)
+bitmap_clear (sbitmap bmap)
{
memset (bmap->elms, 0, SBITMAP_SIZE_BYTES (bmap));
if (bmap->popcount)
@@ -339,7 +339,7 @@ sbitmap_zero (sbitmap bmap)
/* Set all elements in a bitmap to ones. */
void
-sbitmap_ones (sbitmap bmap)
+bitmap_ones (sbitmap bmap)
{
unsigned int last_bit;
@@ -361,23 +361,23 @@ sbitmap_ones (sbitmap bmap)
/* Zero a vector of N_VECS bitmaps. */
void
-sbitmap_vector_zero (sbitmap *bmap, unsigned int n_vecs)
+bitmap_vector_clear (sbitmap *bmap, unsigned int n_vecs)
{
unsigned int i;
for (i = 0; i < n_vecs; i++)
- sbitmap_zero (bmap[i]);
+ bitmap_clear (bmap[i]);
}
/* Set a vector of N_VECS bitmaps to ones. */
void
-sbitmap_vector_ones (sbitmap *bmap, unsigned int n_vecs)
+bitmap_vector_ones (sbitmap *bmap, unsigned int n_vecs)
{
unsigned int i;
for (i = 0; i < n_vecs; i++)
- sbitmap_ones (bmap[i]);
+ bitmap_ones (bmap[i]);
}
/* Set DST to be A union (B - C).
@@ -385,7 +385,7 @@ sbitmap_vector_ones (sbitmap *bmap, unsigned int n_vecs)
Returns true if any change is made. */
bool
-sbitmap_union_of_diff_cg (sbitmap dst, const_sbitmap a, const_sbitmap b, const_sbitmap c)
+bitmap_ior_and_compl (sbitmap dst, const_sbitmap a, const_sbitmap b, const_sbitmap c)
{
unsigned int i, n = dst->size;
sbitmap_ptr dstp = dst->elms;
@@ -406,26 +406,10 @@ sbitmap_union_of_diff_cg (sbitmap dst, const_sbitmap a, const_sbitmap b, const_s
return changed != 0;
}
-void
-sbitmap_union_of_diff (sbitmap dst, const_sbitmap a, const_sbitmap b, const_sbitmap c)
-{
- unsigned int i, n = dst->size;
- sbitmap_ptr dstp = dst->elms;
- const_sbitmap_ptr ap = a->elms;
- const_sbitmap_ptr bp = b->elms;
- const_sbitmap_ptr cp = c->elms;
-
- gcc_assert (!dst->popcount && !a->popcount
- && !b->popcount && !c->popcount);
-
- for (i = 0; i < n; i++)
- *dstp++ = *ap++ | (*bp++ & ~*cp++);
-}
-
/* Set bitmap DST to the bitwise negation of the bitmap SRC. */
void
-sbitmap_not (sbitmap dst, const_sbitmap src)
+bitmap_not (sbitmap dst, const_sbitmap src)
{
unsigned int i, n = dst->size;
sbitmap_ptr dstp = dst->elms;
@@ -437,7 +421,7 @@ sbitmap_not (sbitmap dst, const_sbitmap src)
for (i = 0; i < n; i++)
*dstp++ = ~*srcp++;
- /* Zero all bits past n_bits, by ANDing dst with sbitmap_ones. */
+ /* Zero all bits past n_bits, by ANDing dst with bitmap_ones. */
last_bit = src->n_bits % SBITMAP_ELT_BITS;
if (last_bit)
dst->elms[n-1] = dst->elms[n-1]
@@ -448,7 +432,7 @@ sbitmap_not (sbitmap dst, const_sbitmap src)
in A and the bits in B. i.e. dst = a & (~b). */
void
-sbitmap_difference (sbitmap dst, const_sbitmap a, const_sbitmap b)
+bitmap_and_compl (sbitmap dst, const_sbitmap a, const_sbitmap b)
{
unsigned int i, dst_size = dst->size;
unsigned int min_size = dst->size;
@@ -477,7 +461,7 @@ sbitmap_difference (sbitmap dst, const_sbitmap a, const_sbitmap b)
Return false otherwise. */
bool
-sbitmap_any_common_bits (const_sbitmap a, const_sbitmap b)
+bitmap_intersect_p (const_sbitmap a, const_sbitmap b)
{
const_sbitmap_ptr ap = a->elms;
const_sbitmap_ptr bp = b->elms;
@@ -495,28 +479,7 @@ sbitmap_any_common_bits (const_sbitmap a, const_sbitmap b)
Return nonzero if any change is made. */
bool
-sbitmap_a_and_b_cg (sbitmap dst, const_sbitmap a, const_sbitmap b)
-{
- unsigned int i, n = dst->size;
- sbitmap_ptr dstp = dst->elms;
- const_sbitmap_ptr ap = a->elms;
- const_sbitmap_ptr bp = b->elms;
- SBITMAP_ELT_TYPE changed = 0;
-
- gcc_assert (!dst->popcount);
-
- for (i = 0; i < n; i++)
- {
- const SBITMAP_ELT_TYPE tmp = *ap++ & *bp++;
- changed |= *dstp ^ tmp;
- *dstp++ = tmp;
- }
-
- return changed != 0;
-}
-
-void
-sbitmap_a_and_b (sbitmap dst, const_sbitmap a, const_sbitmap b)
+bitmap_and (sbitmap dst, const_sbitmap a, const_sbitmap b)
{
unsigned int i, n = dst->size;
sbitmap_ptr dstp = dst->elms;
@@ -524,6 +487,7 @@ sbitmap_a_and_b (sbitmap dst, const_sbitmap a, const_sbitmap b)
const_sbitmap_ptr bp = b->elms;
bool has_popcount = dst->popcount != NULL;
unsigned char *popcountp = dst->popcount;
+ bool anychange = false;
for (i = 0; i < n; i++)
{
@@ -532,7 +496,10 @@ sbitmap_a_and_b (sbitmap dst, const_sbitmap a, const_sbitmap b)
{
bool wordchanged = (*dstp ^ tmp) != 0;
if (wordchanged)
- *popcountp = do_popcount (tmp);
+ {
+ *popcountp = do_popcount (tmp);
+ anychange = true;
+ }
popcountp++;
}
*dstp++ = tmp;
@@ -541,34 +508,14 @@ sbitmap_a_and_b (sbitmap dst, const_sbitmap a, const_sbitmap b)
if (has_popcount)
sbitmap_verify_popcount (dst);
#endif
+ return anychange;
}
/* Set DST to be (A xor B)).
Return nonzero if any change is made. */
bool
-sbitmap_a_xor_b_cg (sbitmap dst, const_sbitmap a, const_sbitmap b)
-{
- unsigned int i, n = dst->size;
- sbitmap_ptr dstp = dst->elms;
- const_sbitmap_ptr ap = a->elms;
- const_sbitmap_ptr bp = b->elms;
- SBITMAP_ELT_TYPE changed = 0;
-
- gcc_assert (!dst->popcount);
-
- for (i = 0; i < n; i++)
- {
- const SBITMAP_ELT_TYPE tmp = *ap++ ^ *bp++;
- changed |= *dstp ^ tmp;
- *dstp++ = tmp;
- }
-
- return changed != 0;
-}
-
-void
-sbitmap_a_xor_b (sbitmap dst, const_sbitmap a, const_sbitmap b)
+bitmap_xor (sbitmap dst, const_sbitmap a, const_sbitmap b)
{
unsigned int i, n = dst->size;
sbitmap_ptr dstp = dst->elms;
@@ -576,6 +523,7 @@ sbitmap_a_xor_b (sbitmap dst, const_sbitmap a, const_sbitmap b)
const_sbitmap_ptr bp = b->elms;
bool has_popcount = dst->popcount != NULL;
unsigned char *popcountp = dst->popcount;
+ bool anychange = false;
for (i = 0; i < n; i++)
{
@@ -584,7 +532,10 @@ sbitmap_a_xor_b (sbitmap dst, const_sbitmap a, const_sbitmap b)
{
bool wordchanged = (*dstp ^ tmp) != 0;
if (wordchanged)
- *popcountp = do_popcount (tmp);
+ {
+ *popcountp = do_popcount (tmp);
+ anychange = true;
+ }
popcountp++;
}
*dstp++ = tmp;
@@ -593,34 +544,14 @@ sbitmap_a_xor_b (sbitmap dst, const_sbitmap a, const_sbitmap b)
if (has_popcount)
sbitmap_verify_popcount (dst);
#endif
+ return anychange;
}
/* Set DST to be (A or B)).
Return nonzero if any change is made. */
bool
-sbitmap_a_or_b_cg (sbitmap dst, const_sbitmap a, const_sbitmap b)
-{
- unsigned int i, n = dst->size;
- sbitmap_ptr dstp = dst->elms;
- const_sbitmap_ptr ap = a->elms;
- const_sbitmap_ptr bp = b->elms;
- SBITMAP_ELT_TYPE changed = 0;
-
- gcc_assert (!dst->popcount);
-
- for (i = 0; i < n; i++)
- {
- const SBITMAP_ELT_TYPE tmp = *ap++ | *bp++;
- changed |= *dstp ^ tmp;
- *dstp++ = tmp;
- }
-
- return changed != 0;
-}
-
-void
-sbitmap_a_or_b (sbitmap dst, const_sbitmap a, const_sbitmap b)
+bitmap_ior (sbitmap dst, const_sbitmap a, const_sbitmap b)
{
unsigned int i, n = dst->size;
sbitmap_ptr dstp = dst->elms;
@@ -628,6 +559,7 @@ sbitmap_a_or_b (sbitmap dst, const_sbitmap a, const_sbitmap b)
const_sbitmap_ptr bp = b->elms;
bool has_popcount = dst->popcount != NULL;
unsigned char *popcountp = dst->popcount;
+ bool anychange = false;
for (i = 0; i < n; i++)
{
@@ -636,7 +568,10 @@ sbitmap_a_or_b (sbitmap dst, const_sbitmap a, const_sbitmap b)
{
bool wordchanged = (*dstp ^ tmp) != 0;
if (wordchanged)
- *popcountp = do_popcount (tmp);
+ {
+ *popcountp = do_popcount (tmp);
+ anychange = true;
+ }
popcountp++;
}
*dstp++ = tmp;
@@ -645,12 +580,13 @@ sbitmap_a_or_b (sbitmap dst, const_sbitmap a, const_sbitmap b)
if (has_popcount)
sbitmap_verify_popcount (dst);
#endif
+ return anychange;
}
/* Return nonzero if A is a subset of B. */
bool
-sbitmap_a_subset_b_p (const_sbitmap a, const_sbitmap b)
+bitmap_subset_p (const_sbitmap a, const_sbitmap b)
{
unsigned int i, n = a->size;
const_sbitmap_ptr ap, bp;
@@ -666,7 +602,7 @@ sbitmap_a_subset_b_p (const_sbitmap a, const_sbitmap b)
Return nonzero if any change is made. */
bool
-sbitmap_a_or_b_and_c_cg (sbitmap dst, const_sbitmap a, const_sbitmap b, const_sbitmap c)
+bitmap_or_and (sbitmap dst, const_sbitmap a, const_sbitmap b, const_sbitmap c)
{
unsigned int i, n = dst->size;
sbitmap_ptr dstp = dst->elms;
@@ -687,26 +623,11 @@ sbitmap_a_or_b_and_c_cg (sbitmap dst, const_sbitmap a, const_sbitmap b, const_sb
return changed != 0;
}
-void
-sbitmap_a_or_b_and_c (sbitmap dst, const_sbitmap a, const_sbitmap b, const_sbitmap c)
-{
- unsigned int i, n = dst->size;
- sbitmap_ptr dstp = dst->elms;
- const_sbitmap_ptr ap = a->elms;
- const_sbitmap_ptr bp = b->elms;
- const_sbitmap_ptr cp = c->elms;
-
- gcc_assert (!dst->popcount);
-
- for (i = 0; i < n; i++)
- *dstp++ = *ap++ | (*bp++ & *cp++);
-}
-
/* Set DST to be (A and (B or C)).
Return nonzero if any change is made. */
bool
-sbitmap_a_and_b_or_c_cg (sbitmap dst, const_sbitmap a, const_sbitmap b, const_sbitmap c)
+bitmap_and_or (sbitmap dst, const_sbitmap a, const_sbitmap b, const_sbitmap c)
{
unsigned int i, n = dst->size;
sbitmap_ptr dstp = dst->elms;
@@ -727,23 +648,10 @@ sbitmap_a_and_b_or_c_cg (sbitmap dst, const_sbitmap a, const_sbitmap b, const_sb
return changed != 0;
}
-void
-sbitmap_a_and_b_or_c (sbitmap dst, const_sbitmap a, const_sbitmap b, const_sbitmap c)
-{
- unsigned int i, n = dst->size;
- sbitmap_ptr dstp = dst->elms;
- const_sbitmap_ptr ap = a->elms;
- const_sbitmap_ptr bp = b->elms;
- const_sbitmap_ptr cp = c->elms;
-
- for (i = 0; i < n; i++)
- *dstp++ = *ap++ & (*bp++ | *cp++);
-}
-
/* Return number of first bit set in the bitmap, -1 if none. */
int
-sbitmap_first_set_bit (const_sbitmap bmap)
+bitmap_first_set_bit (const_sbitmap bmap)
{
unsigned int n = 0;
sbitmap_iterator sbi;
@@ -756,7 +664,7 @@ sbitmap_first_set_bit (const_sbitmap bmap)
/* Return number of last bit set in the bitmap, -1 if none. */
int
-sbitmap_last_set_bit (const_sbitmap bmap)
+bitmap_last_set_bit (const_sbitmap bmap)
{
int i;
const SBITMAP_ELT_TYPE *const ptr = bmap->elms;
@@ -786,7 +694,7 @@ sbitmap_last_set_bit (const_sbitmap bmap)
}
void
-dump_sbitmap (FILE *file, const_sbitmap bmap)
+dump_bitmap (FILE *file, const_sbitmap bmap)
{
unsigned int i, n, j;
unsigned int set_size = bmap->size;
@@ -807,7 +715,7 @@ dump_sbitmap (FILE *file, const_sbitmap bmap)
}
void
-dump_sbitmap_file (FILE *file, const_sbitmap bmap)
+dump_bitmap_file (FILE *file, const_sbitmap bmap)
{
unsigned int i, pos;
@@ -830,13 +738,13 @@ dump_sbitmap_file (FILE *file, const_sbitmap bmap)
}
DEBUG_FUNCTION void
-debug_sbitmap (const_sbitmap bmap)
+debug_bitmap (const_sbitmap bmap)
{
- dump_sbitmap_file (stderr, bmap);
+ dump_bitmap_file (stderr, bmap);
}
void
-dump_sbitmap_vector (FILE *file, const char *title, const char *subtitle,
+dump_bitmap_vector (FILE *file, const char *title, const char *subtitle,
sbitmap *bmaps, int n_maps)
{
int i;
@@ -845,7 +753,7 @@ dump_sbitmap_vector (FILE *file, const char *title, const char *subtitle,
for (i = 0; i < n_maps; i++)
{
fprintf (file, "%s %d\n", subtitle, i);
- dump_sbitmap (file, bmaps[i]);
+ dump_bitmap (file, bmaps[i]);
}
fprintf (file, "\n");
diff --git a/gcc/sbitmap.h b/gcc/sbitmap.h
index 84aeb8718bc..f7fa7706d0a 100644
--- a/gcc/sbitmap.h
+++ b/gcc/sbitmap.h
@@ -41,24 +41,24 @@ along with GCC; see the file COPYING3. If not see
Most other operations on this set representation are O(U) where U is
the size of the set universe:
- * clear : sbitmap_zero
+ * clear : bitmap_clear
* cardinality : sbitmap_popcount
- * choose_one : sbitmap_first_set_bit /
- sbitmap_last_set_bit
+ * choose_one : bitmap_first_set_bit /
+ bitmap_last_set_bit
* forall : EXECUTE_IF_SET_IN_SBITMAP
- * set_copy : sbitmap_copy / sbitmap_copy_n
- * set_intersection : sbitmap_a_and_b
- * set_union : sbitmap_a_or_b
- * set_difference : sbitmap_difference
+ * set_copy : bitmap_copy / bitmap_copy_n
+ * set_intersection : bitmap_and
+ * set_union : bitmap_ior
+ * set_difference : bitmap_and_compl
* set_disjuction : (not implemented)
- * set_compare : sbitmap_equal
+ * set_compare : bitmap_equal_p
Some operations on 3 sets that occur frequently in in data flow problems
are also implemented:
- * A | (B & C) : sbitmap_a_or_b_and_c
- * A | (B & ~C) : sbitmap_union_of_diff
- * A & (B | C) : sbitmap_a_and_b_or_c
+ * A | (B & C) : bitmap_or_and
+ * A | (B & ~C) : bitmap_ior_and_compl
+ * A & (B | C) : bitmap_and_or
Most of the set functions have two variants: One that returns non-zero
if members were added or removed from the target set, and one that just
@@ -265,54 +265,53 @@ do { \
} \
} while (0)
-#define sbitmap_free(MAP) (free((MAP)->popcount), free((MAP)))
-#define sbitmap_vector_free(VEC) free(VEC)
+inline void sbitmap_free (sbitmap map)
+{
+ free (map->popcount);
+ free (map);
+}
-extern void dump_sbitmap (FILE *, const_sbitmap);
-extern void dump_sbitmap_file (FILE *, const_sbitmap);
-extern void dump_sbitmap_vector (FILE *, const char *, const char *, sbitmap *,
+inline void sbitmap_vector_free (sbitmap * vec)
+{
+ free (vec);
+}
+
+extern void dump_bitmap (FILE *, const_sbitmap);
+extern void dump_bitmap_file (FILE *, const_sbitmap);
+extern void dump_bitmap_vector (FILE *, const char *, const char *, sbitmap *,
int);
extern sbitmap sbitmap_alloc (unsigned int);
extern sbitmap sbitmap_alloc_with_popcount (unsigned int);
extern sbitmap *sbitmap_vector_alloc (unsigned int, unsigned int);
extern sbitmap sbitmap_resize (sbitmap, unsigned int, int);
-extern void sbitmap_copy (sbitmap, const_sbitmap);
-extern void sbitmap_copy_n (sbitmap, const_sbitmap, unsigned int);
-extern int sbitmap_equal (const_sbitmap, const_sbitmap);
-extern bool sbitmap_empty_p (const_sbitmap);
-extern bool sbitmap_range_empty_p (const_sbitmap, unsigned int, unsigned int);
-extern void sbitmap_zero (sbitmap);
-extern void sbitmap_ones (sbitmap);
-extern void sbitmap_vector_zero (sbitmap *, unsigned int);
-extern void sbitmap_vector_ones (sbitmap *, unsigned int);
-
-extern void sbitmap_union_of_diff (sbitmap, const_sbitmap,
- const_sbitmap, const_sbitmap);
-extern bool sbitmap_union_of_diff_cg (sbitmap, const_sbitmap,
+extern void bitmap_copy (sbitmap, const_sbitmap);
+extern void bitmap_copy_n (sbitmap, const_sbitmap, unsigned int);
+extern int bitmap_equal_p (const_sbitmap, const_sbitmap);
+extern bool bitmap_empty_p (const_sbitmap);
+extern bool bitmap_range_empty_p (const_sbitmap, unsigned int, unsigned int);
+extern void bitmap_clear (sbitmap);
+extern void bitmap_ones (sbitmap);
+extern void bitmap_vector_clear (sbitmap *, unsigned int);
+extern void bitmap_vector_ones (sbitmap *, unsigned int);
+
+extern bool bitmap_ior_and_compl (sbitmap, const_sbitmap,
const_sbitmap, const_sbitmap);
-extern void sbitmap_difference (sbitmap, const_sbitmap, const_sbitmap);
-extern void sbitmap_not (sbitmap, const_sbitmap);
-extern void sbitmap_a_or_b_and_c (sbitmap, const_sbitmap,
- const_sbitmap, const_sbitmap);
-extern bool sbitmap_a_or_b_and_c_cg (sbitmap, const_sbitmap,
+extern void bitmap_and_compl (sbitmap, const_sbitmap, const_sbitmap);
+extern void bitmap_not (sbitmap, const_sbitmap);
+extern bool bitmap_or_and (sbitmap, const_sbitmap,
const_sbitmap, const_sbitmap);
-extern void sbitmap_a_and_b_or_c (sbitmap, const_sbitmap,
- const_sbitmap, const_sbitmap);
-extern bool sbitmap_a_and_b_or_c_cg (sbitmap, const_sbitmap,
+extern bool bitmap_and_or (sbitmap, const_sbitmap,
const_sbitmap, const_sbitmap);
-extern bool sbitmap_any_common_bits (const_sbitmap, const_sbitmap);
-extern void sbitmap_a_and_b (sbitmap, const_sbitmap, const_sbitmap);
-extern bool sbitmap_a_and_b_cg (sbitmap, const_sbitmap, const_sbitmap);
-extern void sbitmap_a_or_b (sbitmap, const_sbitmap, const_sbitmap);
-extern bool sbitmap_a_or_b_cg (sbitmap, const_sbitmap, const_sbitmap);
-extern void sbitmap_a_xor_b (sbitmap, const_sbitmap, const_sbitmap);
-extern bool sbitmap_a_xor_b_cg (sbitmap, const_sbitmap, const_sbitmap);
-extern bool sbitmap_a_subset_b_p (const_sbitmap, const_sbitmap);
-
-extern int sbitmap_first_set_bit (const_sbitmap);
-extern int sbitmap_last_set_bit (const_sbitmap);
-
-extern void debug_sbitmap (const_sbitmap);
+extern bool bitmap_intersect_p (const_sbitmap, const_sbitmap);
+extern bool bitmap_and (sbitmap, const_sbitmap, const_sbitmap);
+extern bool bitmap_ior (sbitmap, const_sbitmap, const_sbitmap);
+extern bool bitmap_xor (sbitmap, const_sbitmap, const_sbitmap);
+extern bool bitmap_subset_p (const_sbitmap, const_sbitmap);
+
+extern int bitmap_first_set_bit (const_sbitmap);
+extern int bitmap_last_set_bit (const_sbitmap);
+
+extern void debug_bitmap (const_sbitmap);
extern sbitmap sbitmap_realloc (sbitmap, unsigned int);
extern unsigned long sbitmap_popcount (const_sbitmap, unsigned long);
extern void sbitmap_verify_popcount (const_sbitmap);
diff --git a/gcc/sched-rgn.c b/gcc/sched-rgn.c
index ba85238e6fd..a0e62b6cc4b 100644
--- a/gcc/sched-rgn.c
+++ b/gcc/sched-rgn.c
@@ -644,16 +644,16 @@ haifa_find_rgns (void)
stack = XNEWVEC (edge_iterator, n_edges);
inner = sbitmap_alloc (last_basic_block);
- sbitmap_ones (inner);
+ bitmap_ones (inner);
header = sbitmap_alloc (last_basic_block);
- sbitmap_zero (header);
+ bitmap_clear (header);
in_queue = sbitmap_alloc (last_basic_block);
- sbitmap_zero (in_queue);
+ bitmap_clear (in_queue);
in_stack = sbitmap_alloc (last_basic_block);
- sbitmap_zero (in_stack);
+ bitmap_clear (in_stack);
for (i = 0; i < last_basic_block; i++)
max_hdr[i] = -1;
@@ -798,7 +798,7 @@ haifa_find_rgns (void)
{
degree1 = XNEWVEC (int, last_basic_block);
extended_rgn_header = sbitmap_alloc (last_basic_block);
- sbitmap_zero (extended_rgn_header);
+ bitmap_clear (extended_rgn_header);
}
/* Find blocks which are inner loop headers. We still have non-reducible
@@ -1035,7 +1035,7 @@ haifa_find_rgns (void)
{
free (degree1);
- sbitmap_a_or_b (header, header, extended_rgn_header);
+ bitmap_ior (header, header, extended_rgn_header);
sbitmap_free (extended_rgn_header);
extend_rgns (degree, &idx, header, max_hdr);
@@ -1416,7 +1416,7 @@ compute_dom_prob_ps (int bb)
prob[bb] = 0;
/* Initialize dom[bb] to '111..1'. */
- sbitmap_ones (dom[bb]);
+ bitmap_ones (dom[bb]);
FOR_EACH_EDGE (in_edge, in_ei, BASIC_BLOCK (BB_TO_BLOCK (bb))->preds)
{
@@ -1428,13 +1428,13 @@ compute_dom_prob_ps (int bb)
continue;
pred_bb = BLOCK_TO_BB (in_edge->src->index);
- sbitmap_a_and_b (dom[bb], dom[bb], dom[pred_bb]);
- sbitmap_a_or_b (ancestor_edges[bb],
+ bitmap_and (dom[bb], dom[bb], dom[pred_bb]);
+ bitmap_ior (ancestor_edges[bb],
ancestor_edges[bb], ancestor_edges[pred_bb]);
SET_BIT (ancestor_edges[bb], EDGE_TO_BIT (in_edge));
- sbitmap_a_or_b (pot_split[bb], pot_split[bb], pot_split[pred_bb]);
+ bitmap_ior (pot_split[bb], pot_split[bb], pot_split[pred_bb]);
FOR_EACH_EDGE (out_edge, out_ei, in_edge->src->succs)
SET_BIT (pot_split[bb], EDGE_TO_BIT (out_edge));
@@ -1443,7 +1443,7 @@ compute_dom_prob_ps (int bb)
}
SET_BIT (dom[bb], bb);
- sbitmap_difference (pot_split[bb], pot_split[bb], ancestor_edges[bb]);
+ bitmap_and_compl (pot_split[bb], pot_split[bb], ancestor_edges[bb]);
if (sched_verbose >= 2)
fprintf (sched_dump, ";; bb_prob(%d, %d) = %3d\n", bb, BB_TO_BLOCK (bb),
@@ -1459,9 +1459,9 @@ static void
split_edges (int bb_src, int bb_trg, edgelst *bl)
{
sbitmap src = sbitmap_alloc (SBITMAP_SIZE (pot_split[bb_src]));
- sbitmap_copy (src, pot_split[bb_src]);
+ bitmap_copy (src, pot_split[bb_src]);
- sbitmap_difference (src, src, pot_split[bb_trg]);
+ bitmap_and_compl (src, src, pot_split[bb_trg]);
extract_edgelst (src, bl);
sbitmap_free (src);
}
@@ -1542,7 +1542,7 @@ compute_trg_info (int trg)
overrunning the end of the bblst_table. */
update_idx = 0;
- sbitmap_zero (visited);
+ bitmap_clear (visited);
for (j = 0; j < el.nr_members; j++)
{
block = el.first_member[j]->src;
@@ -3177,7 +3177,7 @@ sched_rgn_compute_dependencies (int rgn)
/* Initialize bitmap used in add_branch_dependences. */
insn_referenced = sbitmap_alloc (sched_max_luid);
- sbitmap_zero (insn_referenced);
+ bitmap_clear (insn_referenced);
/* Compute backward dependencies. */
for (bb = 0; bb < current_nr_blocks; bb++)
@@ -3217,7 +3217,7 @@ sched_rgn_local_init (int rgn)
prob = XNEWVEC (int, current_nr_blocks);
dom = sbitmap_vector_alloc (current_nr_blocks, current_nr_blocks);
- sbitmap_vector_zero (dom, current_nr_blocks);
+ bitmap_vector_clear (dom, current_nr_blocks);
/* Use ->aux to implement EDGE_TO_BIT mapping. */
rgn_nr_edges = 0;
@@ -3241,9 +3241,9 @@ sched_rgn_local_init (int rgn)
/* Split edges. */
pot_split = sbitmap_vector_alloc (current_nr_blocks, rgn_nr_edges);
- sbitmap_vector_zero (pot_split, current_nr_blocks);
+ bitmap_vector_clear (pot_split, current_nr_blocks);
ancestor_edges = sbitmap_vector_alloc (current_nr_blocks, rgn_nr_edges);
- sbitmap_vector_zero (ancestor_edges, current_nr_blocks);
+ bitmap_vector_clear (ancestor_edges, current_nr_blocks);
/* Compute probabilities, dominators, split_edges. */
for (bb = 0; bb < current_nr_blocks; bb++)
diff --git a/gcc/sel-sched-ir.c b/gcc/sel-sched-ir.c
index 2a7a17066f6..01fc2c42537 100644
--- a/gcc/sel-sched-ir.c
+++ b/gcc/sel-sched-ir.c
@@ -6094,7 +6094,7 @@ sel_init_pipelining (void)
current_loop_nest = NULL;
bbs_in_loop_rgns = sbitmap_alloc (last_basic_block);
- sbitmap_zero (bbs_in_loop_rgns);
+ bitmap_clear (bbs_in_loop_rgns);
recompute_rev_top_order ();
}
diff --git a/gcc/sel-sched.c b/gcc/sel-sched.c
index b5bffa11978..f51e8b94371 100644
--- a/gcc/sel-sched.c
+++ b/gcc/sel-sched.c
@@ -6775,7 +6775,7 @@ init_seqno (bitmap blocks_to_reschedule, basic_block from)
if (blocks_to_reschedule)
{
- sbitmap_ones (visited_bbs);
+ bitmap_ones (visited_bbs);
EXECUTE_IF_SET_IN_BITMAP (blocks_to_reschedule, 0, bbi, bi)
{
gcc_assert (BLOCK_TO_BB (bbi) < current_nr_blocks);
@@ -6784,7 +6784,7 @@ init_seqno (bitmap blocks_to_reschedule, basic_block from)
}
else
{
- sbitmap_zero (visited_bbs);
+ bitmap_clear (visited_bbs);
from = EBB_FIRST_BB (0);
}
diff --git a/gcc/store-motion.c b/gcc/store-motion.c
index 1cda4045b7c..f6712f49bc3 100644
--- a/gcc/store-motion.c
+++ b/gcc/store-motion.c
@@ -849,7 +849,7 @@ remove_reachable_equiv_notes (basic_block bb, struct st_expr *smexpr)
sp = 0;
ei = ei_start (bb->succs);
- sbitmap_zero (visited);
+ bitmap_clear (visited);
act = (EDGE_COUNT (ei_container (ei)) > 0 ? EDGE_I (ei_container (ei), 0) : NULL);
while (1)
@@ -1014,10 +1014,10 @@ build_store_vectors (void)
/* Build the gen_vector. This is any store in the table which is not killed
by aliasing later in its block. */
st_avloc = sbitmap_vector_alloc (last_basic_block, num_stores);
- sbitmap_vector_zero (st_avloc, last_basic_block);
+ bitmap_vector_clear (st_avloc, last_basic_block);
st_antloc = sbitmap_vector_alloc (last_basic_block, num_stores);
- sbitmap_vector_zero (st_antloc, last_basic_block);
+ bitmap_vector_clear (st_antloc, last_basic_block);
for (ptr = first_st_expr (); ptr != NULL; ptr = next_st_expr (ptr))
{
@@ -1050,10 +1050,10 @@ build_store_vectors (void)
}
st_kill = sbitmap_vector_alloc (last_basic_block, num_stores);
- sbitmap_vector_zero (st_kill, last_basic_block);
+ bitmap_vector_clear (st_kill, last_basic_block);
st_transp = sbitmap_vector_alloc (last_basic_block, num_stores);
- sbitmap_vector_zero (st_transp, last_basic_block);
+ bitmap_vector_clear (st_transp, last_basic_block);
regs_set_in_block = XNEWVEC (int, max_gcse_regno);
FOR_EACH_BB (bb)
@@ -1092,10 +1092,10 @@ build_store_vectors (void)
if (dump_file)
{
- dump_sbitmap_vector (dump_file, "st_antloc", "", st_antloc, last_basic_block);
- dump_sbitmap_vector (dump_file, "st_kill", "", st_kill, last_basic_block);
- dump_sbitmap_vector (dump_file, "st_transp", "", st_transp, last_basic_block);
- dump_sbitmap_vector (dump_file, "st_avloc", "", st_avloc, last_basic_block);
+ dump_bitmap_vector (dump_file, "st_antloc", "", st_antloc, last_basic_block);
+ dump_bitmap_vector (dump_file, "st_kill", "", st_kill, last_basic_block);
+ dump_bitmap_vector (dump_file, "st_transp", "", st_transp, last_basic_block);
+ dump_bitmap_vector (dump_file, "st_avloc", "", st_avloc, last_basic_block);
}
}
diff --git a/gcc/testsuite/gcc.dg/sms-4.c b/gcc/testsuite/gcc.dg/sms-4.c
index 83b32d05a4b..98132e0d0c3 100644
--- a/gcc/testsuite/gcc.dg/sms-4.c
+++ b/gcc/testsuite/gcc.dg/sms-4.c
@@ -1,4 +1,4 @@
-/* Inspired from sbitmap_a_or_b_and_c_cg function in sbitmap.c. */
+/* Inspired from bitmap_or_and function in sbitmap.c. */
/* { dg-do run } */
/* { dg-options "-O2 -fmodulo-sched -fmodulo-sched-allow-regmoves -fdump-rtl-sms" } */
/* { dg-options "-O2 -fmodulo-sched -fmodulo-sched-allow-regmoves -fdump-rtl-sms --param sms-min-sc=1" { target powerpc*-*-* } } */
diff --git a/gcc/tracer.c b/gcc/tracer.c
index 7264ad2589b..cbd5aacf55a 100644
--- a/gcc/tracer.c
+++ b/gcc/tracer.c
@@ -238,7 +238,7 @@ tail_duplicate (void)
/* Create an oversized sbitmap to reduce the chance that we need to
resize it. */
bb_seen = sbitmap_alloc (last_basic_block * 2);
- sbitmap_zero (bb_seen);
+ bitmap_clear (bb_seen);
initialize_original_copy_tables ();
if (profile_info && flag_branch_probabilities)
diff --git a/gcc/tree-eh.c b/gcc/tree-eh.c
index b4be50c6fd3..9042f068835 100644
--- a/gcc/tree-eh.c
+++ b/gcc/tree-eh.c
@@ -3525,8 +3525,8 @@ remove_unreachable_handlers (void)
r_reachable = sbitmap_alloc (VEC_length (eh_region, cfun->eh->region_array));
lp_reachable
= sbitmap_alloc (VEC_length (eh_landing_pad, cfun->eh->lp_array));
- sbitmap_zero (r_reachable);
- sbitmap_zero (lp_reachable);
+ bitmap_clear (r_reachable);
+ bitmap_clear (lp_reachable);
FOR_EACH_BB (bb)
{
@@ -3571,9 +3571,9 @@ remove_unreachable_handlers (void)
fprintf (dump_file, "Before removal of unreachable regions:\n");
dump_eh_tree (dump_file, cfun);
fprintf (dump_file, "Reachable regions: ");
- dump_sbitmap_file (dump_file, r_reachable);
+ dump_bitmap_file (dump_file, r_reachable);
fprintf (dump_file, "Reachable landing pads: ");
- dump_sbitmap_file (dump_file, lp_reachable);
+ dump_bitmap_file (dump_file, lp_reachable);
}
for (r_nr = 1;
@@ -3645,7 +3645,7 @@ remove_unreachable_handlers_no_lp (void)
basic_block bb;
r_reachable = sbitmap_alloc (VEC_length (eh_region, cfun->eh->region_array));
- sbitmap_zero (r_reachable);
+ bitmap_clear (r_reachable);
FOR_EACH_BB (bb)
{
diff --git a/gcc/tree-into-ssa.c b/gcc/tree-into-ssa.c
index 73692b912f3..b3e887b258f 100644
--- a/gcc/tree-into-ssa.c
+++ b/gcc/tree-into-ssa.c
@@ -2347,7 +2347,7 @@ rewrite_into_ssa (void)
mark_def_sites will add to this set those blocks that the renamer
should process. */
interesting_blocks = sbitmap_alloc (last_basic_block);
- sbitmap_zero (interesting_blocks);
+ bitmap_clear (interesting_blocks);
/* Initialize dominance frontier. */
dfs = XNEWVEC (bitmap_head, last_basic_block);
@@ -2729,7 +2729,7 @@ dump_update_ssa (FILE *file)
if (!need_ssa_update_p (cfun))
return;
- if (new_ssa_names && sbitmap_first_set_bit (new_ssa_names) >= 0)
+ if (new_ssa_names && bitmap_first_set_bit (new_ssa_names) >= 0)
{
sbitmap_iterator sbi;
@@ -2779,10 +2779,10 @@ init_update_ssa (struct function *fn)
add_new_name_mapping are typically done after creating new SSA
names, so we'll need to reallocate these arrays. */
old_ssa_names = sbitmap_alloc (num_ssa_names + NAME_SETS_GROWTH_FACTOR);
- sbitmap_zero (old_ssa_names);
+ bitmap_clear (old_ssa_names);
new_ssa_names = sbitmap_alloc (num_ssa_names + NAME_SETS_GROWTH_FACTOR);
- sbitmap_zero (new_ssa_names);
+ bitmap_clear (new_ssa_names);
bitmap_obstack_initialize (&update_ssa_obstack);
@@ -3133,8 +3133,8 @@ update_ssa (unsigned update_flags)
/* If we only need to update virtuals, remove all the mappings for
real names before proceeding. The caller is responsible for
having dealt with the name mappings before calling update_ssa. */
- sbitmap_zero (old_ssa_names);
- sbitmap_zero (new_ssa_names);
+ bitmap_clear (old_ssa_names);
+ bitmap_clear (new_ssa_names);
}
gcc_assert (update_ssa_initialized_fn == cfun);
@@ -3152,14 +3152,14 @@ update_ssa (unsigned update_flags)
/* If there are names defined in the replacement table, prepare
definition and use sites for all the names in NEW_SSA_NAMES and
OLD_SSA_NAMES. */
- if (sbitmap_first_set_bit (new_ssa_names) >= 0)
+ if (bitmap_first_set_bit (new_ssa_names) >= 0)
{
prepare_names_to_update (insert_phi_p);
/* If all the names in NEW_SSA_NAMES had been marked for
removal, and there are no symbols to rename, then there's
nothing else to do. */
- if (sbitmap_first_set_bit (new_ssa_names) < 0
+ if (bitmap_first_set_bit (new_ssa_names) < 0
&& !cfun->gimple_df->ssa_renaming_needed)
goto done;
}
@@ -3230,7 +3230,7 @@ update_ssa (unsigned update_flags)
bitmap_initialize (&dfs[bb->index], &bitmap_default_obstack);
compute_dominance_frontiers (dfs);
- if (sbitmap_first_set_bit (old_ssa_names) >= 0)
+ if (bitmap_first_set_bit (old_ssa_names) >= 0)
{
sbitmap_iterator sbi;
@@ -3240,7 +3240,7 @@ update_ssa (unsigned update_flags)
gain any new members). Copy OLD_SSA_NAMES to a temporary
for traversal. */
sbitmap tmp = sbitmap_alloc (SBITMAP_SIZE (old_ssa_names));
- sbitmap_copy (tmp, old_ssa_names);
+ bitmap_copy (tmp, old_ssa_names);
EXECUTE_IF_SET_IN_SBITMAP (tmp, 0, i, sbi)
insert_updated_phi_nodes_for (ssa_name (i), dfs, blocks_to_update,
update_flags);
@@ -3273,7 +3273,7 @@ update_ssa (unsigned update_flags)
/* Now start the renaming process at START_BB. */
interesting_blocks = sbitmap_alloc (last_basic_block);
- sbitmap_zero (interesting_blocks);
+ bitmap_clear (interesting_blocks);
EXECUTE_IF_SET_IN_BITMAP (blocks_to_update, 0, i, bi)
SET_BIT (interesting_blocks, i);
diff --git a/gcc/tree-outof-ssa.c b/gcc/tree-outof-ssa.c
index 4d0f3208320..5c8e43edb74 100644
--- a/gcc/tree-outof-ssa.c
+++ b/gcc/tree-outof-ssa.c
@@ -670,7 +670,7 @@ eliminate_phi (edge e, elim_graph g)
{
int part;
- sbitmap_zero (g->visited);
+ bitmap_clear (g->visited);
VEC_truncate (int, g->stack, 0);
FOR_EACH_VEC_ELT (int, g->nodes, x, part)
@@ -679,7 +679,7 @@ eliminate_phi (edge e, elim_graph g)
elim_forward (g, part);
}
- sbitmap_zero (g->visited);
+ bitmap_clear (g->visited);
while (VEC_length (int, g->stack) > 0)
{
x = VEC_pop (int, g->stack);
diff --git a/gcc/tree-ssa-dce.c b/gcc/tree-ssa-dce.c
index 0112fc4c1c3..0a98d52edc9 100644
--- a/gcc/tree-ssa-dce.c
+++ b/gcc/tree-ssa-dce.c
@@ -1489,13 +1489,13 @@ tree_dce_init (bool aggressive)
control_dependence_map[i] = BITMAP_ALLOC (NULL);
last_stmt_necessary = sbitmap_alloc (last_basic_block);
- sbitmap_zero (last_stmt_necessary);
+ bitmap_clear (last_stmt_necessary);
bb_contains_live_stmts = sbitmap_alloc (last_basic_block);
- sbitmap_zero (bb_contains_live_stmts);
+ bitmap_clear (bb_contains_live_stmts);
}
processed = sbitmap_alloc (num_ssa_names + 1);
- sbitmap_zero (processed);
+ bitmap_clear (processed);
worklist = VEC_alloc (gimple, heap, 64);
cfg_altered = false;
@@ -1566,7 +1566,7 @@ perform_tree_ssa_dce (bool aggressive)
timevar_pop (TV_CONTROL_DEPENDENCES);
visited_control_parents = sbitmap_alloc (last_basic_block);
- sbitmap_zero (visited_control_parents);
+ bitmap_clear (visited_control_parents);
mark_dfs_back_edges ();
}
diff --git a/gcc/tree-ssa-dom.c b/gcc/tree-ssa-dom.c
index 9065006c55e..19eca425775 100644
--- a/gcc/tree-ssa-dom.c
+++ b/gcc/tree-ssa-dom.c
@@ -815,7 +815,7 @@ tree_ssa_dominator_optimize (void)
}
gimple_purge_all_dead_eh_edges (need_eh_cleanup);
- bitmap_zero (need_eh_cleanup);
+ bitmap_clear (need_eh_cleanup);
}
statistics_counter_event (cfun, "Redundant expressions eliminated",
diff --git a/gcc/tree-ssa-live.c b/gcc/tree-ssa-live.c
index b63dc7e8170..d6b8fbda664 100644
--- a/gcc/tree-ssa-live.c
+++ b/gcc/tree-ssa-live.c
@@ -1008,7 +1008,7 @@ live_worklist (tree_live_info_p live)
sbitmap visited = sbitmap_alloc (last_basic_block + 1);
bitmap tmp = BITMAP_ALLOC (&liveness_bitmap_obstack);
- sbitmap_zero (visited);
+ bitmap_clear (visited);
/* Visit all the blocks in reverse order and propagate live on entry values
into the predecessors blocks. */
diff --git a/gcc/tree-ssa-live.h b/gcc/tree-ssa-live.h
index 70a3aa60fd3..3d39cb6d443 100644
--- a/gcc/tree-ssa-live.h
+++ b/gcc/tree-ssa-live.h
@@ -308,7 +308,7 @@ live_merge_and_clear (tree_live_info_p live, int p1, int p2)
{
gcc_checking_assert (&live->livein[p1] && &live->livein[p2]);
bitmap_ior_into (&live->livein[p1], &live->livein[p2]);
- bitmap_zero (&live->livein[p2]);
+ bitmap_clear (&live->livein[p2]);
}
diff --git a/gcc/tree-ssa-loop-im.c b/gcc/tree-ssa-loop-im.c
index ac5353905df..178e2eeb783 100644
--- a/gcc/tree-ssa-loop-im.c
+++ b/gcc/tree-ssa-loop-im.c
@@ -2578,7 +2578,7 @@ tree_ssa_lim_initialize (void)
bitmap_obstack_initialize (&lim_bitmap_obstack);
- sbitmap_zero (contains_call);
+ bitmap_clear (contains_call);
FOR_EACH_BB (bb)
{
for (bsi = gsi_start_bb (bb); !gsi_end_p (bsi); gsi_next (&bsi))
diff --git a/gcc/tree-ssa-loop-ivcanon.c b/gcc/tree-ssa-loop-ivcanon.c
index 3868b45a4c3..6cf6c6de95a 100644
--- a/gcc/tree-ssa-loop-ivcanon.c
+++ b/gcc/tree-ssa-loop-ivcanon.c
@@ -520,7 +520,7 @@ try_unroll_loop_completely (struct loop *loop,
initialize_original_copy_tables ();
wont_exit = sbitmap_alloc (n_unroll + 1);
- sbitmap_ones (wont_exit);
+ bitmap_ones (wont_exit);
RESET_BIT (wont_exit, 0);
if (!gimple_duplicate_loop_to_header_edge (loop, loop_preheader_edge (loop),
diff --git a/gcc/tree-ssa-loop-ivopts.c b/gcc/tree-ssa-loop-ivopts.c
index 74097f8cccf..9bca5e35e24 100644
--- a/gcc/tree-ssa-loop-ivopts.c
+++ b/gcc/tree-ssa-loop-ivopts.c
@@ -3076,7 +3076,7 @@ multiplier_allowed_in_address_p (HOST_WIDE_INT ratio, enum machine_mode mode,
HOST_WIDE_INT i;
valid_mult = sbitmap_alloc (2 * MAX_RATIO + 1);
- sbitmap_zero (valid_mult);
+ bitmap_clear (valid_mult);
addr = gen_rtx_fmt_ee (MULT, address_mode, reg1, NULL_RTX);
for (i = -MAX_RATIO; i <= MAX_RATIO; i++)
{
diff --git a/gcc/tree-ssa-loop-manip.c b/gcc/tree-ssa-loop-manip.c
index 9732fbe484a..2b723cac972 100644
--- a/gcc/tree-ssa-loop-manip.c
+++ b/gcc/tree-ssa-loop-manip.c
@@ -1172,7 +1172,7 @@ tree_transform_and_unroll_loop (struct loop *loop, unsigned factor,
/* Unroll the loop and remove the exits in all iterations except for the
last one. */
wont_exit = sbitmap_alloc (factor);
- sbitmap_ones (wont_exit);
+ bitmap_ones (wont_exit);
RESET_BIT (wont_exit, factor - 1);
ok = gimple_duplicate_loop_to_header_edge
diff --git a/gcc/tree-ssa-phiopt.c b/gcc/tree-ssa-phiopt.c
index 948620fa8cd..5864d68689a 100644
--- a/gcc/tree-ssa-phiopt.c
+++ b/gcc/tree-ssa-phiopt.c
@@ -482,7 +482,7 @@ blocks_in_phiopt_order (void)
#define MARK_VISITED(BB) (SET_BIT (visited, (BB)->index))
#define VISITED_P(BB) (TEST_BIT (visited, (BB)->index))
- sbitmap_zero (visited);
+ bitmap_clear (visited);
MARK_VISITED (ENTRY_BLOCK_PTR);
FOR_EACH_BB (x)
diff --git a/gcc/tree-ssa-pre.c b/gcc/tree-ssa-pre.c
index 6a075984ea5..7f9ab8bfb6c 100644
--- a/gcc/tree-ssa-pre.c
+++ b/gcc/tree-ssa-pre.c
@@ -2457,7 +2457,7 @@ compute_antic (void)
/* If any predecessor edges are abnormal, we punt, so antic_in is empty.
We pre-build the map of blocks with incoming abnormal edges here. */
has_abnormal_preds = sbitmap_alloc (last_basic_block);
- sbitmap_zero (has_abnormal_preds);
+ bitmap_clear (has_abnormal_preds);
FOR_ALL_BB (block)
{
@@ -2486,7 +2486,7 @@ compute_antic (void)
BB_VISITED (EXIT_BLOCK_PTR) = 1;
changed_blocks = sbitmap_alloc (last_basic_block + 1);
- sbitmap_ones (changed_blocks);
+ bitmap_ones (changed_blocks);
while (changed)
{
if (dump_file && (dump_flags & TDF_DETAILS))
@@ -2516,7 +2516,7 @@ compute_antic (void)
if (do_partial_partial)
{
- sbitmap_ones (changed_blocks);
+ bitmap_ones (changed_blocks);
mark_dfs_back_edges ();
num_iterations = 0;
changed = true;
diff --git a/gcc/tree-ssa-propagate.c b/gcc/tree-ssa-propagate.c
index e56b012cd61..380cda39787 100644
--- a/gcc/tree-ssa-propagate.c
+++ b/gcc/tree-ssa-propagate.c
@@ -487,10 +487,10 @@ ssa_prop_init (void)
varying_ssa_edges = VEC_alloc (gimple, gc, 20);
executable_blocks = sbitmap_alloc (last_basic_block);
- sbitmap_zero (executable_blocks);
+ bitmap_clear (executable_blocks);
bb_in_list = sbitmap_alloc (last_basic_block);
- sbitmap_zero (bb_in_list);
+ bitmap_clear (bb_in_list);
if (dump_file && (dump_flags & TDF_DETAILS))
dump_immediate_uses (dump_file);
diff --git a/gcc/tree-ssa-reassoc.c b/gcc/tree-ssa-reassoc.c
index 960e2c3c389..b54ca39d754 100644
--- a/gcc/tree-ssa-reassoc.c
+++ b/gcc/tree-ssa-reassoc.c
@@ -1282,7 +1282,7 @@ undistribute_ops_list (enum tree_code opcode,
/* Build a list of candidates to process. */
candidates = sbitmap_alloc (length);
- sbitmap_zero (candidates);
+ bitmap_clear (candidates);
nr_candidates = 0;
FOR_EACH_VEC_ELT (operand_entry_t, *ops, i, oe1)
{
@@ -1315,7 +1315,7 @@ undistribute_ops_list (enum tree_code opcode,
fprintf (dump_file, "searching for un-distribute opportunities ");
print_generic_expr (dump_file,
VEC_index (operand_entry_t, *ops,
- sbitmap_first_set_bit (candidates))->op, 0);
+ bitmap_first_set_bit (candidates))->op, 0);
fprintf (dump_file, " %d\n", nr_candidates);
}
@@ -1387,7 +1387,7 @@ undistribute_ops_list (enum tree_code opcode,
/* Now collect the operands in the outer chain that contain
the common operand in their inner chain. */
- sbitmap_zero (candidates2);
+ bitmap_clear (candidates2);
nr_candidates2 = 0;
EXECUTE_IF_SET_IN_SBITMAP (candidates, 0, i, sbi0)
{
@@ -1421,7 +1421,7 @@ undistribute_ops_list (enum tree_code opcode,
{
operand_entry_t oe1, oe2;
gimple prod;
- int first = sbitmap_first_set_bit (candidates2);
+ int first = bitmap_first_set_bit (candidates2);
/* Build the new addition chain. */
oe1 = VEC_index (operand_entry_t, *ops, first);
diff --git a/gcc/tree-ssa-structalias.c b/gcc/tree-ssa-structalias.c
index 711fbef2a64..8bfceb6ce87 100644
--- a/gcc/tree-ssa-structalias.c
+++ b/gcc/tree-ssa-structalias.c
@@ -1203,7 +1203,7 @@ build_pred_graph (void)
graph->eq_rep = XNEWVEC (int, graph->size);
graph->direct_nodes = sbitmap_alloc (graph->size);
graph->address_taken = BITMAP_ALLOC (&predbitmap_obstack);
- sbitmap_zero (graph->direct_nodes);
+ bitmap_clear (graph->direct_nodes);
for (j = 0; j < FIRST_REF_NODE; j++)
{
@@ -1533,7 +1533,7 @@ init_topo_info (void)
size_t size = graph->size;
struct topo_info *ti = XNEW (struct topo_info);
ti->visited = sbitmap_alloc (size);
- sbitmap_zero (ti->visited);
+ bitmap_clear (ti->visited);
ti->topo_order = VEC_alloc (unsigned, heap, 1);
return ti;
}
@@ -1811,9 +1811,9 @@ init_scc_info (size_t size)
si->current_index = 0;
si->visited = sbitmap_alloc (size);
- sbitmap_zero (si->visited);
+ bitmap_clear (si->visited);
si->deleted = sbitmap_alloc (size);
- sbitmap_zero (si->deleted);
+ bitmap_clear (si->deleted);
si->node_mapping = XNEWVEC (unsigned int, size);
si->dfs = XCNEWVEC (unsigned int, size);
@@ -2166,7 +2166,7 @@ perform_var_substitution (constraint_graph_t graph)
if (!TEST_BIT (si->visited, si->node_mapping[i]))
condense_visit (graph, si, si->node_mapping[i]);
- sbitmap_zero (si->visited);
+ bitmap_clear (si->visited);
/* Actually the label the nodes for pointer equivalences */
for (i = 0; i < FIRST_REF_NODE; i++)
if (!TEST_BIT (si->visited, si->node_mapping[i]))
diff --git a/gcc/tree-stdarg.c b/gcc/tree-stdarg.c
index 8965ca3790c..fca2e8e368f 100644
--- a/gcc/tree-stdarg.c
+++ b/gcc/tree-stdarg.c
@@ -60,7 +60,7 @@ reachable_at_most_once (basic_block va_arg_bb, basic_block va_start_bb)
return false;
visited = sbitmap_alloc (last_basic_block);
- sbitmap_zero (visited);
+ bitmap_clear (visited);
ret = true;
FOR_EACH_EDGE (e, ei, va_arg_bb->preds)
diff --git a/gcc/tree-vect-slp.c b/gcc/tree-vect-slp.c
index 58603188747..4f1966d5fff 100644
--- a/gcc/tree-vect-slp.c
+++ b/gcc/tree-vect-slp.c
@@ -1289,7 +1289,7 @@ vect_supported_load_permutation_p (slp_instance slp_instn, int group_size,
/* Check that the loads in the first sequence are different and there
are no gaps between them. */
load_index = sbitmap_alloc (group_size);
- sbitmap_zero (load_index);
+ bitmap_clear (load_index);
for (k = 0; k < group_size; k++)
{
first_group_load_index = VEC_index (int, load_permutation, k);
@@ -1407,7 +1407,7 @@ vect_supported_load_permutation_p (slp_instance slp_instn, int group_size,
supported = true;
load_index = sbitmap_alloc (group_size);
- sbitmap_zero (load_index);
+ bitmap_clear (load_index);
for (j = 0; j < group_size; j++)
{
for (i = j * group_size, k = 0;
diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c
index 379914cfad6..6547ed6235a 100644
--- a/gcc/tree-vrp.c
+++ b/gcc/tree-vrp.c
@@ -5661,7 +5661,7 @@ find_assert_locations (void)
if (!live[rpo[i]])
{
live[rpo[i]] = sbitmap_alloc (num_ssa_names);
- sbitmap_zero (live[rpo[i]]);
+ bitmap_clear (live[rpo[i]]);
}
/* Process BB and update the live information with uses in
@@ -5669,7 +5669,7 @@ find_assert_locations (void)
need_asserts |= find_assert_locations_1 (bb, live[rpo[i]]);
/* Merge liveness into the predecessor blocks and free it. */
- if (!sbitmap_empty_p (live[rpo[i]]))
+ if (!bitmap_empty_p (live[rpo[i]]))
{
int pred_rpo = i;
FOR_EACH_EDGE (e, ei, bb->preds)
@@ -5681,9 +5681,9 @@ find_assert_locations (void)
if (!live[pred])
{
live[pred] = sbitmap_alloc (num_ssa_names);
- sbitmap_zero (live[pred]);
+ bitmap_clear (live[pred]);
}
- sbitmap_a_or_b (live[pred], live[pred], live[rpo[i]]);
+ bitmap_ior (live[pred], live[pred], live[rpo[i]]);
if (bb_rpo[pred] < pred_rpo)
pred_rpo = bb_rpo[pred];
diff --git a/gcc/var-tracking.c b/gcc/var-tracking.c
index 9b28c7d273c..d5ab1d1e554 100644
--- a/gcc/var-tracking.c
+++ b/gcc/var-tracking.c
@@ -6748,11 +6748,11 @@ vt_find_locations (void)
visited = sbitmap_alloc (last_basic_block);
in_worklist = sbitmap_alloc (last_basic_block);
in_pending = sbitmap_alloc (last_basic_block);
- sbitmap_zero (in_worklist);
+ bitmap_clear (in_worklist);
FOR_EACH_BB (bb)
fibheap_insert (pending, bb_order[bb->index], bb);
- sbitmap_ones (in_pending);
+ bitmap_ones (in_pending);
while (success && !fibheap_empty (pending))
{
@@ -6763,7 +6763,7 @@ vt_find_locations (void)
in_pending = in_worklist;
in_worklist = sbitmap_swap;
- sbitmap_zero (visited);
+ bitmap_clear (visited);
while (!fibheap_empty (worklist))
{