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-problems.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-problems.c')
-rw-r--r-- | gcc/df-problems.c | 217 |
1 files changed, 121 insertions, 96 deletions
diff --git a/gcc/df-problems.c b/gcc/df-problems.c index 790b3e2..ecc8eab 100644 --- a/gcc/df-problems.c +++ b/gcc/df-problems.c @@ -324,7 +324,9 @@ df_ru_set_bb_info (struct dataflow *dflow, unsigned int index, /* Free basic block info. */ static void -df_ru_free_bb_info (struct dataflow *dflow, void *vbb_info) +df_ru_free_bb_info (struct dataflow *dflow, + basic_block bb ATTRIBUTE_UNUSED, + void *vbb_info) { struct df_ru_bb_info *bb_info = (struct df_ru_bb_info *) vbb_info; if (bb_info) @@ -687,35 +689,38 @@ df_ru_free (struct dataflow *dflow) struct df_ru_problem_data *problem_data = (struct df_ru_problem_data *) dflow->problem_data; - for (i = 0; i < dflow->block_info_size; i++) + if (problem_data) { - struct df_ru_bb_info *bb_info = df_ru_get_bb_info (dflow, i); - if (bb_info) + for (i = 0; i < dflow->block_info_size; i++) { - BITMAP_FREE (bb_info->kill); - BITMAP_FREE (bb_info->sparse_kill); - BITMAP_FREE (bb_info->gen); - BITMAP_FREE (bb_info->in); - BITMAP_FREE (bb_info->out); + struct df_ru_bb_info *bb_info = df_ru_get_bb_info (dflow, i); + if (bb_info) + { + BITMAP_FREE (bb_info->kill); + BITMAP_FREE (bb_info->sparse_kill); + BITMAP_FREE (bb_info->gen); + BITMAP_FREE (bb_info->in); + BITMAP_FREE (bb_info->out); + } } + + free_alloc_pool (dflow->block_pool); + + for (i = 0; i < problem_data->use_sites_size; i++) + { + bitmap bm = problem_data->use_sites[i]; + if (bm) + BITMAP_FREE (bm); + } + + free (problem_data->use_sites); + BITMAP_FREE (problem_data->sparse_invalidated_by_call); + BITMAP_FREE (problem_data->dense_invalidated_by_call); + + dflow->block_info_size = 0; + free (dflow->block_info); + free (dflow->problem_data); } - - free_alloc_pool (dflow->block_pool); - - for (i = 0; i < problem_data->use_sites_size; i++) - { - bitmap bm = problem_data->use_sites[i]; - if (bm) - BITMAP_FREE (bm); - } - - free (problem_data->use_sites); - BITMAP_FREE (problem_data->sparse_invalidated_by_call); - BITMAP_FREE (problem_data->dense_invalidated_by_call); - - dflow->block_info_size = 0; - free (dflow->block_info); - free (dflow->problem_data); free (dflow); } @@ -837,7 +842,9 @@ df_rd_set_bb_info (struct dataflow *dflow, unsigned int index, /* Free basic block info. */ static void -df_rd_free_bb_info (struct dataflow *dflow, void *vbb_info) +df_rd_free_bb_info (struct dataflow *dflow, + basic_block bb ATTRIBUTE_UNUSED, + void *vbb_info) { struct df_rd_bb_info *bb_info = (struct df_rd_bb_info *) vbb_info; if (bb_info) @@ -1174,35 +1181,38 @@ df_rd_free (struct dataflow *dflow) struct df_rd_problem_data *problem_data = (struct df_rd_problem_data *) dflow->problem_data; - for (i = 0; i < dflow->block_info_size; i++) + if (problem_data) { - struct df_rd_bb_info *bb_info = df_rd_get_bb_info (dflow, i); - if (bb_info) + for (i = 0; i < dflow->block_info_size; i++) { - BITMAP_FREE (bb_info->kill); - BITMAP_FREE (bb_info->sparse_kill); - BITMAP_FREE (bb_info->gen); - BITMAP_FREE (bb_info->in); - BITMAP_FREE (bb_info->out); + struct df_rd_bb_info *bb_info = df_rd_get_bb_info (dflow, i); + if (bb_info) + { + BITMAP_FREE (bb_info->kill); + BITMAP_FREE (bb_info->sparse_kill); + BITMAP_FREE (bb_info->gen); + BITMAP_FREE (bb_info->in); + BITMAP_FREE (bb_info->out); + } } + + free_alloc_pool (dflow->block_pool); + + for (i = 0; i < problem_data->def_sites_size; i++) + { + bitmap bm = problem_data->def_sites[i]; + if (bm) + BITMAP_FREE (bm); + } + + free (problem_data->def_sites); + BITMAP_FREE (problem_data->sparse_invalidated_by_call); + BITMAP_FREE (problem_data->dense_invalidated_by_call); + + dflow->block_info_size = 0; + free (dflow->block_info); + free (dflow->problem_data); } - - free_alloc_pool (dflow->block_pool); - - for (i = 0; i < problem_data->def_sites_size; i++) - { - bitmap bm = problem_data->def_sites[i]; - if (bm) - BITMAP_FREE (bm); - } - - free (problem_data->def_sites); - BITMAP_FREE (problem_data->sparse_invalidated_by_call); - BITMAP_FREE (problem_data->dense_invalidated_by_call); - - dflow->block_info_size = 0; - free (dflow->block_info); - free (dflow->problem_data); free (dflow); } @@ -1315,7 +1325,9 @@ df_lr_set_bb_info (struct dataflow *dflow, unsigned int index, /* Free basic block info. */ static void -df_lr_free_bb_info (struct dataflow *dflow, void *vbb_info) +df_lr_free_bb_info (struct dataflow *dflow, + basic_block bb ATTRIBUTE_UNUSED, + void *vbb_info) { struct df_lr_bb_info *bb_info = (struct df_lr_bb_info *) vbb_info; if (bb_info) @@ -1586,22 +1598,25 @@ df_lr_transfer_function (struct dataflow *dflow, int bb_index) static void df_lr_free (struct dataflow *dflow) { - unsigned int i; - for (i = 0; i < dflow->block_info_size; i++) + if (dflow->block_info) { - struct df_lr_bb_info *bb_info = df_lr_get_bb_info (dflow, i); - if (bb_info) + unsigned int i; + for (i = 0; i < dflow->block_info_size; i++) { - BITMAP_FREE (bb_info->use); - BITMAP_FREE (bb_info->def); - BITMAP_FREE (bb_info->in); - BITMAP_FREE (bb_info->out); + struct df_lr_bb_info *bb_info = df_lr_get_bb_info (dflow, i); + if (bb_info) + { + BITMAP_FREE (bb_info->use); + BITMAP_FREE (bb_info->def); + BITMAP_FREE (bb_info->in); + BITMAP_FREE (bb_info->out); + } } + free_alloc_pool (dflow->block_pool); + + dflow->block_info_size = 0; + free (dflow->block_info); } - free_alloc_pool (dflow->block_pool); - - dflow->block_info_size = 0; - free (dflow->block_info); free (dflow); } @@ -1695,7 +1710,9 @@ df_ur_set_bb_info (struct dataflow *dflow, unsigned int index, /* Free basic block info. */ static void -df_ur_free_bb_info (struct dataflow *dflow, void *vbb_info) +df_ur_free_bb_info (struct dataflow *dflow, + basic_block bb ATTRIBUTE_UNUSED, + void *vbb_info) { struct df_ur_bb_info *bb_info = (struct df_ur_bb_info *) vbb_info; if (bb_info) @@ -1915,23 +1932,26 @@ df_ur_transfer_function (struct dataflow *dflow, int bb_index) static void df_ur_free (struct dataflow *dflow) { - unsigned int i; - - for (i = 0; i < dflow->block_info_size; i++) + if (dflow->block_info) { - struct df_ur_bb_info *bb_info = df_ur_get_bb_info (dflow, i); - if (bb_info) + unsigned int i; + + for (i = 0; i < dflow->block_info_size; i++) { - BITMAP_FREE (bb_info->gen); - BITMAP_FREE (bb_info->kill); - BITMAP_FREE (bb_info->in); - BITMAP_FREE (bb_info->out); + struct df_ur_bb_info *bb_info = df_ur_get_bb_info (dflow, i); + if (bb_info) + { + BITMAP_FREE (bb_info->gen); + BITMAP_FREE (bb_info->kill); + BITMAP_FREE (bb_info->in); + BITMAP_FREE (bb_info->out); + } } + + free_alloc_pool (dflow->block_pool); + dflow->block_info_size = 0; + free (dflow->block_info); } - - free_alloc_pool (dflow->block_pool); - dflow->block_info_size = 0; - free (dflow->block_info); free (dflow); } @@ -2039,7 +2059,9 @@ df_urec_set_bb_info (struct dataflow *dflow, unsigned int index, /* Free basic block info. */ static void -df_urec_free_bb_info (struct dataflow *dflow, void *vbb_info) +df_urec_free_bb_info (struct dataflow *dflow, + basic_block bb ATTRIBUTE_UNUSED, + void *vbb_info) { struct df_urec_bb_info *bb_info = (struct df_urec_bb_info *) vbb_info; if (bb_info) @@ -2529,26 +2551,29 @@ df_urec_transfer_function (struct dataflow *dflow, int bb_index) static void df_urec_free (struct dataflow *dflow) { - unsigned int i; - - for (i = 0; i < dflow->block_info_size; i++) + if (dflow->block_info) { - struct df_urec_bb_info *bb_info = df_urec_get_bb_info (dflow, i); - if (bb_info) + unsigned int i; + + for (i = 0; i < dflow->block_info_size; i++) { - BITMAP_FREE (bb_info->gen); - BITMAP_FREE (bb_info->kill); - BITMAP_FREE (bb_info->in); - BITMAP_FREE (bb_info->out); - BITMAP_FREE (bb_info->earlyclobber); + struct df_urec_bb_info *bb_info = df_urec_get_bb_info (dflow, i); + if (bb_info) + { + BITMAP_FREE (bb_info->gen); + BITMAP_FREE (bb_info->kill); + BITMAP_FREE (bb_info->in); + BITMAP_FREE (bb_info->out); + BITMAP_FREE (bb_info->earlyclobber); + } } + + free_alloc_pool (dflow->block_pool); + + dflow->block_info_size = 0; + free (dflow->block_info); + free (dflow->problem_data); } - - free_alloc_pool (dflow->block_pool); - - dflow->block_info_size = 0; - free (dflow->block_info); - free (dflow->problem_data); free (dflow); } |