diff options
author | Kenneth Zadeck <zadeck@naturalbridge.com> | 2006-01-20 01:55:52 +0000 |
---|---|---|
committer | Kenneth Zadeck <zadeck@gcc.gnu.org> | 2006-01-20 01:55:52 +0000 |
commit | 3b8266e279c432acdc9feca326cf7410ca584f68 (patch) | |
tree | 11d804c9083262e47c2e64640c3d442deb7b9dc4 /gcc/df-scan.c | |
parent | a6d8ef6c5c0932ddeec7b0f72b1d6f10ebcf02a7 (diff) | |
download | gcc-3b8266e279c432acdc9feca326cf7410ca584f68.zip gcc-3b8266e279c432acdc9feca326cf7410ca584f68.tar.gz gcc-3b8266e279c432acdc9feca326cf7410ca584f68.tar.bz2 |
df-scan.c (df_scan_free_bb_info): Added basic block parameter to be able to clean out basic block when not necessary.
2005-01-19 Kenneth Zadeck <zadeck@naturalbridge.com>
* df-scan.c (df_scan_free_bb_info): Added basic block parameter to
be able to clean out basic block when not necessary.
(df_scan_free): Fixed to properly delete information if df is
unused before calling df_finish.
(df_scan_alloc, df_rescan_blocks, df_reg_chain_unlink,
df_insn_create_insn_record, df_bb_refs_record): Fixed formatting
or comment typos.
(df_bb_refs_delete): New function.
(df_refs_delete): Moved per block code to df_bb_refs_delete.
* df-core.c (df_set_blocks): Added code to properly clean out
unused blocks if they are not part of the blocks to consider.
Added additional null check.
(df_compact_blocks): Added basic block parameter to free_bb_fun to
be able to clean out basic block when not necessary
* df.h (df_free_bb_function): Ditto.
(df_bb_refs_delete): New function.
* df-problems.c (df_ru_free_bb_info, df_rd_set_bb_info,
df_lr_set_bb_info, df_ur_free_bb_info, df_urec_free_bb_info):Added
basic block parameter to be able to clean out basic block when not
necessary.
(df_ru_alloc, df_rd_alloc): Fixed dyslexic overflow test.
(df_ru_free, df_rd_free, df_lr_free, df_ur_free, df_urec_free):
Fixed to properly delete information if df is unused before
calling df_finish.
From-SVN: r110009
Diffstat (limited to 'gcc/df-scan.c')
-rw-r--r-- | gcc/df-scan.c | 89 |
1 files changed, 53 insertions, 36 deletions
diff --git a/gcc/df-scan.c b/gcc/df-scan.c index 82de4a8..8f19956 100644 --- a/gcc/df-scan.c +++ b/gcc/df-scan.c @@ -181,11 +181,14 @@ df_scan_set_bb_info (struct dataflow *dflow, unsigned int index, /* Free basic block info. */ static void -df_scan_free_bb_info (struct dataflow *dflow, void *vbb_info) +df_scan_free_bb_info (struct dataflow *dflow, basic_block bb, void *vbb_info) { struct df_scan_bb_info *bb_info = (struct df_scan_bb_info *) vbb_info; if (bb_info) - pool_free (dflow->block_pool, bb_info); + { + df_bb_refs_delete (dflow, bb->index); + pool_free (dflow->block_pool, bb_info); + } } @@ -222,7 +225,6 @@ df_scan_alloc (struct dataflow *dflow, bitmap blocks_to_rescan) problem_data->insn_pool = create_alloc_pool ("df_scan_insn pool", sizeof (struct df_insn_info), block_size); - problem_data->reg_pool = create_alloc_pool ("df_scan_reg pool", sizeof (struct df_reg_info), block_size); @@ -261,14 +263,18 @@ df_scan_free (struct dataflow *dflow) { struct df *df = dflow->df; - df_scan_free_internal (dflow); + if (dflow->problem_data) + { + df_scan_free_internal (dflow); + free (dflow->problem_data); + } + if (df->blocks_to_scan) BITMAP_FREE (df->blocks_to_scan); if (df->blocks_to_analyze) BITMAP_FREE (df->blocks_to_analyze); - free (dflow->problem_data); free (dflow); } @@ -412,7 +418,7 @@ df_rescan_blocks (struct df *df, bitmap blocks) { bitmap local_blocks_to_scan = BITMAP_ALLOC (NULL); - struct dataflow *dflow = df->problems_by_index [DF_SCAN]; + struct dataflow *dflow = df->problems_by_index[DF_SCAN]; basic_block bb; df->def_info.refs_organized = false; @@ -655,7 +661,7 @@ df_reg_chain_unlink (struct dataflow *dflow, struct df_ref *ref) void df_ref_remove (struct df *df, struct df_ref *ref) { - struct dataflow *dflow = df->problems_by_index [DF_SCAN]; + struct dataflow *dflow = df->problems_by_index[DF_SCAN]; if (DF_REF_REG_DEF_P (ref)) { if (DF_REF_FLAGS (ref) & DF_REF_ARTIFICIAL) @@ -713,7 +719,8 @@ df_insn_create_insn_record (struct dataflow *dflow, rtx insn) return insn_rec; } -/* Delete all of the refs information from BLOCKS. */ + +/* Delete all of the refs information from INSN. */ void df_insn_refs_delete (struct dataflow *dflow, rtx insn) @@ -741,6 +748,42 @@ df_insn_refs_delete (struct dataflow *dflow, rtx insn) } +/* Delete all of the refs information from basic_block with BB_INDEX. */ + +void +df_bb_refs_delete (struct dataflow *dflow, int bb_index) +{ + struct df_ref *def; + struct df_ref *use; + + struct df_scan_bb_info *bb_info + = df_scan_get_bb_info (dflow, bb_index); + rtx insn; + basic_block bb = BASIC_BLOCK (bb_index); + FOR_BB_INSNS (bb, insn) + { + if (INSN_P (insn)) + { + /* Record defs within INSN. */ + df_insn_refs_delete (dflow, insn); + } + } + + /* Get rid of any artifical uses. */ + if (bb_info) + { + def = bb_info->artificial_defs; + while (def) + def = df_reg_chain_unlink (dflow, def); + bb_info->artificial_defs = NULL; + use = bb_info->artificial_uses; + while (use) + use = df_reg_chain_unlink (dflow, use); + bb_info->artificial_uses = NULL; + } +} + + /* Delete all of the refs information from BLOCKS. */ void @@ -748,36 +791,10 @@ df_refs_delete (struct dataflow *dflow, bitmap blocks) { bitmap_iterator bi; unsigned int bb_index; - struct df_ref *def; - struct df_ref *use; EXECUTE_IF_SET_IN_BITMAP (blocks, 0, bb_index, bi) { - struct df_scan_bb_info *bb_info - = df_scan_get_bb_info (dflow, bb_index); - rtx insn; - basic_block bb = BASIC_BLOCK (bb_index); - FOR_BB_INSNS (bb, insn) - { - if (INSN_P (insn)) - { - /* Record defs within INSN. */ - df_insn_refs_delete (dflow, insn); - } - } - - /* Get rid of any artifical uses. */ - if (bb_info) - { - def = bb_info->artificial_defs; - while (def) - def = df_reg_chain_unlink (dflow, def); - bb_info->artificial_defs = NULL; - use = bb_info->artificial_uses; - while (use) - use = df_reg_chain_unlink (dflow, use); - bb_info->artificial_uses = NULL; - } + df_bb_refs_delete (dflow, bb_index); } } @@ -1568,7 +1585,7 @@ df_bb_refs_record (struct dataflow *dflow, basic_block bb) /* Any reference to any pseudo before reload is a potential reference of the frame pointer. */ - df_uses_record (dflow, ®no_reg_rtx [FRAME_POINTER_REGNUM], + df_uses_record (dflow, ®no_reg_rtx[FRAME_POINTER_REGNUM], DF_REF_REG_USE, bb, NULL, DF_REF_ARTIFICIAL); #if FRAME_POINTER_REGNUM != ARG_POINTER_REGNUM |