diff options
author | Trevor Saunders <tsaunders@mozilla.com> | 2014-02-19 01:38:38 -0500 |
---|---|---|
committer | Trevor Saunders <tsaunders@mozilla.com> | 2014-02-19 01:38:38 -0500 |
commit | 9bc7d927549ac3adb15bc7a33489c211a6b646d5 (patch) | |
tree | a06c5428be836c81303aaf664ab480a4964f28ab | |
parent | 27da057af3571d6bf84eb19052d6a05db6f360a0 (diff) | |
download | gcc-tbsaunde/bitmap.tar.gz |
kill bitmap_and_intotbsaunde/bitmap
-rw-r--r-- | gcc/bitmap.c | 18 | ||||
-rw-r--r-- | gcc/bitmap.h | 8 | ||||
-rw-r--r-- | gcc/df-core.c | 2 | ||||
-rw-r--r-- | gcc/df-problems.c | 14 | ||||
-rw-r--r-- | gcc/dse.c | 4 | ||||
-rw-r--r-- | gcc/ifcvt.c | 6 | ||||
-rw-r--r-- | gcc/ipa-reference.c | 2 | ||||
-rw-r--r-- | gcc/ira.c | 2 | ||||
-rw-r--r-- | gcc/trans-mem.c | 6 | ||||
-rw-r--r-- | gcc/tree-ssa-loop-manip.c | 2 | ||||
-rw-r--r-- | gcc/tree-ssa-pre.c | 2 | ||||
-rw-r--r-- | gcc/tree-vrp.c | 2 |
12 files changed, 36 insertions, 32 deletions
diff --git a/gcc/bitmap.c b/gcc/bitmap.c index d6619e112c3..1b758a81c3a 100644 --- a/gcc/bitmap.c +++ b/gcc/bitmap.c @@ -949,14 +949,14 @@ bitmap_and (bitmap dst, const_bitmap a, const_bitmap b) /* A &= B. Return true if A changed. */ bool -bitmap_and_into (bitmap a, const_bitmap b) +bitmap_head::bit_and (const bitmap_head &other) { - bitmap_element *a_elt = a->first; - const bitmap_element *b_elt = b->first; + bitmap_element *a_elt = first; + const bitmap_element *b_elt = other.first; bitmap_element *next; bool changed = false; - if (a == b) + if (this == &other) return false; while (a_elt && b_elt) @@ -964,7 +964,7 @@ bitmap_and_into (bitmap a, const_bitmap b) if (a_elt->indx < b_elt->indx) { next = a_elt->next; - bitmap_element_free (a, a_elt); + bitmap_element_free (this, a_elt); a_elt = next; changed = true; } @@ -986,7 +986,7 @@ bitmap_and_into (bitmap a, const_bitmap b) } next = a_elt->next; if (!ior) - bitmap_element_free (a, a_elt); + bitmap_element_free (this, a_elt); a_elt = next; b_elt = b_elt->next; } @@ -995,11 +995,11 @@ bitmap_and_into (bitmap a, const_bitmap b) if (a_elt) { changed = true; - bitmap_elt_clear_from (a, a_elt); + bitmap_elt_clear_from (this, a_elt); } - gcc_checking_assert (((a->current && a->first) || !a->current) - && (!a->current || a->indx == a->current->indx)); + gcc_checking_assert (((current && first) || !current) + && (!current || indx == current->indx)); return changed; } diff --git a/gcc/bitmap.h b/gcc/bitmap.h index e17039c1ecb..1ac30e82d8f 100644 --- a/gcc/bitmap.h +++ b/gcc/bitmap.h @@ -200,6 +200,12 @@ struct GTY(()) bitmap_head { return *this; } + bitmap_head &operator&= (const bitmap_head &other) + { + bit_and (other); + return *this; + } + /* Clear a single bit in a bitmap. Return true if the bit changed. */ bool clear_bit (int); @@ -229,6 +235,7 @@ struct GTY(()) bitmap_head { bool bit (int) const; bool bit_or (const bitmap_head &other); + bool bit_and (const bitmap_head &); /* True if two bitmaps are identical. */ bool operator== (const bitmap_head &) const; @@ -268,7 +275,6 @@ extern bool bitmap_intersect_compl_p (const_bitmap, const_bitmap); are three operand versions that to not destroy the source bitmaps. The operations supported are &, & ~, |, ^. */ extern void bitmap_and (bitmap, const_bitmap, const_bitmap); -extern bool bitmap_and_into (bitmap, const_bitmap); extern bool bitmap_and_compl (bitmap, const_bitmap, const_bitmap); extern bool bitmap_and_compl_into (bitmap, const_bitmap); #define bitmap_compl_and(DST, A, B) bitmap_and_compl (DST, B, A) diff --git a/gcc/df-core.c b/gcc/df-core.c index ed190260d87..3b87a7abe94 100644 --- a/gcc/df-core.c +++ b/gcc/df-core.c @@ -1298,7 +1298,7 @@ df_analyze (void) sets. */ if (df->analyze_subset) { - bitmap_and_into (df->blocks_to_analyze, current_all_blocks); + df->blocks_to_analyze->bit_and (*current_all_blocks); df->n_blocks = df_prune_to_subcfg (df->postorder, df->n_blocks, df->blocks_to_analyze); df->n_blocks_inverted = df_prune_to_subcfg (df->postorder_inverted, diff --git a/gcc/df-problems.c b/gcc/df-problems.c index 395269963d1..6bd2221f101 100644 --- a/gcc/df-problems.c +++ b/gcc/df-problems.c @@ -543,7 +543,7 @@ df_rd_transfer_function (int bb_index) bitmap_head live_defs (&df_bitmap_obstack); EXECUTE_IF_SET_IN_BITMAP (regs_live_out, 0, regno, bi) live_defs.set_range (DF_DEFS_BEGIN (regno), DF_DEFS_COUNT (regno)); - changed |= bitmap_and_into (&bb_info->out, &live_defs); + changed |= bb_info->out.bit_and (live_defs); } return changed; @@ -616,7 +616,7 @@ df_rd_dump_defs_set (bitmap defs_set, const char *prefix, FILE *file) continue; bitmap_head tmp (&df_bitmap_obstack); tmp.set_range (DF_DEFS_BEGIN (regno), DF_DEFS_COUNT (regno)); - bitmap_and_into (&tmp, defs_set); + tmp &= *defs_set; if (! tmp.is_empty ()) { bitmap_iterator bi; @@ -1546,7 +1546,7 @@ df_live_transfer_function (int bb_index) bitmap_and (&temp, gen, &bb_lr_info->out); /* No register may reach a location where it is not used. Thus we trim the rr result to the places where it is used. */ - bitmap_and_into (in, &bb_lr_info->in); + *in &= bb_lr_info->in; return bitmap_ior_and_compl (out, &temp, in, kill); } @@ -1570,8 +1570,8 @@ df_live_finalize (bitmap all_blocks) /* No register may reach a location where it is not used. Thus we trim the rr result to the places where it is used. */ - bitmap_and_into (&bb_live_info->in, &bb_lr_info->in); - bitmap_and_into (&bb_live_info->out, &bb_lr_info->out); + bb_live_info->in &= bb_lr_info->in; + bb_live_info->out &= bb_lr_info->out; } df_live->solutions_dirty = false; @@ -3925,7 +3925,7 @@ can_move_insns_across (rtx from, rtx to, rtx across_from, rtx across_to, /* We're not interested in registers that aren't set in the moved region at all. */ - bitmap_and_into (&local_merge_live, &merge_set); + local_merge_live &= merge_set; for (;;) { if (NONDEBUG_INSN_P (insn)) @@ -4284,7 +4284,7 @@ df_md_transfer_function (int bb_index) /* Multiple definitions of a register are not relevant if it is not live. Thus we trim the result to the places where it is live. */ - bitmap_and_into (in, df_get_live_in (bb)); + *in &= *df_get_live_in (bb); return bitmap_ior_and_compl (out, &df_md_scratch, in, kill); } diff --git a/gcc/dse.c b/gcc/dse.c index a3f82a13c8b..3f2cba3dd14 100644 --- a/gcc/dse.c +++ b/gcc/dse.c @@ -2015,7 +2015,7 @@ replace_read (store_info_t store_info, insn_info_t store_insn, for (this_insn = insns; this_insn != NULL_RTX; this_insn = NEXT_INSN (this_insn)) note_stores (PATTERN (this_insn), look_for_hardregs, ®s_set); - bitmap_and_into (®s_set, regs_live); + regs_set &= *regs_live; if (!regs_set.is_empty ()) { if (dump_file && (dump_flags & TDF_DETAILS)) @@ -3378,7 +3378,7 @@ dse_confluence_n (edge e) if (dest_info->in) { if (src_info->out) - bitmap_and_into (src_info->out, dest_info->in); + *src_info->out &= *dest_info->in; else { src_info->out = BITMAP_ALLOC (&dse_bitmap_obstack); diff --git a/gcc/ifcvt.c b/gcc/ifcvt.c index 47d09a9fb36..10c3a869d2f 100644 --- a/gcc/ifcvt.c +++ b/gcc/ifcvt.c @@ -4246,10 +4246,8 @@ dead_or_predicable (basic_block test_bb, basic_block merge_bb, && targetm.calls.function_value_regno_p (i)) return_regs.set_bit (INCOMING_REGNO (i)); - bitmap_and_into (&return_regs, - df_get_live_out (ENTRY_BLOCK_PTR_FOR_FN (cfun))); - bitmap_and_into (&return_regs, - df_get_live_in (EXIT_BLOCK_PTR_FOR_FN (cfun))); + return_regs &= *df_get_live_out (ENTRY_BLOCK_PTR_FOR_FN (cfun)); + return_regs &= *df_get_live_in (EXIT_BLOCK_PTR_FOR_FN (cfun)); if (!return_regs.is_empty ()) { FOR_BB_INSNS_REVERSE (new_dest, insn) diff --git a/gcc/ipa-reference.c b/gcc/ipa-reference.c index 67578d9ec7f..2a8430a4431 100644 --- a/gcc/ipa-reference.c +++ b/gcc/ipa-reference.c @@ -320,7 +320,7 @@ intersect_static_var_sets (bitmap &x, bitmap y) { if (x != all_module_statics) { - bitmap_and_into (x, y); + *x &= *y; /* As with union_static_var_sets, reducing to the maximum set as early as possible is an overall win. */ if (*x == *all_module_statics) diff --git a/gcc/ira.c b/gcc/ira.c index f84aa846a33..9c93c013d5a 100644 --- a/gcc/ira.c +++ b/gcc/ira.c @@ -4528,7 +4528,7 @@ find_moveable_pseudos (void) bitmap moveable = bb_moveable_reg_sets + bb->index; bitmap_head live (*df_get_live_out (bb)); - bitmap_and_into (&live, df_get_live_in (bb)); + live &= *df_get_live_in (bb); transp->swap (&live); bitmap_head set; FOR_BB_INSNS (bb, insn) diff --git a/gcc/trans-mem.c b/gcc/trans-mem.c index 5571678ab3e..42b1c531544 100644 --- a/gcc/trans-mem.c +++ b/gcc/trans-mem.c @@ -3517,8 +3517,8 @@ tm_memopt_compute_avin (basic_block bb) e = EDGE_PRED (bb, ix); if (e->src->aux && BB_VISITED_P (e->src)) { - bitmap_and_into (STORE_AVAIL_IN (bb), STORE_AVAIL_OUT (e->src)); - bitmap_and_into (READ_AVAIL_IN (bb), READ_AVAIL_OUT (e->src)); + *STORE_AVAIL_IN (bb) &= *STORE_AVAIL_OUT (e->src); + *READ_AVAIL_IN (bb) &= *READ_AVAIL_OUT (e->src); } } @@ -3550,7 +3550,7 @@ tm_memopt_compute_antin (basic_block bb) { e = EDGE_SUCC (bb, ix); if (BB_VISITED_P (e->dest)) - bitmap_and_into (STORE_ANTIC_IN (bb), STORE_ANTIC_OUT (e->dest)); + *STORE_ANTIC_IN (bb) &= *STORE_ANTIC_OUT (e->dest); } BB_VISITED_P (bb) = true; diff --git a/gcc/tree-ssa-loop-manip.c b/gcc/tree-ssa-loop-manip.c index 1d3b5342894..af5d89dcc02 100644 --- a/gcc/tree-ssa-loop-manip.c +++ b/gcc/tree-ssa-loop-manip.c @@ -266,7 +266,7 @@ compute_live_loop_exits (bitmap live_exits, bitmap use_blocks, loop != current_loops->tree_root; loop = loop_outer (loop)) def_loop_exits |= *loop_exits[loop->num]; - bitmap_and_into (live_exits, &def_loop_exits); + *live_exits &= def_loop_exits; } /* Add a loop-closing PHI for VAR in basic block EXIT. */ diff --git a/gcc/tree-ssa-pre.c b/gcc/tree-ssa-pre.c index f5697f2ce6b..d0c10aa86e1 100644 --- a/gcc/tree-ssa-pre.c +++ b/gcc/tree-ssa-pre.c @@ -755,7 +755,7 @@ bitmap_set_and (bitmap_set_t dest, bitmap_set_t orig) { bitmap_head temp (&grand_bitmap_obstack); - bitmap_and_into (&dest->values, &orig->values); + dest->values &= orig->values; temp = dest->expressions; EXECUTE_IF_SET_IN_BITMAP (&temp, 0, i, bi) { diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c index 08fac967a31..5f8ffe9b438 100644 --- a/gcc/tree-vrp.c +++ b/gcc/tree-vrp.c @@ -8309,7 +8309,7 @@ vrp_meet_1 (value_range_t *vr0, value_range_t *vr1) /* The resulting set of equivalences is always the intersection of the two sets. */ if (vr0->equiv && vr1->equiv && vr0->equiv != vr1->equiv) - bitmap_and_into (vr0->equiv, vr1->equiv); + *vr0->equiv &= *vr1->equiv; else if (vr0->equiv && !vr1->equiv) vr0->equiv->clear (); } |