Commit a7e3698d by Jan Hubicka Committed by Jan Hubicka

df-core.c (df_set_blocks): Use bitmap_head instead of bitmap.

	* df-core.c (df_set_blocks): Use bitmap_head instead of bitmap.
	(df_compact_blocks): Likewise.
	* df.h (struct df): Turn hardware_regs_used,
	regular_block_artificial_uses, eh_block_artificial_uses,
	insns_to_delete, insns_to_rescan, insns_to_notes_rescan into
	bitmap_head.
	* df-problems.c (df_lr_local_compute, df_lr_confluence_0,
	df_byte_lr_alloc, df_simulate_fixup_sets): Update.
	* df-scan.c (df_scan_free_internal, df_scan_alloc, df_scan_start_dump,
	df_scan_blocks, df_insn_delete, df_insn_rescan,
	df_insn_rescan_debug_internal, df_insn_rescan_all,
	df_process_deferred_rescans, df_process_deferred_rescans,
	df_notes_rescan, df_get_call_refs, df_get_call_refs,
	regs_invalidated_by_call_regset, df_get_call_refs, df_bb_refs_collect,
	df_record_entry_block_defs, df_record_exit_block_uses,
	df_update_exit_block_uses, df_bb_verify, df_entry_block_bitmap_verify,
	df_scan_verify): Update.

From-SVN: r160348
parent e62b90b4
2010-05-25 Jan Hubicka <jh@suse.cz>
* df-core.c (df_set_blocks): Use bitmap_head instead of bitmap.
(df_compact_blocks): Likewise.
* df.h (struct df): Turn hardware_regs_used,
regular_block_artificial_uses, eh_block_artificial_uses,
insns_to_delete, insns_to_rescan, insns_to_notes_rescan into
bitmap_head.
* df-problems.c (df_lr_local_compute, df_lr_confluence_0,
df_byte_lr_alloc, df_simulate_fixup_sets): Update.
* df-scan.c (df_scan_free_internal, df_scan_alloc, df_scan_start_dump,
df_scan_blocks, df_insn_delete, df_insn_rescan,
df_insn_rescan_debug_internal, df_insn_rescan_all,
df_process_deferred_rescans, df_process_deferred_rescans,
df_notes_rescan, df_get_call_refs, df_get_call_refs,
regs_invalidated_by_call_regset, df_get_call_refs, df_bb_refs_collect,
df_record_entry_block_defs, df_record_exit_block_uses,
df_update_exit_block_uses, df_bb_verify, df_entry_block_bitmap_verify,
df_scan_verify): Update.
2010-05-25 Dodji Seketeli <dodji@redhat.com>
PR c++/44188
......
......@@ -2367,7 +2367,13 @@ cleanup_cfg (int mode)
break;
else if ((mode & CLEANUP_CROSSJUMP)
&& crossjumps_occured)
run_fast_dce ();
{
/* Fast DCE is expensive, we really want to be sure we don't
re-run it just because crossjumping cascade. */
while (try_optimize_cfg (mode))
delete_unreachable_blocks ();
run_fast_dce ();
}
}
else
break;
......
......@@ -960,8 +960,8 @@ fast_dce (bool byte_level)
df_simulate_fixup_sets has the disadvantage of calling
bb_has_eh_pred once per insn, so we cache the information
here. */
bitmap au = df->regular_block_artificial_uses;
bitmap au_eh = df->eh_block_artificial_uses;
bitmap au = &df->regular_block_artificial_uses;
bitmap au_eh = &df->eh_block_artificial_uses;
int i;
prescan_insns_for_dce (true);
......
......@@ -504,8 +504,9 @@ df_set_blocks (bitmap blocks)
/* This block is called to change the focus from one subset
to another. */
int p;
bitmap diff = BITMAP_ALLOC (&df_bitmap_obstack);
bitmap_and_compl (diff, df->blocks_to_analyze, blocks);
bitmap_head diff;
bitmap_initialize (&diff, &df_bitmap_obstack);
bitmap_and_compl (&diff, df->blocks_to_analyze, blocks);
for (p = 0; p < df->num_problems_defined; p++)
{
struct dataflow *dflow = df->problems_in_order[p];
......@@ -516,7 +517,7 @@ df_set_blocks (bitmap blocks)
bitmap_iterator bi;
unsigned int bb_index;
EXECUTE_IF_SET_IN_BITMAP (diff, 0, bb_index, bi)
EXECUTE_IF_SET_IN_BITMAP (&diff, 0, bb_index, bi)
{
basic_block bb = BASIC_BLOCK (bb_index);
if (bb)
......@@ -532,34 +533,34 @@ df_set_blocks (bitmap blocks)
}
}
BITMAP_FREE (diff);
bitmap_clear (&diff);
}
else
{
/* This block of code is executed to change the focus from
the entire function to a subset. */
bitmap blocks_to_reset = NULL;
bitmap_head blocks_to_reset;
bool initialized = false;
int p;
for (p = 0; p < df->num_problems_defined; p++)
{
struct dataflow *dflow = df->problems_in_order[p];
if (dflow->optional_p && dflow->problem->reset_fun)
{
if (!blocks_to_reset)
if (!initialized)
{
basic_block bb;
blocks_to_reset =
BITMAP_ALLOC (&df_bitmap_obstack);
bitmap_initialize (&blocks_to_reset, &df_bitmap_obstack);
FOR_ALL_BB(bb)
{
bitmap_set_bit (blocks_to_reset, bb->index);
bitmap_set_bit (&blocks_to_reset, bb->index);
}
}
dflow->problem->reset_fun (blocks_to_reset);
dflow->problem->reset_fun (&blocks_to_reset);
}
}
if (blocks_to_reset)
BITMAP_FREE (blocks_to_reset);
if (initialized)
bitmap_clear (&blocks_to_reset);
df->blocks_to_analyze = BITMAP_ALLOC (&df_bitmap_obstack);
}
......@@ -1401,9 +1402,10 @@ df_compact_blocks (void)
basic_block bb;
void **problem_temps;
int size = last_basic_block * sizeof (void *);
bitmap tmp = BITMAP_ALLOC (&df_bitmap_obstack);
bitmap_head tmp;
problem_temps = XNEWVAR (void *, size);
bitmap_initialize (&tmp, &df_bitmap_obstack);
for (p = 0; p < df->num_problems_defined; p++)
{
struct dataflow *dflow = df->problems_in_order[p];
......@@ -1412,17 +1414,17 @@ df_compact_blocks (void)
dflow problem. */
if (dflow->out_of_date_transfer_functions)
{
bitmap_copy (tmp, dflow->out_of_date_transfer_functions);
bitmap_copy (&tmp, dflow->out_of_date_transfer_functions);
bitmap_clear (dflow->out_of_date_transfer_functions);
if (bitmap_bit_p (tmp, ENTRY_BLOCK))
if (bitmap_bit_p (&tmp, ENTRY_BLOCK))
bitmap_set_bit (dflow->out_of_date_transfer_functions, ENTRY_BLOCK);
if (bitmap_bit_p (tmp, EXIT_BLOCK))
if (bitmap_bit_p (&tmp, EXIT_BLOCK))
bitmap_set_bit (dflow->out_of_date_transfer_functions, EXIT_BLOCK);
i = NUM_FIXED_BLOCKS;
FOR_EACH_BB (bb)
{
if (bitmap_bit_p (tmp, bb->index))
if (bitmap_bit_p (&tmp, bb->index))
bitmap_set_bit (dflow->out_of_date_transfer_functions, i);
i++;
}
......@@ -1463,22 +1465,22 @@ df_compact_blocks (void)
if (df->blocks_to_analyze)
{
if (bitmap_bit_p (tmp, ENTRY_BLOCK))
if (bitmap_bit_p (&tmp, ENTRY_BLOCK))
bitmap_set_bit (df->blocks_to_analyze, ENTRY_BLOCK);
if (bitmap_bit_p (tmp, EXIT_BLOCK))
if (bitmap_bit_p (&tmp, EXIT_BLOCK))
bitmap_set_bit (df->blocks_to_analyze, EXIT_BLOCK);
bitmap_copy (tmp, df->blocks_to_analyze);
bitmap_copy (&tmp, df->blocks_to_analyze);
bitmap_clear (df->blocks_to_analyze);
i = NUM_FIXED_BLOCKS;
FOR_EACH_BB (bb)
{
if (bitmap_bit_p (tmp, bb->index))
if (bitmap_bit_p (&tmp, bb->index))
bitmap_set_bit (df->blocks_to_analyze, i);
i++;
}
}
BITMAP_FREE (tmp);
bitmap_clear (&tmp);
free (problem_temps);
......
......@@ -925,10 +925,10 @@ df_lr_local_compute (bitmap all_blocks ATTRIBUTE_UNUSED)
unsigned int bb_index;
bitmap_iterator bi;
bitmap_clear (df->hardware_regs_used);
bitmap_clear (&df->hardware_regs_used);
/* The all-important stack pointer must always be live. */
bitmap_set_bit (df->hardware_regs_used, STACK_POINTER_REGNUM);
bitmap_set_bit (&df->hardware_regs_used, STACK_POINTER_REGNUM);
/* Before reload, there are a few registers that must be forced
live everywhere -- which might not already be the case for
......@@ -937,20 +937,20 @@ df_lr_local_compute (bitmap all_blocks ATTRIBUTE_UNUSED)
{
/* Any reference to any pseudo before reload is a potential
reference of the frame pointer. */
bitmap_set_bit (df->hardware_regs_used, FRAME_POINTER_REGNUM);
bitmap_set_bit (&df->hardware_regs_used, FRAME_POINTER_REGNUM);
#if FRAME_POINTER_REGNUM != ARG_POINTER_REGNUM
/* Pseudos with argument area equivalences may require
reloading via the argument pointer. */
if (fixed_regs[ARG_POINTER_REGNUM])
bitmap_set_bit (df->hardware_regs_used, ARG_POINTER_REGNUM);
bitmap_set_bit (&df->hardware_regs_used, ARG_POINTER_REGNUM);
#endif
/* Any constant, or pseudo with constant equivalences, may
require reloading from memory using the pic register. */
if ((unsigned) PIC_OFFSET_TABLE_REGNUM != INVALID_REGNUM
&& fixed_regs[PIC_OFFSET_TABLE_REGNUM])
bitmap_set_bit (df->hardware_regs_used, PIC_OFFSET_TABLE_REGNUM);
bitmap_set_bit (&df->hardware_regs_used, PIC_OFFSET_TABLE_REGNUM);
}
EXECUTE_IF_SET_IN_BITMAP (df_lr->out_of_date_transfer_functions, 0, bb_index, bi)
......@@ -995,7 +995,7 @@ df_lr_confluence_0 (basic_block bb)
{
bitmap op1 = &df_lr_get_bb_info (bb->index)->out;
if (bb != EXIT_BLOCK_PTR)
bitmap_copy (op1, df->hardware_regs_used);
bitmap_copy (op1, &df->hardware_regs_used);
}
......@@ -1015,7 +1015,7 @@ df_lr_confluence_n (edge e)
else
bitmap_ior_into (op1, op2);
bitmap_ior_into (op1, df->hardware_regs_used);
bitmap_ior_into (op1, &df->hardware_regs_used);
}
......@@ -2547,7 +2547,7 @@ df_byte_lr_alloc (bitmap all_blocks ATTRIBUTE_UNUSED)
}
df_byte_lr_expand_bitmap (&problem_data->hardware_regs_used,
df->hardware_regs_used);
&df->hardware_regs_used);
df_byte_lr_expand_bitmap (&problem_data->invalidated_by_call,
regs_invalidated_by_call_regset);
......@@ -3979,9 +3979,9 @@ df_simulate_fixup_sets (basic_block bb, bitmap live)
/* These regs are considered always live so if they end up dying
because of some def, we need to bring the back again. */
if (bb_has_eh_pred (bb))
bitmap_ior_into (live, df->eh_block_artificial_uses);
bitmap_ior_into (live, &df->eh_block_artificial_uses);
else
bitmap_ior_into (live, df->regular_block_artificial_uses);
bitmap_ior_into (live, &df->regular_block_artificial_uses);
}
......
......@@ -564,22 +564,22 @@ struct df
int num_problems_defined;
bitmap hardware_regs_used; /* The set of hardware registers used. */
bitmap_head hardware_regs_used; /* The set of hardware registers used. */
/* The set of hard regs that are in the artificial uses at the end
of a regular basic block. */
bitmap regular_block_artificial_uses;
bitmap_head regular_block_artificial_uses;
/* The set of hard regs that are in the artificial uses at the end
of a basic block that has an EH pred. */
bitmap eh_block_artificial_uses;
bitmap_head eh_block_artificial_uses;
/* The set of hardware registers live on entry to the function. */
bitmap entry_block_defs;
bitmap exit_block_uses; /* The set of hardware registers used in exit block. */
/* Insns to delete, rescan or reprocess the notes at next
df_rescan_all or df_process_deferred_rescans. */
bitmap insns_to_delete;
bitmap insns_to_rescan;
bitmap insns_to_notes_rescan;
bitmap_head insns_to_delete;
bitmap_head insns_to_rescan;
bitmap_head insns_to_notes_rescan;
int *postorder; /* The current set of basic blocks
in reverse postorder. */
int *postorder_inverted; /* The current set of basic blocks
......
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