This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
more bitmap renaming
- From: Nathan Sidwell <nathan at codesourcery dot com>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Cc: Zack Weinberg <zack at codesourcery dot com>
- Date: Sun, 31 Oct 2004 16:07:41 +0000
- Subject: more bitmap renaming
- Organization: Codesourcery LLC
I noticed some more places that should use the newly separated bitmap
operation entry points, ok?
booted & tested on i686-pc-linux-gnu.
nathan
--
Nathan Sidwell :: http://www.codesourcery.com :: CodeSourcery LLC
nathan@codesourcery.com :: http://www.planetfall.pwp.blueyonder.co.uk
2004-10-31 Nathan Sidwell <nathan@codesourcery.com>
* bitmap.h (bitmap_a_or_b, bitmap_a_and_b): Remove.
* df.c (dataflow_set_a_op_b): Use bitmap_and, bitmap_ior,
bitmap_and_into, bitmap_ior_into as appropriate.
* except.c (remove_eh_handler): Likewise.
* global.c (modify_bb_reg_pav, make_accurate_live_analysis):
* tree-dfa.c (mark_new_vars_to_rename): Likewise.
* tree-ssa-alias.c (merge_pointed_to_info): Likewise.
* tree-ssa-live.h (live_merge_and_clear): Likewise.
* tree-ssa-loop-ivopts.c (find_best_candidate, try_add_cand_for):
Likewise.
Index: bitmap.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/bitmap.h,v
retrieving revision 1.39
diff -c -3 -p -r1.39 bitmap.h
*** bitmap.h 29 Oct 2004 08:40:53 -0000 1.39
--- bitmap.h 31 Oct 2004 15:56:10 -0000
*************** extern void bitmap_release_memory (void)
*** 132,139 ****
/* 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)
- #define bitmap_a_or_b(a,b,c) bitmap_operation (a, b, c, BITMAP_IOR)
- #define bitmap_a_and_b(a,b,c) bitmap_operation (a, b, c, BITMAP_AND)
extern int bitmap_union_of_diff (bitmap, bitmap, bitmap, bitmap);
extern int bitmap_first_set_bit (bitmap);
extern int bitmap_last_set_bit (bitmap);
--- 132,137 ----
Index: df.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/df.c,v
retrieving revision 1.74
diff -c -3 -p -r1.74 df.c
*** df.c 29 Oct 2004 08:40:54 -0000 1.74
--- df.c 31 Oct 2004 15:56:37 -0000
*************** dataflow_set_a_op_b (enum set_representa
*** 3750,3760 ****
switch (op)
{
case DF_UNION:
! bitmap_a_or_b (rslt, op1, op2);
break;
case DF_INTERSECTION:
! bitmap_a_and_b (rslt, op1, op2);
break;
default:
--- 3750,3760 ----
switch (op)
{
case DF_UNION:
! bitmap_ior (rslt, op1, op2);
break;
case DF_INTERSECTION:
! bitmap_and (rslt, op1, op2);
break;
default:
Index: except.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/except.c,v
retrieving revision 1.290
diff -c -3 -p -r1.290 except.c
*** except.c 28 Sep 2004 07:59:46 -0000 1.290
--- except.c 31 Oct 2004 15:56:44 -0000
*************** remove_eh_handler (struct eh_region *reg
*** 2293,2299 ****
if (!outer->aka)
outer->aka = BITMAP_GGC_ALLOC ();
if (region->aka)
! bitmap_a_or_b (outer->aka, outer->aka, region->aka);
bitmap_set_bit (outer->aka, region->region_number);
}
--- 2293,2299 ----
if (!outer->aka)
outer->aka = BITMAP_GGC_ALLOC ();
if (region->aka)
! bitmap_ior_into (outer->aka, region->aka);
bitmap_set_bit (outer->aka, region->region_number);
}
Index: global.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/global.c,v
retrieving revision 1.112
diff -c -3 -p -r1.112 global.c
*** global.c 18 Oct 2004 15:11:28 -0000 1.112
--- global.c 31 Oct 2004 15:57:10 -0000
*************** modify_bb_reg_pav (basic_block bb, basic
*** 2306,2312 ****
bb_pavin = bb_info->pavin;
bb_pavout = bb_info->pavout;
if (pred->index != ENTRY_BLOCK)
! bitmap_a_or_b (bb_pavin, bb_pavin, BB_INFO (pred)->pavout);
changed_p |= bitmap_union_of_diff (bb_pavout, bb_info->avloc,
bb_pavin, bb_info->killed);
return changed_p;
--- 2306,2312 ----
bb_pavin = bb_info->pavin;
bb_pavout = bb_info->pavout;
if (pred->index != ENTRY_BLOCK)
! bitmap_ior_into (bb_pavin, BB_INFO (pred)->pavout);
changed_p |= bitmap_union_of_diff (bb_pavout, bb_info->avloc,
bb_pavin, bb_info->killed);
return changed_p;
*************** modify_reg_pav (void)
*** 2405,2418 ****
insn if the pseudo-register is used first time in given BB
and not lived at the BB start. To prevent this we don't
change life information for such pseudo-registers. */
! bitmap_a_or_b (bb_info->pavin, bb_info->pavin, bb_info->earlyclobber);
#ifdef STACK_REGS
/* We can not use the same stack register for uninitialized
pseudo-register and another living pseudo-register because if the
uninitialized pseudo-register dies, subsequent pass reg-stack
will be confused (it will believe that the other register
dies). */
! bitmap_a_or_b (bb_info->pavin, bb_info->pavin, stack_regs);
#endif
}
#ifdef STACK_REGS
--- 2405,2418 ----
insn if the pseudo-register is used first time in given BB
and not lived at the BB start. To prevent this we don't
change life information for such pseudo-registers. */
! bitmap_ior_into (bb_info->pavin, bb_info->earlyclobber);
#ifdef STACK_REGS
/* We can not use the same stack register for uninitialized
pseudo-register and another living pseudo-register because if the
uninitialized pseudo-register dies, subsequent pass reg-stack
will be confused (it will believe that the other register
dies). */
! bitmap_ior_into (bb_info->pavin, stack_regs);
#endif
}
#ifdef STACK_REGS
*************** make_accurate_live_analysis (void)
*** 2444,2453 ****
{
bb_info = BB_INFO (bb);
! bitmap_a_and_b (bb->global_live_at_start, bb->global_live_at_start,
! bb_info->pavin);
! bitmap_a_and_b (bb->global_live_at_end, bb->global_live_at_end,
! bb_info->pavout);
}
free_bb_info ();
}
--- 2444,2451 ----
{
bb_info = BB_INFO (bb);
! bitmap_and_into (bb->global_live_at_start, bb_info->pavin);
! bitmap_and_into (bb->global_live_at_end, bb_info->pavout);
}
free_bb_info ();
}
Index: tree-dfa.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-dfa.c,v
retrieving revision 2.41
diff -c -3 -p -r2.41 tree-dfa.c
*** tree-dfa.c 27 Oct 2004 17:45:19 -0000 2.41
--- tree-dfa.c 31 Oct 2004 15:58:39 -0000
*************** mark_new_vars_to_rename (tree stmt, bitm
*** 1004,1010 ****
if (found_exposed_symbol
|| v_may_defs_before > v_may_defs_after
|| v_must_defs_before > v_must_defs_after)
! bitmap_a_or_b (vars_to_rename, vars_to_rename, vars_in_vops_to_rename);
BITMAP_XFREE (vars_in_vops_to_rename);
}
--- 1004,1010 ----
if (found_exposed_symbol
|| v_may_defs_before > v_may_defs_after
|| v_must_defs_before > v_must_defs_after)
! bitmap_ior_into (vars_to_rename, vars_in_vops_to_rename);
BITMAP_XFREE (vars_in_vops_to_rename);
}
Index: tree-ssa-alias.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-ssa-alias.c,v
retrieving revision 2.49
diff -c -3 -p -r2.49 tree-ssa-alias.c
*** tree-ssa-alias.c 29 Oct 2004 08:41:02 -0000 2.49
--- tree-ssa-alias.c 31 Oct 2004 15:58:55 -0000
*************** merge_pointed_to_info (struct alias_info
*** 1740,1748 ****
bitmap_copy (dest_pi->pt_vars, orig_pi->pt_vars);
}
else
! bitmap_a_or_b (dest_pi->pt_vars,
! dest_pi->pt_vars,
! orig_pi->pt_vars);
}
}
else
--- 1740,1746 ----
bitmap_copy (dest_pi->pt_vars, orig_pi->pt_vars);
}
else
! bitmap_ior_into (dest_pi->pt_vars, orig_pi->pt_vars);
}
}
else
Index: tree-ssa-live.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-ssa-live.h,v
retrieving revision 2.7
diff -c -3 -p -r2.7 tree-ssa-live.h
*** tree-ssa-live.h 10 Sep 2004 15:09:39 -0000 2.7
--- tree-ssa-live.h 31 Oct 2004 15:59:02 -0000
*************** live_var_map (tree_live_info_p live)
*** 309,315 ****
static inline void
live_merge_and_clear (tree_live_info_p live, int p1, int p2)
{
! bitmap_a_or_b (live->livein[p1], live->livein[p1], live->livein[p2]);
bitmap_zero (live->livein[p2]);
}
--- 309,315 ----
static inline void
live_merge_and_clear (tree_live_info_p live, int p1, int p2)
{
! bitmap_ior_into (live->livein[p1], live->livein[p2]);
bitmap_zero (live->livein[p2]);
}
Index: tree-ssa-loop-ivopts.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-ssa-loop-ivopts.c,v
retrieving revision 2.22
diff -c -3 -p -r2.22 tree-ssa-loop-ivopts.c
*** tree-ssa-loop-ivopts.c 28 Oct 2004 14:24:26 -0000 2.22
--- tree-ssa-loop-ivopts.c 31 Oct 2004 15:59:10 -0000
*************** find_best_candidate (struct ivopts_data
*** 3478,3485 ****
{
asol = BITMAP_XMALLOC ();
! bitmap_a_or_b (asol, data->important_candidates, use->related_cands);
! bitmap_a_and_b (asol, asol, sol);
}
EXECUTE_IF_SET_IN_BITMAP (asol, 0, c, bi)
--- 3478,3485 ----
{
asol = BITMAP_XMALLOC ();
! bitmap_ior (asol, data->important_candidates, use->related_cands);
! bitmap_and_into (asol, sol);
}
EXECUTE_IF_SET_IN_BITMAP (asol, 0, c, bi)
*************** find_best_candidate (struct ivopts_data
*** 3505,3511 ****
goto next_cand;
}
if (used_inv)
! bitmap_a_or_b (used_inv, used_inv, depends_on);
}
cnd = acnd;
--- 3505,3511 ----
goto next_cand;
}
if (used_inv)
! bitmap_ior_into (used_inv, depends_on);
}
cnd = acnd;
*************** try_add_cand_for (struct ivopts_data *da
*** 3628,3634 ****
bitmap_copy (act_ivs, ivs);
bitmap_set_bit (act_ivs, cand->id);
if (depends_on)
! bitmap_a_or_b (act_inv, inv, depends_on);
else
bitmap_copy (act_inv, inv);
act_cost = set_cost_up_to (data, act_ivs, act_inv, use->id + 1);
--- 3628,3634 ----
bitmap_copy (act_ivs, ivs);
bitmap_set_bit (act_ivs, cand->id);
if (depends_on)
! bitmap_ior (act_inv, inv, depends_on);
else
bitmap_copy (act_inv, inv);
act_cost = set_cost_up_to (data, act_ivs, act_inv, use->id + 1);
*************** try_add_cand_for (struct ivopts_data *da
*** 3656,3662 ****
bitmap_copy (act_ivs, ivs);
bitmap_set_bit (act_ivs, cp->cand->id);
if (cp->depends_on)
! bitmap_a_or_b (act_inv, inv, cp->depends_on);
else
bitmap_copy (act_inv, inv);
act_cost = set_cost_up_to (data, act_ivs, act_inv, use->id + 1);
--- 3656,3662 ----
bitmap_copy (act_ivs, ivs);
bitmap_set_bit (act_ivs, cp->cand->id);
if (cp->depends_on)
! bitmap_ior (act_inv, inv, cp->depends_on);
else
bitmap_copy (act_inv, inv);
act_cost = set_cost_up_to (data, act_ivs, act_inv, use->id + 1);