Commit eb59b8de by Nathan Sidwell Committed by Nathan Sidwell

bitmap.h (bitmap_empty_p): New.

	* bitmap.h (bitmap_empty_p): New.
	(bitmap_and, bitmap_and_into, bitmap_and_compl,
	bitmap_and_compl_into, bitmap_ior, bitmap_ior_into,
	bitmap_ior_compl, bitmap_xor, bitmap_xor_into): New bitmap
	operation macros.
	(bitmap_ior_and_compl): Rename to ...
	(bitmap_ior_and_compl_into): ... here.
	* bitmap.c (bitmap_equal_p): Use bitmap_xor.
	(bitmap_ior_and_compl): Rename to ...
	(bitmap_ior_and_compl_into): ... here. Adjust. Return changed
	flag.
	(bitmap_union_of_diff): Use renamed bitmap functions.
	* basic-block.h (AND_REG_SET, AND_COMPL_REG_SET, IOR_REG_SET,
	XOR_REG_SET, IOR_AND_COMPL_REG_SET): Likewise.
	* cfgrtl.c (safe_insert_insn_on_edge): Likewise.
	* df.c (df_bb_rd_local_compute)
	* flow.c (calculate_global_regs_live,
	init_propagate_block_info): Likewise.
	* ifcvt.c (find_if_case_1, find_if_case_2,
	dead_or_predicable): Likewise.
	* ra-build.c (union_web_part_roots, livethrough_conflicts_bb,
	reset_conflicts, conflicts_between_webs): Likewise.
	* ra-rewrite.c (reloads_to_loads, rewrite_program2,
	detect_web_parts_to_rebuild): Likewise.
	* sched-ebb.c (compute_jump_reg_dependencies): Likewise.
	* tree-int-ssa.c (insert_phi_nodes_for, rewrite_into_ssa): Likewise.
	* tree-sra.c (decide_instantiations): Likewise.
	* tree-ssa-alias.c (create_name_tags,
	merge_pointed_to_info): Likewise.
	* tree-ssa-dom.c (tree_ssa_dominator_optimize): Likewise.
	* tree-ssa-loop-im.c (move_computations): Likewise.
	* tree-ssa-operands.c (get_call_expr_operands): Likewise.
	* tree-ssa-pre.c (fini_pre): Likewise.
	* tree-ssa.c (verify_flow_sensitive_alias_info): Likewise.
	* tree-ssanames.c (any_marked_for_rewrite_p): Likewise.
	* tree-vectorizer.c (vectorize_loops): Likewise.

From-SVN: r89827
parent ec7e5618
2004-10-28 Nathan Sidwell <nathan@codesourcery.com>
* bitmap.h (bitmap_empty_p): New.
(bitmap_and, bitmap_and_into, bitmap_and_compl,
bitmap_and_compl_into, bitmap_ior, bitmap_ior_into,
bitmap_ior_compl, bitmap_xor, bitmap_xor_into): New bitmap
operation macros.
(bitmap_ior_and_compl): Rename to ...
(bitmap_ior_and_compl_into): ... here.
* bitmap.c (bitmap_equal_p): Use bitmap_xor.
(bitmap_ior_and_compl): Rename to ...
(bitmap_ior_and_compl_into): ... here. Adjust. Return changed
flag.
(bitmap_union_of_diff): Use renamed bitmap functions.
* basic-block.h (AND_REG_SET, AND_COMPL_REG_SET, IOR_REG_SET,
XOR_REG_SET, IOR_AND_COMPL_REG_SET): Likewise.
* cfgrtl.c (safe_insert_insn_on_edge): Likewise.
* df.c (df_bb_rd_local_compute)
* flow.c (calculate_global_regs_live,
init_propagate_block_info): Likewise.
* ifcvt.c (find_if_case_1, find_if_case_2,
dead_or_predicable): Likewise.
* ra-build.c (union_web_part_roots, livethrough_conflicts_bb,
reset_conflicts, conflicts_between_webs): Likewise.
* ra-rewrite.c (reloads_to_loads, rewrite_program2,
detect_web_parts_to_rebuild): Likewise.
* sched-ebb.c (compute_jump_reg_dependencies): Likewise.
* tree-int-ssa.c (insert_phi_nodes_for, rewrite_into_ssa): Likewise.
* tree-sra.c (decide_instantiations): Likewise.
* tree-ssa-alias.c (create_name_tags,
merge_pointed_to_info): Likewise.
* tree-ssa-dom.c (tree_ssa_dominator_optimize): Likewise.
* tree-ssa-loop-im.c (move_computations): Likewise.
* tree-ssa-operands.c (get_call_expr_operands): Likewise.
* tree-ssa-pre.c (fini_pre): Likewise.
* tree-ssa.c (verify_flow_sensitive_alias_info): Likewise.
* tree-ssanames.c (any_marked_for_rewrite_p): Likewise.
* tree-vectorizer.c (vectorize_loops): Likewise.
2004-10-29 Nick Clifton <nickc@redhat.com> 2004-10-29 Nick Clifton <nickc@redhat.com>
config/mn10300/mn10300.h (CONDITIONAL_REGISTER_USAGE): When config/mn10300/mn10300.h (CONDITIONAL_REGISTER_USAGE): When
......
...@@ -50,21 +50,20 @@ typedef bitmap regset; ...@@ -50,21 +50,20 @@ typedef bitmap regset;
#define REG_SET_EQUAL_P(A, B) bitmap_equal_p (A, B) #define REG_SET_EQUAL_P(A, B) bitmap_equal_p (A, B)
/* `and' a register set with a second register set. */ /* `and' a register set with a second register set. */
#define AND_REG_SET(TO, FROM) bitmap_operation (TO, TO, FROM, BITMAP_AND) #define AND_REG_SET(TO, FROM) bitmap_and_into (TO, FROM)
/* `and' the complement of a register set with a register set. */ /* `and' the complement of a register set with a register set. */
#define AND_COMPL_REG_SET(TO, FROM) \ #define AND_COMPL_REG_SET(TO, FROM) bitmap_and_compl_into (TO, FROM)
bitmap_operation (TO, TO, FROM, BITMAP_AND_COMPL)
/* Inclusive or a register set with a second register set. */ /* Inclusive or a register set with a second register set. */
#define IOR_REG_SET(TO, FROM) bitmap_operation (TO, TO, FROM, BITMAP_IOR) #define IOR_REG_SET(TO, FROM) bitmap_ior_into (TO, FROM)
/* Exclusive or a register set with a second register set. */ /* Exclusive or a register set with a second register set. */
#define XOR_REG_SET(TO, FROM) bitmap_operation (TO, TO, FROM, BITMAP_XOR) #define XOR_REG_SET(TO, FROM) bitmap_xor_into (TO, FROM)
/* Or into TO the register set FROM1 `and'ed with the complement of FROM2. */ /* Or into TO the register set FROM1 `and'ed with the complement of FROM2. */
#define IOR_AND_COMPL_REG_SET(TO, FROM1, FROM2) \ #define IOR_AND_COMPL_REG_SET(TO, FROM1, FROM2) \
bitmap_ior_and_compl (TO, FROM1, FROM2) bitmap_ior_and_compl_into (TO, FROM1, FROM2)
/* Clear a single register in a register set. */ /* Clear a single register in a register set. */
#define CLEAR_REGNO_REG_SET(HEAD, REG) bitmap_clear_bit (HEAD, REG) #define CLEAR_REGNO_REG_SET(HEAD, REG) bitmap_clear_bit (HEAD, REG)
......
...@@ -672,7 +672,7 @@ bitmap_equal_p (bitmap a, bitmap b) ...@@ -672,7 +672,7 @@ bitmap_equal_p (bitmap a, bitmap b)
int ret; int ret;
memset (&c, 0, sizeof (c)); memset (&c, 0, sizeof (c));
ret = ! bitmap_operation (&c, a, b, BITMAP_XOR); ret = ! bitmap_xor (&c, a, b);
bitmap_clear (&c); bitmap_clear (&c);
return ret; return ret;
...@@ -681,17 +681,19 @@ bitmap_equal_p (bitmap a, bitmap b) ...@@ -681,17 +681,19 @@ bitmap_equal_p (bitmap a, bitmap b)
/* Or into bitmap TO bitmap FROM1 and'ed with the complement of /* Or into bitmap TO bitmap FROM1 and'ed with the complement of
bitmap FROM2. */ bitmap FROM2. */
void int
bitmap_ior_and_compl (bitmap to, bitmap from1, bitmap from2) bitmap_ior_and_compl_into (bitmap to, bitmap from1, bitmap from2)
{ {
bitmap_head tmp; bitmap_head tmp;
int changed;
tmp.first = tmp.current = 0; tmp.first = tmp.current = 0;
tmp.using_obstack = 0; tmp.using_obstack = 0;
bitmap_operation (&tmp, from1, from2, BITMAP_AND_COMPL); bitmap_and_compl (&tmp, from1, from2);
bitmap_operation (to, to, &tmp, BITMAP_IOR); changed = bitmap_ior_into (to, &tmp);
bitmap_clear (&tmp); bitmap_clear (&tmp);
return changed;
} }
int int
...@@ -703,8 +705,8 @@ bitmap_union_of_diff (bitmap dst, bitmap a, bitmap b, bitmap c) ...@@ -703,8 +705,8 @@ bitmap_union_of_diff (bitmap dst, bitmap a, bitmap b, bitmap c)
tmp.first = tmp.current = 0; tmp.first = tmp.current = 0;
tmp.using_obstack = 0; tmp.using_obstack = 0;
bitmap_operation (&tmp, b, c, BITMAP_AND_COMPL); bitmap_and_compl (&tmp, b, c);
changed = bitmap_operation (dst, &tmp, a, BITMAP_IOR); changed = bitmap_ior (dst, &tmp, a);
bitmap_clear (&tmp); bitmap_clear (&tmp);
return changed; return changed;
......
...@@ -87,12 +87,24 @@ extern void bitmap_copy (bitmap, bitmap); ...@@ -87,12 +87,24 @@ extern void bitmap_copy (bitmap, bitmap);
/* True if two bitmaps are identical. */ /* True if two bitmaps are identical. */
extern int bitmap_equal_p (bitmap, bitmap); extern int bitmap_equal_p (bitmap, bitmap);
#define bitmap_empty_p(MAP) (!(MAP)->first)
/* Perform an operation on two bitmaps, yielding a third. */ /* Perform an operation on two bitmaps, yielding a third. */
extern int bitmap_operation (bitmap, bitmap, bitmap, enum bitmap_bits); extern int bitmap_operation (bitmap, bitmap, bitmap, enum bitmap_bits);
#define bitmap_and(DST,A,B) bitmap_operation (DST,A,B,BITMAP_AND)
#define bitmap_and_into(DST_SRC,B) bitmap_operation (DST_SRC,DST_SRC,B,BITMAP_AND)
#define bitmap_and_compl(DST,A,B) bitmap_operation (DST,A,B,BITMAP_AND_COMPL)
#define bitmap_and_compl_into(DST_SRC,B) bitmap_operation (DST_SRC,DST_SRC,B,BITMAP_AND_COMPL)
#define bitmap_ior(DST,A,B) bitmap_operation (DST,A,B,BITMAP_IOR)
#define bitmap_ior_into(DST_SRC,B) bitmap_operation (DST_SRC,DST_SRC,B,BITMAP_IOR)
#define bitmap_ior_compl(DST,A,B) bitmap_operation (DST,A,B,BITMAP_IOR_COMPL)
#define bitmap_xor(DST,A,B) bitmap_operation (DST,A,B,BITMAP_XOR)
#define bitmap_xor_into(DST_SRC,B) bitmap_operation (DST_SRC,DST_SRC,B,BITMAP_XOR)
/* `or' into one bitmap the `and' of a second bitmap witih the complement /* `or' into one bitmap the `and' of a second bitmap witih the complement
of a third. */ of a third. Return nonzero if the bitmap changes. */
extern void bitmap_ior_and_compl (bitmap, bitmap, bitmap); extern int bitmap_ior_and_compl_into (bitmap, bitmap, bitmap);
/* Clear a single register in a register set. */ /* Clear a single register in a register set. */
extern void bitmap_clear_bit (bitmap, int); extern void bitmap_clear_bit (bitmap, int);
......
...@@ -1476,8 +1476,7 @@ safe_insert_insn_on_edge (rtx insn, edge e) ...@@ -1476,8 +1476,7 @@ safe_insert_insn_on_edge (rtx insn, edge e)
for (x = insn; x; x = NEXT_INSN (x)) for (x = insn; x; x = NEXT_INSN (x))
if (INSN_P (x)) if (INSN_P (x))
note_stores (PATTERN (x), mark_killed_regs, killed); note_stores (PATTERN (x), mark_killed_regs, killed);
bitmap_operation (killed, killed, e->dest->global_live_at_start, bitmap_and_into (killed, e->dest->global_live_at_start);
BITMAP_AND);
EXECUTE_IF_SET_IN_REG_SET (killed, 0, regno, rsi) EXECUTE_IF_SET_IN_REG_SET (killed, 0, regno, rsi)
{ {
......
...@@ -1657,8 +1657,7 @@ df_bb_rd_local_compute (struct df *df, basic_block bb, bitmap call_killed_defs) ...@@ -1657,8 +1657,7 @@ df_bb_rd_local_compute (struct df *df, basic_block bb, bitmap call_killed_defs)
if (CALL_P (insn) && (df->flags & DF_HARD_REGS)) if (CALL_P (insn) && (df->flags & DF_HARD_REGS))
{ {
bitmap_operation (bb_info->rd_kill, bb_info->rd_kill, bitmap_ior_into (bb_info->rd_kill, call_killed_defs);
call_killed_defs, BITMAP_IOR);
call_seen = 1; call_seen = 1;
} }
} }
......
...@@ -1114,11 +1114,9 @@ calculate_global_regs_live (sbitmap blocks_in, sbitmap blocks_out, int flags) ...@@ -1114,11 +1114,9 @@ calculate_global_regs_live (sbitmap blocks_in, sbitmap blocks_out, int flags)
/* ??? Abnormal call edges ignored for the moment, as this gets /* ??? Abnormal call edges ignored for the moment, as this gets
confused by sibling call edges, which crashes reg-stack. */ confused by sibling call edges, which crashes reg-stack. */
if (e->flags & EDGE_EH) if (e->flags & EDGE_EH)
{ bitmap_ior_and_compl_into (new_live_at_end,
bitmap_operation (tmp, sb->global_live_at_start, sb->global_live_at_start,
invalidated_by_call, BITMAP_AND_COMPL); invalidated_by_call);
IOR_REG_SET (new_live_at_end, tmp);
}
else else
IOR_REG_SET (new_live_at_end, sb->global_live_at_start); IOR_REG_SET (new_live_at_end, sb->global_live_at_start);
...@@ -1188,8 +1186,8 @@ calculate_global_regs_live (sbitmap blocks_in, sbitmap blocks_out, int flags) ...@@ -1188,8 +1186,8 @@ calculate_global_regs_live (sbitmap blocks_in, sbitmap blocks_out, int flags)
precalculated local_live, however with PROP_SCAN_DEAD_CODE precalculated local_live, however with PROP_SCAN_DEAD_CODE
local_live is really dependent on live_at_end. */ local_live is really dependent on live_at_end. */
CLEAR_REG_SET (tmp); CLEAR_REG_SET (tmp);
rescan = bitmap_operation (tmp, bb->global_live_at_end, rescan = bitmap_and_compl (tmp, bb->global_live_at_end,
new_live_at_end, BITMAP_AND_COMPL); new_live_at_end);
if (! rescan) if (! rescan)
{ {
...@@ -1201,8 +1199,8 @@ calculate_global_regs_live (sbitmap blocks_in, sbitmap blocks_out, int flags) ...@@ -1201,8 +1199,8 @@ calculate_global_regs_live (sbitmap blocks_in, sbitmap blocks_out, int flags)
block. We can miss changes in those sets if we only block. We can miss changes in those sets if we only
compare the new live_at_end against the previous one. */ compare the new live_at_end against the previous one. */
CLEAR_REG_SET (tmp); CLEAR_REG_SET (tmp);
rescan = bitmap_operation (tmp, new_live_at_end, rescan = bitmap_and (tmp, new_live_at_end,
bb->cond_local_set, BITMAP_AND); bb->cond_local_set);
} }
if (! rescan) if (! rescan)
...@@ -1210,16 +1208,15 @@ calculate_global_regs_live (sbitmap blocks_in, sbitmap blocks_out, int flags) ...@@ -1210,16 +1208,15 @@ calculate_global_regs_live (sbitmap blocks_in, sbitmap blocks_out, int flags)
/* Find the set of changed bits. Take this opportunity /* Find the set of changed bits. Take this opportunity
to notice that this set is empty and early out. */ to notice that this set is empty and early out. */
CLEAR_REG_SET (tmp); CLEAR_REG_SET (tmp);
changed = bitmap_operation (tmp, bb->global_live_at_end, changed = bitmap_xor (tmp, bb->global_live_at_end,
new_live_at_end, BITMAP_XOR); new_live_at_end);
if (! changed) if (! changed)
continue; continue;
/* If any of the changed bits overlap with local_set, /* If any of the changed bits overlap with local_set,
we'll have to rescan the block. Detect overlap by we'll have to rescan the block. Detect overlap by
the AND with ~local_set turning off bits. */ the AND with ~local_set turning off bits. */
rescan = bitmap_operation (tmp, tmp, bb->local_set, rescan = bitmap_and_compl_into (tmp, bb->local_set);
BITMAP_AND_COMPL);
} }
} }
...@@ -1232,14 +1229,11 @@ calculate_global_regs_live (sbitmap blocks_in, sbitmap blocks_out, int flags) ...@@ -1232,14 +1229,11 @@ calculate_global_regs_live (sbitmap blocks_in, sbitmap blocks_out, int flags)
{ {
/* Add to live_at_start the set of all registers in /* Add to live_at_start the set of all registers in
new_live_at_end that aren't in the old live_at_end. */ new_live_at_end that aren't in the old live_at_end. */
bitmap_operation (tmp, new_live_at_end, bb->global_live_at_end, changed = bitmap_ior_and_compl_into (bb->global_live_at_start,
BITMAP_AND_COMPL); new_live_at_end,
bb->global_live_at_end);
COPY_REG_SET (bb->global_live_at_end, new_live_at_end); COPY_REG_SET (bb->global_live_at_end, new_live_at_end);
changed = bitmap_operation (bb->global_live_at_start,
bb->global_live_at_start,
tmp, BITMAP_IOR);
if (! changed) if (! changed)
continue; continue;
} }
...@@ -1860,8 +1854,8 @@ init_propagate_block_info (basic_block bb, regset live, regset local_set, ...@@ -1860,8 +1854,8 @@ init_propagate_block_info (basic_block bb, regset live, regset local_set,
} }
/* Compute which register lead different lives in the successors. */ /* Compute which register lead different lives in the successors. */
if (bitmap_operation (diff, bb_true->global_live_at_start, if (bitmap_xor (diff, bb_true->global_live_at_start,
bb_false->global_live_at_start, BITMAP_XOR)) bb_false->global_live_at_start))
{ {
/* Extract the condition from the branch. */ /* Extract the condition from the branch. */
rtx set_src = SET_SRC (pc_set (BB_END (bb))); rtx set_src = SET_SRC (pc_set (BB_END (bb)));
......
...@@ -2914,9 +2914,9 @@ find_if_case_1 (basic_block test_bb, edge then_edge, edge else_edge) ...@@ -2914,9 +2914,9 @@ find_if_case_1 (basic_block test_bb, edge then_edge, edge else_edge)
/* Conversion went ok, including moving the insns and fixing up the /* Conversion went ok, including moving the insns and fixing up the
jump. Adjust the CFG to match. */ jump. Adjust the CFG to match. */
bitmap_operation (test_bb->global_live_at_end, bitmap_ior (test_bb->global_live_at_end,
else_bb->global_live_at_start, else_bb->global_live_at_start,
then_bb->global_live_at_end, BITMAP_IOR); then_bb->global_live_at_end);
new_bb = redirect_edge_and_branch_force (FALLTHRU_EDGE (test_bb), else_bb); new_bb = redirect_edge_and_branch_force (FALLTHRU_EDGE (test_bb), else_bb);
then_bb_index = then_bb->index; then_bb_index = then_bb->index;
...@@ -3018,9 +3018,9 @@ find_if_case_2 (basic_block test_bb, edge then_edge, edge else_edge) ...@@ -3018,9 +3018,9 @@ find_if_case_2 (basic_block test_bb, edge then_edge, edge else_edge)
/* Conversion went ok, including moving the insns and fixing up the /* Conversion went ok, including moving the insns and fixing up the
jump. Adjust the CFG to match. */ jump. Adjust the CFG to match. */
bitmap_operation (test_bb->global_live_at_end, bitmap_ior (test_bb->global_live_at_end,
then_bb->global_live_at_start, then_bb->global_live_at_start,
else_bb->global_live_at_end, BITMAP_IOR); else_bb->global_live_at_end);
delete_basic_block (else_bb); delete_basic_block (else_bb);
...@@ -3217,14 +3217,13 @@ dead_or_predicable (basic_block test_bb, basic_block merge_bb, ...@@ -3217,14 +3217,13 @@ dead_or_predicable (basic_block test_bb, basic_block merge_bb,
TEST_SET & merge_bb->global_live_at_start TEST_SET & merge_bb->global_live_at_start
are empty. */ are empty. */
bitmap_operation (tmp, test_set, test_live, BITMAP_IOR); bitmap_ior (tmp, test_set, test_live);
bitmap_operation (tmp, tmp, merge_set, BITMAP_AND); bitmap_and_into (tmp, merge_set);
if (bitmap_first_set_bit (tmp) >= 0) if (!bitmap_empty_p (tmp))
fail = 1; fail = 1;
bitmap_operation (tmp, test_set, merge_bb->global_live_at_start, bitmap_and (tmp, test_set, merge_bb->global_live_at_start);
BITMAP_AND); if (!bitmap_empty_p (tmp))
if (bitmap_first_set_bit (tmp) >= 0)
fail = 1; fail = 1;
FREE_REG_SET (tmp); FREE_REG_SET (tmp);
......
...@@ -503,8 +503,7 @@ union_web_part_roots (struct web_part *r1, struct web_part *r2) ...@@ -503,8 +503,7 @@ union_web_part_roots (struct web_part *r1, struct web_part *r2)
for (cl2 = r2->sub_conflicts; cl2; cl2 = cl2->next) for (cl2 = r2->sub_conflicts; cl2; cl2 = cl2->next)
if (cl1->size_word == cl2->size_word) if (cl1->size_word == cl2->size_word)
{ {
bitmap_operation (cl1->conflicts, cl1->conflicts, bitmap_ior_into (cl1->conflicts, cl2->conflicts);
cl2->conflicts, BITMAP_IOR);
BITMAP_XFREE (cl2->conflicts); BITMAP_XFREE (cl2->conflicts);
cl2->conflicts = NULL; cl2->conflicts = NULL;
} }
...@@ -1057,7 +1056,7 @@ livethrough_conflicts_bb (basic_block bb) ...@@ -1057,7 +1056,7 @@ livethrough_conflicts_bb (basic_block bb)
uses conflict with all defs, and update their other members. */ uses conflict with all defs, and update their other members. */
if (deaths > 0 if (deaths > 0
|| contains_call || contains_call
|| bitmap_first_set_bit (all_defs) >= 0) || !bitmap_empty_p (all_defs))
{ {
bitmap_iterator bi; bitmap_iterator bi;
...@@ -1070,7 +1069,7 @@ livethrough_conflicts_bb (basic_block bb) ...@@ -1070,7 +1069,7 @@ livethrough_conflicts_bb (basic_block bb)
wp->spanned_deaths += deaths; wp->spanned_deaths += deaths;
wp->crosses_call |= contains_call; wp->crosses_call |= contains_call;
conflicts = get_sub_conflicts (wp, bl); conflicts = get_sub_conflicts (wp, bl);
bitmap_operation (conflicts, conflicts, all_defs, BITMAP_IOR); bitmap_ior_into (conflicts, all_defs);
} }
} }
...@@ -2076,14 +2075,13 @@ reset_conflicts (void) ...@@ -2076,14 +2075,13 @@ reset_conflicts (void)
/* Useless conflicts will be rebuilt completely. But check /* Useless conflicts will be rebuilt completely. But check
for cleanliness, as the web might have come from the for cleanliness, as the web might have come from the
free list. */ free list. */
gcc_assert (bitmap_first_set_bit (web->useless_conflicts) < 0); gcc_assert (bitmap_empty_p (web->useless_conflicts));
} }
else else
{ {
/* Useless conflicts with new webs will be rebuilt if they /* Useless conflicts with new webs will be rebuilt if they
are still there. */ are still there. */
bitmap_operation (web->useless_conflicts, web->useless_conflicts, bitmap_and_compl_into (web->useless_conflicts, newwebs);
newwebs, BITMAP_AND_COMPL);
/* Go through all conflicts, and retain those to old webs. */ /* Go through all conflicts, and retain those to old webs. */
for (cl = web->conflict_list; cl; cl = cl->next) for (cl = web->conflict_list; cl; cl = cl->next)
{ {
...@@ -2172,7 +2170,7 @@ conflicts_between_webs (struct df *df) ...@@ -2172,7 +2170,7 @@ conflicts_between_webs (struct df *df)
for (i = 0; i < df->def_id; i++) for (i = 0; i < df->def_id; i++)
if (web_parts[i].ref == NULL) if (web_parts[i].ref == NULL)
bitmap_set_bit (ignore_defs, i); bitmap_set_bit (ignore_defs, i);
have_ignored = (bitmap_first_set_bit (ignore_defs) >= 0); have_ignored = !bitmap_empty_p (ignore_defs);
/* Now record all conflicts between webs. Note that we only check /* Now record all conflicts between webs. Note that we only check
the conflict bitmaps of all defs. Conflict bitmaps are only in the conflict bitmaps of all defs. Conflict bitmaps are only in
...@@ -2200,8 +2198,7 @@ conflicts_between_webs (struct df *df) ...@@ -2200,8 +2198,7 @@ conflicts_between_webs (struct df *df)
bitmap_iterator bi; bitmap_iterator bi;
if (have_ignored) if (have_ignored)
bitmap_operation (cl->conflicts, cl->conflicts, ignore_defs, bitmap_and_compl_into (cl->conflicts, ignore_defs);
BITMAP_AND_COMPL);
/* We reduce the number of calls to record_conflict() with this /* We reduce the number of calls to record_conflict() with this
pass thing. record_conflict() itself also has some early-out pass thing. record_conflict() itself also has some early-out
optimizations, but here we can use the special properties of optimizations, but here we can use the special properties of
......
...@@ -1034,8 +1034,7 @@ reloads_to_loads (struct rewrite_info *ri, struct ref **refs, ...@@ -1034,8 +1034,7 @@ reloads_to_loads (struct rewrite_info *ri, struct ref **refs,
} }
} }
if (num_reloads != old_num_r) if (num_reloads != old_num_r)
bitmap_operation (ri->need_reload, ri->need_reload, ri->scratch, bitmap_and_compl_into (ri->need_reload, ri->scratch);
BITMAP_AND_COMPL);
} }
} }
ri->num_reloads = num_reloads; ri->num_reloads = num_reloads;
...@@ -1163,8 +1162,7 @@ rewrite_program2 (bitmap new_deaths) ...@@ -1163,8 +1162,7 @@ rewrite_program2 (bitmap new_deaths)
ri.num_reloads--; ri.num_reloads--;
} }
} }
bitmap_operation (ri.need_reload, ri.need_reload, ri.scratch, bitmap_and_compl_into (ri.need_reload, ri.scratch);
BITMAP_AND_COMPL);
last_bb = BLOCK_FOR_INSN (insn); last_bb = BLOCK_FOR_INSN (insn);
last_block_insn = insn; last_block_insn = insn;
if (!INSN_P (last_block_insn)) if (!INSN_P (last_block_insn))
...@@ -1397,9 +1395,8 @@ rewrite_program2 (bitmap new_deaths) ...@@ -1397,9 +1395,8 @@ rewrite_program2 (bitmap new_deaths)
bitmap_set_bit (ri.scratch, j); bitmap_set_bit (ri.scratch, j);
ri.num_reloads--; ri.num_reloads--;
} }
} }
bitmap_operation (ri.need_reload, ri.need_reload, ri.scratch, bitmap_and_compl_into (ri.need_reload, ri.scratch);
BITMAP_AND_COMPL);
} }
ri.need_load = 1; ri.need_load = 1;
...@@ -1541,8 +1538,7 @@ detect_web_parts_to_rebuild (void) ...@@ -1541,8 +1538,7 @@ detect_web_parts_to_rebuild (void)
indeed not become member of it again). */ indeed not become member of it again). */
live_at_end -= 2; live_at_end -= 2;
for (i = 0; i < (unsigned int) last_basic_block + 2; i++) for (i = 0; i < (unsigned int) last_basic_block + 2; i++)
bitmap_operation (live_at_end[i], live_at_end[i], uses_as_bitmap, bitmap_and_compl_into (live_at_end[i], uses_as_bitmap);
BITMAP_AND_COMPL);
live_at_end += 2; live_at_end += 2;
if (dump_file && (debug_new_regalloc & DUMP_REBUILD) != 0) if (dump_file && (debug_new_regalloc & DUMP_REBUILD) != 0)
......
...@@ -184,11 +184,9 @@ compute_jump_reg_dependencies (rtx insn, regset cond_set, regset used, ...@@ -184,11 +184,9 @@ compute_jump_reg_dependencies (rtx insn, regset cond_set, regset used,
it may guard the fallthrough block from using a value that has it may guard the fallthrough block from using a value that has
conditionally overwritten that of the main codepath. So we conditionally overwritten that of the main codepath. So we
consider that it restores the value of the main codepath. */ consider that it restores the value of the main codepath. */
bitmap_operation (set, e->dest->global_live_at_start, cond_set, bitmap_and (set, e->dest->global_live_at_start, cond_set);
BITMAP_AND);
else else
bitmap_operation (used, used, e->dest->global_live_at_start, bitmap_ior_into (used, e->dest->global_live_at_start);
BITMAP_IOR);
} }
/* Used in schedule_insns to initialize current_sched_info for scheduling /* Used in schedule_insns to initialize current_sched_info for scheduling
......
...@@ -1056,8 +1056,7 @@ insert_phi_nodes_for (tree var, bitmap *dfs, varray_type *work_stack) ...@@ -1056,8 +1056,7 @@ insert_phi_nodes_for (tree var, bitmap *dfs, varray_type *work_stack)
} }
/* Remove the blocks where we already have the phis. */ /* Remove the blocks where we already have the phis. */
bitmap_operation (phi_insertion_points, phi_insertion_points, bitmap_and_compl_into (phi_insertion_points, def_map->phi_blocks);
def_map->phi_blocks, BITMAP_AND_COMPL);
/* Now compute global livein for this variable. Note this modifies /* Now compute global livein for this variable. Note this modifies
def_map->livein_blocks. */ def_map->livein_blocks. */
...@@ -1562,7 +1561,7 @@ rewrite_into_ssa (bool all) ...@@ -1562,7 +1561,7 @@ rewrite_into_ssa (bool all)
/* Initialize the array of variables to rename. */ /* Initialize the array of variables to rename. */
gcc_assert (vars_to_rename); gcc_assert (vars_to_rename);
if (bitmap_first_set_bit (vars_to_rename) < 0) if (bitmap_empty_p (vars_to_rename))
{ {
timevar_pop (TV_TREE_SSA_OTHER); timevar_pop (TV_TREE_SSA_OTHER);
return; return;
......
...@@ -1388,10 +1388,8 @@ decide_instantiations (void) ...@@ -1388,10 +1388,8 @@ decide_instantiations (void)
if (cleared_any) if (cleared_any)
{ {
bitmap_operation (sra_candidates, sra_candidates, &done_head, bitmap_and_compl_into (sra_candidates, &done_head);
BITMAP_AND_COMPL); bitmap_and_compl_into (needs_copy_in, &done_head);
bitmap_operation (needs_copy_in, needs_copy_in, &done_head,
BITMAP_AND_COMPL);
} }
bitmap_clear (&done_head); bitmap_clear (&done_head);
......
...@@ -747,8 +747,7 @@ create_name_tags (struct alias_info *ai) ...@@ -747,8 +747,7 @@ create_name_tags (struct alias_info *ai)
continue; continue;
} }
if (pi->pt_vars if (pi->pt_vars && !bitmap_empty_p (pi->pt_vars))
&& bitmap_first_set_bit (pi->pt_vars) >= 0)
{ {
size_t j; size_t j;
tree old_name_tag = pi->name_mem_tag; tree old_name_tag = pi->name_mem_tag;
...@@ -1733,7 +1732,7 @@ merge_pointed_to_info (struct alias_info *ai, tree dest, tree orig) ...@@ -1733,7 +1732,7 @@ merge_pointed_to_info (struct alias_info *ai, tree dest, tree orig)
if (!dest_pi->pt_anything if (!dest_pi->pt_anything
&& orig_pi->pt_vars && orig_pi->pt_vars
&& bitmap_first_set_bit (orig_pi->pt_vars) >= 0) && !bitmap_empty_p (orig_pi->pt_vars))
{ {
if (dest_pi->pt_vars == NULL) if (dest_pi->pt_vars == NULL)
{ {
......
...@@ -356,7 +356,7 @@ tree_ssa_dominator_optimize (void) ...@@ -356,7 +356,7 @@ tree_ssa_dominator_optimize (void)
interactions between rewriting of _DECL nodes into SSA form interactions between rewriting of _DECL nodes into SSA form
and rewriting SSA_NAME nodes into SSA form after block and rewriting SSA_NAME nodes into SSA form after block
duplication and CFG manipulation. */ duplication and CFG manipulation. */
if (bitmap_first_set_bit (vars_to_rename) >= 0) if (!bitmap_empty_p (vars_to_rename))
{ {
rewrite_into_ssa (false); rewrite_into_ssa (false);
bitmap_clear (vars_to_rename); bitmap_clear (vars_to_rename);
...@@ -367,7 +367,7 @@ tree_ssa_dominator_optimize (void) ...@@ -367,7 +367,7 @@ tree_ssa_dominator_optimize (void)
/* Removal of statements may make some EH edges dead. Purge /* Removal of statements may make some EH edges dead. Purge
such edges from the CFG as needed. */ such edges from the CFG as needed. */
if (bitmap_first_set_bit (need_eh_cleanup) >= 0) if (!bitmap_empty_p (need_eh_cleanup))
{ {
cfg_altered |= tree_purge_all_dead_eh_edges (need_eh_cleanup); cfg_altered |= tree_purge_all_dead_eh_edges (need_eh_cleanup);
bitmap_zero (need_eh_cleanup); bitmap_zero (need_eh_cleanup);
......
...@@ -679,7 +679,7 @@ move_computations (void) ...@@ -679,7 +679,7 @@ move_computations (void)
loop_commit_inserts (); loop_commit_inserts ();
rewrite_into_ssa (false); rewrite_into_ssa (false);
if (bitmap_first_set_bit (vars_to_rename) >= 0) if (!bitmap_empty_p (vars_to_rename))
{ {
/* The rewrite of ssa names may cause violation of loop closed ssa /* The rewrite of ssa names may cause violation of loop closed ssa
form invariants. TODO -- avoid these rewrites completely. form invariants. TODO -- avoid these rewrites completely.
......
...@@ -1411,7 +1411,7 @@ get_call_expr_operands (tree stmt, tree expr) ...@@ -1411,7 +1411,7 @@ get_call_expr_operands (tree stmt, tree expr)
get_expr_operands (stmt, &TREE_OPERAND (expr, 2), opf_none); get_expr_operands (stmt, &TREE_OPERAND (expr, 2), opf_none);
if (bitmap_first_set_bit (call_clobbered_vars) >= 0) if (!bitmap_empty_p (call_clobbered_vars))
{ {
/* A 'pure' or a 'const' functions never call clobber anything. /* A 'pure' or a 'const' functions never call clobber anything.
A 'noreturn' function might, but since we don't return anyway A 'noreturn' function might, but since we don't return anyway
......
...@@ -1983,7 +1983,7 @@ fini_pre (void) ...@@ -1983,7 +1983,7 @@ fini_pre (void)
free_dominance_info (CDI_POST_DOMINATORS); free_dominance_info (CDI_POST_DOMINATORS);
vn_delete (); vn_delete ();
if (bitmap_first_set_bit (need_eh_cleanup) >= 0) if (!bitmap_empty_p (need_eh_cleanup))
{ {
tree_purge_all_dead_eh_edges (need_eh_cleanup); tree_purge_all_dead_eh_edges (need_eh_cleanup);
cleanup_tree_cfg (); cleanup_tree_cfg ();
......
...@@ -470,8 +470,7 @@ verify_flow_sensitive_alias_info (void) ...@@ -470,8 +470,7 @@ verify_flow_sensitive_alias_info (void)
if (pi->name_mem_tag if (pi->name_mem_tag
&& !pi->pt_malloc && !pi->pt_malloc
&& (pi->pt_vars == NULL && (pi->pt_vars == NULL || bitmap_empty_p (pi->pt_vars)))
|| bitmap_first_set_bit (pi->pt_vars) < 0))
{ {
error ("Pointers with a memory tag, should have points-to sets or point to malloc"); error ("Pointers with a memory tag, should have points-to sets or point to malloc");
goto err; goto err;
......
...@@ -97,7 +97,7 @@ any_marked_for_rewrite_p (void) ...@@ -97,7 +97,7 @@ any_marked_for_rewrite_p (void)
if (!ssa_names_to_rewrite) if (!ssa_names_to_rewrite)
return false; return false;
return bitmap_first_set_bit (ssa_names_to_rewrite) != -1; return !bitmap_empty_p (ssa_names_to_rewrite);
} }
/* Mark ssa name VAR for rewriting. */ /* Mark ssa name VAR for rewriting. */
......
...@@ -5664,7 +5664,7 @@ vectorize_loops (struct loops *loops) ...@@ -5664,7 +5664,7 @@ vectorize_loops (struct loops *loops)
} }
rewrite_into_ssa (false); rewrite_into_ssa (false);
if (bitmap_first_set_bit (vars_to_rename) >= 0) if (!bitmap_empty_p (vars_to_rename))
{ {
/* The rewrite of ssa names may cause violation of loop closed ssa /* The rewrite of ssa names may cause violation of loop closed ssa
form invariants. TODO -- avoid these rewrites completely. form invariants. TODO -- avoid these rewrites completely.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment