diff options
author | Lawrence Crowl <crowl@google.com> | 2012-10-30 00:02:55 +0000 |
---|---|---|
committer | Lawrence Crowl <crowl@gcc.gnu.org> | 2012-10-30 00:02:55 +0000 |
commit | f61e445a74b138a2071a0af9f55c2d6e45fe2d5d (patch) | |
tree | 1ab800d2373b19aaee52a26a91b2c67b2657101e /gcc/gcse.c | |
parent | 880661a48b6e2f3f4b3c05860d3c9737b2a1dcc8 (diff) | |
download | gcc-f61e445a74b138a2071a0af9f55c2d6e45fe2d5d.zip gcc-f61e445a74b138a2071a0af9f55c2d6e45fe2d5d.tar.gz gcc-f61e445a74b138a2071a0af9f55c2d6e45fe2d5d.tar.bz2 |
This patch implements the unification of the *bitmap interfaces as discussed.
Essentially, we rename ebitmap and sbitmap functions to use the same names
as the bitmap functions. This rename works because we can now overload
on the bitmap type. Some macros now become inline functions to enable
that overloading.
The sbitmap non-bool returning bitwise operations have been merged with
the bool versions. Sometimes this merge involved modifying the non-bool
version to compute the bool value, and sometimes modifying bool version to
add additional work from the non-bool version. The redundant routines have
been removed.
The allocation functions have not been renamed, because we often do not
have an argument on which to overload. The cardinality functions have not
been renamed, because they have different parameters, and are thus not
interchangable. The iteration functions have not been renamed, because
they are functionally different.
Tested on x86_64, contrib/config-list.mk testing passed.
Index: gcc/ChangeLog
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.
From-SVN: r192969
Diffstat (limited to 'gcc/gcse.c')
-rw-r--r-- | gcc/gcse.c | 36 |
1 files changed, 18 insertions, 18 deletions
@@ -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) |