From: hubicka Date: Sat, 5 Jun 2010 13:55:17 +0000 (+0000) Subject: * df-problems.c (seen_in_block, seen_in_insn): Convert to bitmap_head. X-Git-Tag: upstream/4.9.2~28988 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b45fbda0af6404e121d0acf1a54166727fe0e457;p=platform%2Fupstream%2Flinaro-gcc.git * df-problems.c (seen_in_block, seen_in_insn): Convert to bitmap_head. (df_rd_problem_data): Convert sparse_invalidated_by_call, dense_invalidated_by_call to bitmap head. (df_rd_alloc, df_rd_bb_local_compute_process_def, df_rd_bb_local_compute, df_rd_confluence_n, df_rd_transfer_function, df_rd_start_dump, df_lr_verify_transfer_functions, df_live_verify_transfer_functions, df_chain_create_bb, df_chain_add_problem, df_byte_lr_check_regs, df_byte_lr_alloc, df_byte_lr_confluence_0, df_byte_lr_confluence_n, df_note_compute, df_simulate_one_insn_forwards, df_md_alloc, df_md_bb_local_compute_process_def, df_md_bb_local_compute_process_def, df_md_local_compute, df_md_transfer_function df_md_free): Update. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@160315 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 8dc548d..5f83ec7 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,18 @@ +2010-06-05 Jan Hubicka + + * df-problems.c (seen_in_block, seen_in_insn): Convert to bitmap_head. + (df_rd_problem_data): Convert sparse_invalidated_by_call, + dense_invalidated_by_call to bitmap head. + (df_rd_alloc, df_rd_bb_local_compute_process_def, + df_rd_bb_local_compute, df_rd_confluence_n, df_rd_transfer_function, + df_rd_start_dump, df_lr_verify_transfer_functions, + df_live_verify_transfer_functions, df_chain_create_bb, + df_chain_add_problem, df_byte_lr_check_regs, df_byte_lr_alloc, + df_byte_lr_confluence_0, df_byte_lr_confluence_n, df_note_compute, + df_simulate_one_insn_forwards, df_md_alloc, df_md_bb_local_compute_process_def, + df_md_bb_local_compute_process_def, df_md_local_compute, df_md_transfer_function + df_md_free): Update. + 2010-06-05 Joseph Myers PR c/44322 diff --git a/gcc/df-problems.c b/gcc/df-problems.c index 774cc9e..30d0ba6 100644 --- a/gcc/df-problems.c +++ b/gcc/df-problems.c @@ -54,8 +54,8 @@ along with GCC; see the file COPYING3. If not see #define DF_SPARSE_THRESHOLD 32 -static bitmap seen_in_block = NULL; -static bitmap seen_in_insn = NULL; +static bitmap_head seen_in_block; +static bitmap_head seen_in_insn; /*---------------------------------------------------------------------------- @@ -195,9 +195,9 @@ df_print_bb_index (basic_block bb, FILE *file) struct df_rd_problem_data { /* The set of defs to regs invalidated by call. */ - bitmap sparse_invalidated_by_call; + bitmap_head sparse_invalidated_by_call; /* The set of defs to regs invalidate by call for rd. */ - bitmap dense_invalidated_by_call; + bitmap_head dense_invalidated_by_call; /* An obstack for the bitmaps we need for this problem. */ bitmap_obstack rd_bitmaps; }; @@ -250,8 +250,8 @@ df_rd_alloc (bitmap all_blocks) if (df_rd->problem_data) { problem_data = (struct df_rd_problem_data *) df_rd->problem_data; - bitmap_clear (problem_data->sparse_invalidated_by_call); - bitmap_clear (problem_data->dense_invalidated_by_call); + bitmap_clear (&problem_data->sparse_invalidated_by_call); + bitmap_clear (&problem_data->dense_invalidated_by_call); } else { @@ -259,10 +259,10 @@ df_rd_alloc (bitmap all_blocks) df_rd->problem_data = problem_data; bitmap_obstack_initialize (&problem_data->rd_bitmaps); - problem_data->sparse_invalidated_by_call - = BITMAP_ALLOC (&problem_data->rd_bitmaps); - problem_data->dense_invalidated_by_call - = BITMAP_ALLOC (&problem_data->rd_bitmaps); + bitmap_initialize (&problem_data->sparse_invalidated_by_call, + &problem_data->rd_bitmaps); + bitmap_initialize (&problem_data->dense_invalidated_by_call, + &problem_data->rd_bitmaps); } df_grow_bb_info (df_rd); @@ -370,11 +370,11 @@ df_rd_bb_local_compute_process_def (struct df_rd_bb_info *bb_info, { /* Only the last def(s) for a regno in the block has any effect. */ - if (!bitmap_bit_p (seen_in_block, regno)) + if (!bitmap_bit_p (&seen_in_block, regno)) { /* The first def for regno in insn gets to knock out the defs from other instructions. */ - if ((!bitmap_bit_p (seen_in_insn, regno)) + if ((!bitmap_bit_p (&seen_in_insn, regno)) /* If the def is to only part of the reg, it does not kill the other defs that reach here. */ && (!(DF_REF_FLAGS (def) & @@ -392,7 +392,7 @@ df_rd_bb_local_compute_process_def (struct df_rd_bb_info *bb_info, } } - bitmap_set_bit (seen_in_insn, regno); + bitmap_set_bit (&seen_in_insn, regno); /* All defs for regno in the instruction may be put into the gen set. */ if (!(DF_REF_FLAGS (def) @@ -414,8 +414,8 @@ df_rd_bb_local_compute (unsigned int bb_index) struct df_rd_bb_info *bb_info = df_rd_get_bb_info (bb_index); rtx insn; - bitmap_clear (seen_in_block); - bitmap_clear (seen_in_insn); + bitmap_clear (&seen_in_block); + bitmap_clear (&seen_in_insn); /* Artificials are only hard regs. */ if (!(df->changeable_flags & DF_NO_HARD_REGS)) @@ -439,8 +439,8 @@ df_rd_bb_local_compute (unsigned int bb_index) result and another def for the clobber. If only one vector is used and the clobber goes first, the result will be lost. */ - bitmap_ior_into (seen_in_block, seen_in_insn); - bitmap_clear (seen_in_insn); + bitmap_ior_into (&seen_in_block, &seen_in_insn); + bitmap_clear (&seen_in_insn); } /* Process the artificial defs at the top of the block last since we @@ -463,11 +463,11 @@ df_rd_local_compute (bitmap all_blocks) unsigned int regno; struct df_rd_problem_data *problem_data = (struct df_rd_problem_data *) df_rd->problem_data; - bitmap sparse_invalidated = problem_data->sparse_invalidated_by_call; - bitmap dense_invalidated = problem_data->dense_invalidated_by_call; + bitmap sparse_invalidated = &problem_data->sparse_invalidated_by_call; + bitmap dense_invalidated = &problem_data->dense_invalidated_by_call; - seen_in_block = BITMAP_ALLOC (&df_bitmap_obstack); - seen_in_insn = BITMAP_ALLOC (&df_bitmap_obstack); + bitmap_initialize (&seen_in_block, &df_bitmap_obstack); + bitmap_initialize (&seen_in_insn, &df_bitmap_obstack); df_maybe_reorganize_def_refs (DF_REF_ORDER_BY_REG); @@ -487,8 +487,8 @@ df_rd_local_compute (bitmap all_blocks) DF_DEFS_COUNT (regno)); } - BITMAP_FREE (seen_in_block); - BITMAP_FREE (seen_in_insn); + bitmap_clear (&seen_in_block); + bitmap_clear (&seen_in_insn); } @@ -524,23 +524,24 @@ df_rd_confluence_n (edge e) { struct df_rd_problem_data *problem_data = (struct df_rd_problem_data *) df_rd->problem_data; - bitmap sparse_invalidated = problem_data->sparse_invalidated_by_call; - bitmap dense_invalidated = problem_data->dense_invalidated_by_call; + bitmap sparse_invalidated = &problem_data->sparse_invalidated_by_call; + bitmap dense_invalidated = &problem_data->dense_invalidated_by_call; bitmap_iterator bi; unsigned int regno; - bitmap tmp = BITMAP_ALLOC (&df_bitmap_obstack); + bitmap_head tmp; - bitmap_copy (tmp, op2); - bitmap_and_compl_into (tmp, dense_invalidated); + bitmap_initialize (&tmp, &df_bitmap_obstack); + bitmap_copy (&tmp, op2); + bitmap_and_compl_into (&tmp, dense_invalidated); EXECUTE_IF_SET_IN_BITMAP (sparse_invalidated, 0, regno, bi) { - bitmap_clear_range (tmp, + bitmap_clear_range (&tmp, DF_DEFS_BEGIN (regno), DF_DEFS_COUNT (regno)); } - bitmap_ior_into (op1, tmp); - BITMAP_FREE (tmp); + bitmap_ior_into (op1, &tmp); + bitmap_clear (&tmp); } else bitmap_ior_into (op1, op2); @@ -567,30 +568,30 @@ df_rd_transfer_function (int bb_index) { struct df_rd_problem_data *problem_data; bool changed = false; - bitmap tmp; + bitmap_head tmp; /* Note that TMP is _not_ a temporary bitmap if we end up replacing OUT with TMP. Therefore, allocate TMP in the RD bitmaps obstack. */ problem_data = (struct df_rd_problem_data *) df_rd->problem_data; - tmp = BITMAP_ALLOC (&problem_data->rd_bitmaps); + bitmap_initialize (&tmp, &problem_data->rd_bitmaps); - bitmap_copy (tmp, in); + bitmap_copy (&tmp, in); EXECUTE_IF_SET_IN_BITMAP (sparse_kill, 0, regno, bi) { - bitmap_clear_range (tmp, + bitmap_clear_range (&tmp, DF_DEFS_BEGIN (regno), DF_DEFS_COUNT (regno)); } - bitmap_and_compl_into (tmp, kill); - bitmap_ior_into (tmp, gen); - changed = !bitmap_equal_p (tmp, out); + bitmap_and_compl_into (&tmp, kill); + bitmap_ior_into (&tmp, gen); + changed = !bitmap_equal_p (&tmp, out); if (changed) { bitmap_clear (out); - bb_info->out = *tmp; + bb_info->out = tmp; } else - bitmap_clear (tmp); + bitmap_clear (&tmp); return changed; } } @@ -633,9 +634,9 @@ df_rd_start_dump (FILE *file) fprintf (file, ";; Reaching defs:\n\n"); fprintf (file, " sparse invalidated \t"); - dump_bitmap (file, problem_data->sparse_invalidated_by_call); + dump_bitmap (file, &problem_data->sparse_invalidated_by_call); fprintf (file, " dense invalidated \t"); - dump_bitmap (file, problem_data->dense_invalidated_by_call); + dump_bitmap (file, &problem_data->dense_invalidated_by_call); for (regno = 0; regno < m; regno++) if (DF_DEFS_COUNT (regno)) @@ -1269,25 +1270,21 @@ void df_lr_verify_transfer_functions (void) { basic_block bb; - bitmap saved_def; - bitmap saved_use; - bitmap saved_adef; - bitmap saved_ause; - bitmap all_blocks; + bitmap_head saved_def; + bitmap_head saved_use; + bitmap_head all_blocks; if (!df) return; - saved_def = BITMAP_ALLOC (NULL); - saved_use = BITMAP_ALLOC (NULL); - saved_adef = BITMAP_ALLOC (NULL); - saved_ause = BITMAP_ALLOC (NULL); - all_blocks = BITMAP_ALLOC (NULL); + bitmap_initialize (&saved_def, &bitmap_default_obstack); + bitmap_initialize (&saved_use, &bitmap_default_obstack); + bitmap_initialize (&all_blocks, &bitmap_default_obstack); FOR_ALL_BB (bb) { struct df_lr_bb_info *bb_info = df_lr_get_bb_info (bb->index); - bitmap_set_bit (all_blocks, bb->index); + bitmap_set_bit (&all_blocks, bb->index); if (bb_info) { @@ -1297,14 +1294,14 @@ df_lr_verify_transfer_functions (void) if (!bitmap_bit_p (df_lr->out_of_date_transfer_functions, bb->index)) { - bitmap_copy (saved_def, &bb_info->def); - bitmap_copy (saved_use, &bb_info->use); + bitmap_copy (&saved_def, &bb_info->def); + bitmap_copy (&saved_use, &bb_info->use); bitmap_clear (&bb_info->def); bitmap_clear (&bb_info->use); df_lr_bb_local_compute (bb->index); - gcc_assert (bitmap_equal_p (saved_def, &bb_info->def)); - gcc_assert (bitmap_equal_p (saved_use, &bb_info->use)); + gcc_assert (bitmap_equal_p (&saved_def, &bb_info->def)); + gcc_assert (bitmap_equal_p (&saved_use, &bb_info->use)); } } else @@ -1322,13 +1319,11 @@ df_lr_verify_transfer_functions (void) /* Make sure there are no dirty bits in blocks that have been deleted. */ gcc_assert (!bitmap_intersect_compl_p (df_lr->out_of_date_transfer_functions, - all_blocks)); + &all_blocks)); - BITMAP_FREE (saved_def); - BITMAP_FREE (saved_use); - BITMAP_FREE (saved_adef); - BITMAP_FREE (saved_ause); - BITMAP_FREE (all_blocks); + bitmap_clear (&saved_def); + bitmap_clear (&saved_use); + bitmap_clear (&all_blocks); } @@ -1828,23 +1823,23 @@ void df_live_verify_transfer_functions (void) { basic_block bb; - bitmap saved_gen; - bitmap saved_kill; - bitmap all_blocks; + bitmap_head saved_gen; + bitmap_head saved_kill; + bitmap_head all_blocks; if (!df) return; - saved_gen = BITMAP_ALLOC (NULL); - saved_kill = BITMAP_ALLOC (NULL); - all_blocks = BITMAP_ALLOC (NULL); + bitmap_initialize (&saved_gen, &bitmap_default_obstack); + bitmap_initialize (&saved_kill, &bitmap_default_obstack); + bitmap_initialize (&all_blocks, &bitmap_default_obstack); df_grow_insn_info (); FOR_ALL_BB (bb) { struct df_live_bb_info *bb_info = df_live_get_bb_info (bb->index); - bitmap_set_bit (all_blocks, bb->index); + bitmap_set_bit (&all_blocks, bb->index); if (bb_info) { @@ -1854,14 +1849,14 @@ df_live_verify_transfer_functions (void) if (!bitmap_bit_p (df_live->out_of_date_transfer_functions, bb->index)) { - bitmap_copy (saved_gen, &bb_info->gen); - bitmap_copy (saved_kill, &bb_info->kill); + bitmap_copy (&saved_gen, &bb_info->gen); + bitmap_copy (&saved_kill, &bb_info->kill); bitmap_clear (&bb_info->gen); bitmap_clear (&bb_info->kill); df_live_bb_local_compute (bb->index); - gcc_assert (bitmap_equal_p (saved_gen, &bb_info->gen)); - gcc_assert (bitmap_equal_p (saved_kill, &bb_info->kill)); + gcc_assert (bitmap_equal_p (&saved_gen, &bb_info->gen)); + gcc_assert (bitmap_equal_p (&saved_kill, &bb_info->kill)); } } else @@ -1879,10 +1874,10 @@ df_live_verify_transfer_functions (void) /* Make sure there are no dirty bits in blocks that have been deleted. */ gcc_assert (!bitmap_intersect_compl_p (df_live->out_of_date_transfer_functions, - all_blocks)); - BITMAP_FREE (saved_gen); - BITMAP_FREE (saved_kill); - BITMAP_FREE (all_blocks); + &all_blocks)); + bitmap_clear (&saved_gen); + bitmap_clear (&saved_kill); + bitmap_clear (&all_blocks); } /*---------------------------------------------------------------------------- @@ -2109,9 +2104,10 @@ df_chain_create_bb (unsigned int bb_index) basic_block bb = BASIC_BLOCK (bb_index); struct df_rd_bb_info *bb_info = df_rd_get_bb_info (bb_index); rtx insn; - bitmap cpy = BITMAP_ALLOC (NULL); + bitmap_head cpy; - bitmap_copy (cpy, &bb_info->in); + bitmap_initialize (&cpy, &bitmap_default_obstack); + bitmap_copy (&cpy, &bb_info->in); bitmap_set_bit (df_chain->out_of_date_transfer_functions, bb_index); /* Since we are going forwards, process the artificial uses first @@ -2123,12 +2119,12 @@ df_chain_create_bb (unsigned int bb_index) /* Artificials are only hard regs. */ if (!(df->changeable_flags & DF_NO_HARD_REGS)) - df_chain_create_bb_process_use (cpy, + df_chain_create_bb_process_use (&cpy, df_get_artificial_uses (bb->index), DF_REF_AT_TOP); #endif - df_rd_simulate_artificial_defs_at_top (bb, cpy); + df_rd_simulate_artificial_defs_at_top (bb, &cpy); /* Process the regular instructions next. */ FOR_BB_INSNS (bb, insn) @@ -2138,22 +2134,22 @@ df_chain_create_bb (unsigned int bb_index) /* First scan the uses and link them up with the defs that remain in the cpy vector. */ - df_chain_create_bb_process_use (cpy, DF_INSN_UID_USES (uid), 0); + df_chain_create_bb_process_use (&cpy, DF_INSN_UID_USES (uid), 0); if (df->changeable_flags & DF_EQ_NOTES) - df_chain_create_bb_process_use (cpy, DF_INSN_UID_EQ_USES (uid), 0); + df_chain_create_bb_process_use (&cpy, DF_INSN_UID_EQ_USES (uid), 0); /* Since we are going forwards, process the defs second. */ - df_rd_simulate_one_insn (bb, insn, cpy); + df_rd_simulate_one_insn (bb, insn, &cpy); } /* Create the chains for the artificial uses of the hard registers at the end of the block. */ if (!(df->changeable_flags & DF_NO_HARD_REGS)) - df_chain_create_bb_process_use (cpy, + df_chain_create_bb_process_use (&cpy, df_get_artificial_uses (bb->index), 0); - BITMAP_FREE (cpy); + bitmap_clear (&cpy); } /* Create def-use chains from reaching use bitmaps for basic blocks @@ -2368,12 +2364,12 @@ df_chain_add_problem (unsigned int chain_flags) struct df_byte_lr_problem_data { /* Expanded versions of bitvectors used in lr. */ - bitmap invalidated_by_call; - bitmap hardware_regs_used; + bitmap_head invalidated_by_call; + bitmap_head hardware_regs_used; /* Indexed by regno, this is true if there are subregs, extracts or strict_low_parts for this regno. */ - bitmap needs_expansion; + bitmap_head needs_expansion; /* The start position and len for each regno in the various bit vectors. */ @@ -2452,7 +2448,7 @@ df_byte_lr_check_regs (df_ref *ref_rec) | DF_REF_ZERO_EXTRACT | DF_REF_STRICT_LOW_PART) || GET_CODE (DF_REF_REG (ref)) == SUBREG) - bitmap_set_bit (problem_data->needs_expansion, DF_REF_REGNO (ref)); + bitmap_set_bit (&problem_data->needs_expansion, DF_REF_REGNO (ref)); } } @@ -2509,9 +2505,12 @@ df_byte_lr_alloc (bitmap all_blocks ATTRIBUTE_UNUSED) bitmap_obstack_initialize (&problem_data->byte_lr_bitmaps); problem_data->regno_start = XNEWVEC (unsigned int, max_reg); problem_data->regno_len = XNEWVEC (unsigned int, max_reg); - problem_data->hardware_regs_used = BITMAP_ALLOC (&problem_data->byte_lr_bitmaps); - problem_data->invalidated_by_call = BITMAP_ALLOC (&problem_data->byte_lr_bitmaps); - problem_data->needs_expansion = BITMAP_ALLOC (&problem_data->byte_lr_bitmaps); + bitmap_initialize (&problem_data->hardware_regs_used, + &problem_data->byte_lr_bitmaps); + bitmap_initialize (&problem_data->invalidated_by_call, + &problem_data->byte_lr_bitmaps); + bitmap_initialize (&problem_data->needs_expansion, + &problem_data->byte_lr_bitmaps); /* Discover which regno's use subregs, extracts or strict_low_parts. */ @@ -2538,7 +2537,7 @@ df_byte_lr_alloc (bitmap all_blocks ATTRIBUTE_UNUSED) { int len; problem_data->regno_start[regno] = index; - if (bitmap_bit_p (problem_data->needs_expansion, regno)) + if (bitmap_bit_p (&problem_data->needs_expansion, regno)) len = GET_MODE_SIZE (GET_MODE (regno_reg_rtx[regno])); else len = 1; @@ -2547,9 +2546,9 @@ df_byte_lr_alloc (bitmap all_blocks ATTRIBUTE_UNUSED) index += len; } - df_byte_lr_expand_bitmap (problem_data->hardware_regs_used, + df_byte_lr_expand_bitmap (&problem_data->hardware_regs_used, df->hardware_regs_used); - df_byte_lr_expand_bitmap (problem_data->invalidated_by_call, + df_byte_lr_expand_bitmap (&problem_data->invalidated_by_call, regs_invalidated_by_call_regset); EXECUTE_IF_SET_IN_BITMAP (df_byte_lr->out_of_date_transfer_functions, 0, bb_index, bi) @@ -2771,7 +2770,7 @@ df_byte_lr_confluence_0 (basic_block bb) = (struct df_byte_lr_problem_data *)df_byte_lr->problem_data; bitmap op1 = &df_byte_lr_get_bb_info (bb->index)->out; if (bb != EXIT_BLOCK_PTR) - bitmap_copy (op1, problem_data->hardware_regs_used); + bitmap_copy (op1, &problem_data->hardware_regs_used); } @@ -2789,11 +2788,11 @@ df_byte_lr_confluence_n (edge e) /* ??? Abnormal call edges ignored for the moment, as this gets confused by sibling call edges, which crashes reg-stack. */ if (e->flags & EDGE_EH) - bitmap_ior_and_compl_into (op1, op2, problem_data->invalidated_by_call); + bitmap_ior_and_compl_into (op1, op2, &problem_data->invalidated_by_call); else bitmap_ior_into (op1, op2); - bitmap_ior_into (op1, problem_data->hardware_regs_used); + bitmap_ior_into (op1, &problem_data->hardware_regs_used); } @@ -3808,9 +3807,11 @@ df_note_compute (bitmap all_blocks) { unsigned int bb_index; bitmap_iterator bi; - bitmap live = BITMAP_ALLOC (&df_bitmap_obstack); - bitmap do_not_gen = BITMAP_ALLOC (&df_bitmap_obstack); - bitmap artificial_uses = BITMAP_ALLOC (&df_bitmap_obstack); + bitmap_head live, do_not_gen, artificial_uses; + + bitmap_initialize (&live, &df_bitmap_obstack); + bitmap_initialize (&do_not_gen, &df_bitmap_obstack); + bitmap_initialize (&artificial_uses, &df_bitmap_obstack); #ifdef REG_DEAD_DEBUGGING if (dump_file) @@ -3819,12 +3820,12 @@ df_note_compute (bitmap all_blocks) EXECUTE_IF_SET_IN_BITMAP (all_blocks, 0, bb_index, bi) { - df_note_bb_compute (bb_index, live, do_not_gen, artificial_uses); + df_note_bb_compute (bb_index, &live, &do_not_gen, &artificial_uses); } - BITMAP_FREE (live); - BITMAP_FREE (do_not_gen); - BITMAP_FREE (artificial_uses); + bitmap_clear (&live); + bitmap_clear (&do_not_gen); + bitmap_clear (&artificial_uses); } @@ -4191,7 +4192,7 @@ df_simulate_one_insn_forwards (basic_block bb, rtx insn, bitmap live) /* Scratch var used by transfer functions. This is used to do md analysis only for live registers. */ -static bitmap df_md_scratch; +static bitmap_head df_md_scratch; /* Set basic block info. */ @@ -4236,7 +4237,7 @@ df_md_alloc (bitmap all_blocks) sizeof (struct df_md_bb_info), 50); df_grow_bb_info (df_md); - df_md_scratch = BITMAP_ALLOC (NULL); + bitmap_initialize (&df_md_scratch, &bitmap_default_obstack); EXECUTE_IF_SET_IN_BITMAP (all_blocks, 0, bb_index, bi) { @@ -4320,7 +4321,7 @@ df_md_bb_local_compute_process_def (struct df_md_bb_info *bb_info, int top_flag) { df_ref def; - bitmap_clear (seen_in_insn); + bitmap_clear (&seen_in_insn); while ((def = *def_rec++) != NULL) { @@ -4329,7 +4330,7 @@ df_md_bb_local_compute_process_def (struct df_md_bb_info *bb_info, || (dregno >= FIRST_PSEUDO_REGISTER)) && top_flag == (DF_REF_FLAGS (def) & DF_REF_AT_TOP)) { - if (!bitmap_bit_p (seen_in_insn, dregno)) + if (!bitmap_bit_p (&seen_in_insn, dregno)) { if (DF_REF_FLAGS (def) & (DF_REF_PARTIAL | DF_REF_CONDITIONAL | DF_REF_MAY_CLOBBER)) @@ -4341,7 +4342,7 @@ df_md_bb_local_compute_process_def (struct df_md_bb_info *bb_info, { /* When we find a clobber and a regular def, make sure the regular def wins. */ - bitmap_set_bit (seen_in_insn, dregno); + bitmap_set_bit (&seen_in_insn, dregno); bitmap_set_bit (&bb_info->kill, dregno); bitmap_clear_bit (&bb_info->gen, dregno); } @@ -4391,14 +4392,14 @@ df_md_local_compute (bitmap all_blocks) basic_block bb; bitmap *frontiers; - seen_in_insn = BITMAP_ALLOC (NULL); + bitmap_initialize (&seen_in_insn, &bitmap_default_obstack); EXECUTE_IF_SET_IN_BITMAP (all_blocks, 0, bb_index, bi1) { df_md_bb_local_compute (bb_index); } - BITMAP_FREE (seen_in_insn); + bitmap_clear (&seen_in_insn); frontiers = XNEWVEC (bitmap, last_basic_block); FOR_ALL_BB (bb) @@ -4455,13 +4456,13 @@ df_md_transfer_function (int bb_index) /* We need to use a scratch set here so that the value returned from this function invocation properly reflects whether the sets changed in a significant way; i.e. not just because the live set was anded in. */ - bitmap_and (df_md_scratch, gen, df_get_live_out (bb)); + bitmap_and (&df_md_scratch, gen, df_get_live_out (bb)); /* 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)); - return bitmap_ior_and_compl (out, df_md_scratch, in, kill); + return bitmap_ior_and_compl (out, &df_md_scratch, in, kill); } /* Initialize the solution bit vectors for problem. */ @@ -4524,7 +4525,7 @@ df_md_free (void) } } - BITMAP_FREE (df_md_scratch); + bitmap_clear (&df_md_scratch); free_alloc_pool (df_md->block_pool); df_md->block_info_size = 0; diff --git a/gcc/tree-ssa-pre.c b/gcc/tree-ssa-pre.c index 3d186fd..687a363 100644 --- a/gcc/tree-ssa-pre.c +++ b/gcc/tree-ssa-pre.c @@ -356,15 +356,15 @@ static bool in_fre = false; expressions. */ typedef struct bitmap_set { - bitmap expressions; - bitmap values; + bitmap_head expressions; + bitmap_head values; } *bitmap_set_t; #define FOR_EACH_EXPR_ID_IN_SET(set, id, bi) \ - EXECUTE_IF_SET_IN_BITMAP((set)->expressions, 0, (id), (bi)) + EXECUTE_IF_SET_IN_BITMAP(&(set)->expressions, 0, (id), (bi)) #define FOR_EACH_VALUE_ID_IN_SET(set, id, bi) \ - EXECUTE_IF_SET_IN_BITMAP((set)->values, 0, (id), (bi)) + EXECUTE_IF_SET_IN_BITMAP(&(set)->values, 0, (id), (bi)) /* Mapping from value id to expressions with that value_id. */ DEF_VEC_P (bitmap_set_t); @@ -615,8 +615,8 @@ static bitmap_set_t bitmap_set_new (void) { bitmap_set_t ret = (bitmap_set_t) pool_alloc (bitmap_set_pool); - ret->expressions = BITMAP_ALLOC (&grand_bitmap_obstack); - ret->values = BITMAP_ALLOC (&grand_bitmap_obstack); + bitmap_initialize (&ret->expressions, &grand_bitmap_obstack); + bitmap_initialize (&ret->values, &grand_bitmap_obstack); return ret; } @@ -657,8 +657,8 @@ bitmap_remove_from_set (bitmap_set_t set, pre_expr expr) unsigned int val = get_expr_value_id (expr); if (!value_id_constant_p (val)) { - bitmap_clear_bit (set->values, val); - bitmap_clear_bit (set->expressions, get_expression_id (expr)); + bitmap_clear_bit (&set->values, val); + bitmap_clear_bit (&set->expressions, get_expression_id (expr)); } } @@ -670,8 +670,8 @@ bitmap_insert_into_set_1 (bitmap_set_t set, pre_expr expr, { /* We specifically expect this and only this function to be able to insert constants into a set. */ - bitmap_set_bit (set->values, val); - bitmap_set_bit (set->expressions, get_or_alloc_expression_id (expr)); + bitmap_set_bit (&set->values, val); + bitmap_set_bit (&set->expressions, get_or_alloc_expression_id (expr)); } } @@ -688,8 +688,8 @@ bitmap_insert_into_set (bitmap_set_t set, pre_expr expr) static void bitmap_set_copy (bitmap_set_t dest, bitmap_set_t orig) { - bitmap_copy (dest->expressions, orig->expressions); - bitmap_copy (dest->values, orig->values); + bitmap_copy (&dest->expressions, &orig->expressions); + bitmap_copy (&dest->values, &orig->values); } @@ -697,8 +697,8 @@ bitmap_set_copy (bitmap_set_t dest, bitmap_set_t orig) static void bitmap_set_free (bitmap_set_t set) { - BITMAP_FREE (set->expressions); - BITMAP_FREE (set->values); + bitmap_clear (&set->expressions); + bitmap_clear (&set->values); } @@ -712,7 +712,7 @@ sorted_array_from_bitmap_set (bitmap_set_t set) VEC(pre_expr, heap) *result; /* Pre-allocate roughly enough space for the array. */ - result = VEC_alloc (pre_expr, heap, bitmap_count_bits (set->values)); + result = VEC_alloc (pre_expr, heap, bitmap_count_bits (&set->values)); FOR_EACH_VALUE_ID_IN_SET (set, i, bi) { @@ -729,7 +729,7 @@ sorted_array_from_bitmap_set (bitmap_set_t set) bitmap_set_t exprset = VEC_index (bitmap_set_t, value_expressions, i); FOR_EACH_EXPR_ID_IN_SET (exprset, j, bj) { - if (bitmap_bit_p (set->expressions, j)) + if (bitmap_bit_p (&set->expressions, j)) VEC_safe_push (pre_expr, heap, result, expression_for_id (j)); } } @@ -747,18 +747,19 @@ bitmap_set_and (bitmap_set_t dest, bitmap_set_t orig) if (dest != orig) { - bitmap temp = BITMAP_ALLOC (&grand_bitmap_obstack); + bitmap_head temp; + bitmap_initialize (&temp, &grand_bitmap_obstack); - bitmap_and_into (dest->values, orig->values); - bitmap_copy (temp, dest->expressions); - EXECUTE_IF_SET_IN_BITMAP (temp, 0, i, bi) + bitmap_and_into (&dest->values, &orig->values); + bitmap_copy (&temp, &dest->expressions); + EXECUTE_IF_SET_IN_BITMAP (&temp, 0, i, bi) { pre_expr expr = expression_for_id (i); unsigned int value_id = get_expr_value_id (expr); - if (!bitmap_bit_p (dest->values, value_id)) - bitmap_clear_bit (dest->expressions, i); + if (!bitmap_bit_p (&dest->values, value_id)) + bitmap_clear_bit (&dest->expressions, i); } - BITMAP_FREE (temp); + bitmap_clear (&temp); } } @@ -771,14 +772,14 @@ bitmap_set_subtract (bitmap_set_t dest, bitmap_set_t orig) bitmap_iterator bi; unsigned int i; - bitmap_and_compl (result->expressions, dest->expressions, - orig->expressions); + bitmap_and_compl (&result->expressions, &dest->expressions, + &orig->expressions); FOR_EACH_EXPR_ID_IN_SET (result, i, bi) { pre_expr expr = expression_for_id (i); unsigned int value_id = get_expr_value_id (expr); - bitmap_set_bit (result->values, value_id); + bitmap_set_bit (&result->values, value_id); } return result; @@ -791,16 +792,18 @@ bitmap_set_subtract_values (bitmap_set_t a, bitmap_set_t b) { unsigned int i; bitmap_iterator bi; - bitmap temp = BITMAP_ALLOC (&grand_bitmap_obstack); + bitmap_head temp; - bitmap_copy (temp, a->expressions); - EXECUTE_IF_SET_IN_BITMAP (temp, 0, i, bi) + bitmap_initialize (&temp, &grand_bitmap_obstack); + + bitmap_copy (&temp, &a->expressions); + EXECUTE_IF_SET_IN_BITMAP (&temp, 0, i, bi) { pre_expr expr = expression_for_id (i); if (bitmap_set_contains_value (b, get_expr_value_id (expr))) bitmap_remove_from_set (a, expr); } - BITMAP_FREE (temp); + bitmap_clear (&temp); } @@ -812,16 +815,16 @@ bitmap_set_contains_value (bitmap_set_t set, unsigned int value_id) if (value_id_constant_p (value_id)) return true; - if (!set || bitmap_empty_p (set->expressions)) + if (!set || bitmap_empty_p (&set->expressions)) return false; - return bitmap_bit_p (set->values, value_id); + return bitmap_bit_p (&set->values, value_id); } static inline bool bitmap_set_contains_expr (bitmap_set_t set, const pre_expr expr) { - return bitmap_bit_p (set->expressions, get_expression_id (expr)); + return bitmap_bit_p (&set->expressions, get_expression_id (expr)); } /* Replace an instance of value LOOKFOR with expression EXPR in SET. */ @@ -852,10 +855,10 @@ bitmap_set_replace_value (bitmap_set_t set, unsigned int lookfor, exprset = VEC_index (bitmap_set_t, value_expressions, lookfor); FOR_EACH_EXPR_ID_IN_SET (exprset, i, bi) { - if (bitmap_bit_p (set->expressions, i)) + if (bitmap_bit_p (&set->expressions, i)) { - bitmap_clear_bit (set->expressions, i); - bitmap_set_bit (set->expressions, get_expression_id (expr)); + bitmap_clear_bit (&set->expressions, i); + bitmap_set_bit (&set->expressions, get_expression_id (expr)); return; } } @@ -866,7 +869,7 @@ bitmap_set_replace_value (bitmap_set_t set, unsigned int lookfor, static bool bitmap_set_equal (bitmap_set_t a, bitmap_set_t b) { - return bitmap_equal_p (a->values, b->values); + return bitmap_equal_p (&a->values, &b->values); } /* Replace an instance of EXPR's VALUE with EXPR in SET if it exists, @@ -900,8 +903,8 @@ bitmap_value_insert_into_set (bitmap_set_t set, pre_expr expr) return; /* If the value membership changed, add the expression. */ - if (bitmap_set_bit (set->values, val)) - bitmap_set_bit (set->expressions, expr->id); + if (bitmap_set_bit (&set->values, val)) + bitmap_set_bit (&set->expressions, expr->id); } /* Print out EXPR to outfile. */ @@ -1870,8 +1873,8 @@ bitmap_find_leader (bitmap_set_t set, unsigned int val, gimple stmt) bitmap_iterator bi; bitmap_set_t exprset = VEC_index (bitmap_set_t, value_expressions, val); - EXECUTE_IF_AND_IN_BITMAP (exprset->expressions, - set->expressions, 0, i, bi) + EXECUTE_IF_AND_IN_BITMAP (&exprset->expressions, + &set->expressions, 0, i, bi) { pre_expr val = expression_for_id (i); /* At the point where stmt is not null, there should always @@ -2291,8 +2294,7 @@ compute_antic_aux (basic_block block, bool block_has_abnormal_pred_edge) clean (ANTIC_IN (block), block); - /* !old->expressions can happen when we deferred a block. */ - if (!old->expressions || !bitmap_set_equal (old, ANTIC_IN (block))) + if (!bitmap_set_equal (old, ANTIC_IN (block))) { changed = true; SET_BIT (changed_blocks, block->index); @@ -2367,7 +2369,7 @@ compute_partial_antic_aux (basic_block block, before the translation starts. */ if (max_pa && single_succ_p (block) - && bitmap_count_bits (PA_IN (single_succ (block))->values) > max_pa) + && bitmap_count_bits (&PA_IN (single_succ (block))->values) > max_pa) goto maybe_dump_sets; old_PA_IN = PA_IN (block); @@ -2437,8 +2439,8 @@ compute_partial_antic_aux (basic_block block, /* For partial antic, we want to put back in the phi results, since we will properly avoid making them partially antic over backedges. */ - bitmap_ior_into (PA_IN (block)->values, PHI_GEN (block)->values); - bitmap_ior_into (PA_IN (block)->expressions, PHI_GEN (block)->expressions); + bitmap_ior_into (&PA_IN (block)->values, &PHI_GEN (block)->values); + bitmap_ior_into (&PA_IN (block)->expressions, &PHI_GEN (block)->expressions); /* PA_IN[block] = PA_IN[block] - ANTIC_IN[block] */ bitmap_set_subtract_values (PA_IN (block), ANTIC_IN (block));