diff options
author | Kazu Hirata <kazu@cs.umass.edu> | 2005-03-13 13:31:01 +0000 |
---|---|---|
committer | Kazu Hirata <kazu@gcc.gnu.org> | 2005-03-13 13:31:01 +0000 |
commit | d357720d41be5a06988524d023bc4f0e7cbcc7ed (patch) | |
tree | 45aa8123e100141f92309d1cd58db95f2951da1d | |
parent | 6bbaec0912db7f78d62640f99ba1782c109b19de (diff) | |
download | gcc-d357720d41be5a06988524d023bc4f0e7cbcc7ed.zip gcc-d357720d41be5a06988524d023bc4f0e7cbcc7ed.tar.gz gcc-d357720d41be5a06988524d023bc4f0e7cbcc7ed.tar.bz2 |
tree-into-ssa.c (find_idf): Speed up by putting the indexes of basic blocks into work_stack.
* tree-into-ssa.c (find_idf): Speed up by putting the indexes
of basic blocks into work_stack.
From-SVN: r96367
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/tree-into-ssa.c | 19 |
2 files changed, 13 insertions, 11 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 6c0d36c..227ff5f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2005-03-13 Kazu Hirata <kazu@cs.umass.edu> + + * tree-into-ssa.c (find_idf): Speed up by putting the indexes + of basic blocks into work_stack. + 2005-03-13 Andy Hutchinson <HutchinsonAndy@netscape.net> PR target/18251 diff --git a/gcc/tree-into-ssa.c b/gcc/tree-into-ssa.c index fa1d0da..8c58a45 100644 --- a/gcc/tree-into-ssa.c +++ b/gcc/tree-into-ssa.c @@ -111,7 +111,7 @@ static htab_t def_blocks; static VEC(tree_on_heap) *block_defs_stack; /* Basic block vectors used in this file ought to be allocated in the heap. */ -DEF_VEC_MALLOC_P(basic_block); +DEF_VEC_MALLOC_P(int); /* Global data to attach to the main dominator walk structure. */ struct mark_def_sites_global_data @@ -503,40 +503,37 @@ find_idf (bitmap def_blocks, bitmap *dfs) { bitmap_iterator bi; unsigned bb_index; - VEC(basic_block) *work_stack; + VEC(int) *work_stack; bitmap phi_insertion_points; - work_stack = VEC_alloc (basic_block, n_basic_blocks); + work_stack = VEC_alloc (int, n_basic_blocks); phi_insertion_points = BITMAP_ALLOC (NULL); /* Seed the work list with all the blocks in DEF_BLOCKS. */ EXECUTE_IF_SET_IN_BITMAP (def_blocks, 0, bb_index, bi) - VEC_safe_push (basic_block, work_stack, BASIC_BLOCK (bb_index)); + VEC_safe_push (int, work_stack, bb_index); /* Pop a block off the worklist, add every block that appears in the original block's DF that we have not already processed to the worklist. Iterate until the worklist is empty. Blocks which are added to the worklist are potential sites for PHI nodes. */ - while (VEC_length (basic_block, work_stack) > 0) + while (VEC_length (int, work_stack) > 0) { - basic_block bb = VEC_pop (basic_block, work_stack); - bb_index = bb->index; + bb_index = VEC_pop (int, work_stack); EXECUTE_IF_AND_COMPL_IN_BITMAP (dfs[bb_index], phi_insertion_points, 0, bb_index, bi) { - bb = BASIC_BLOCK (bb_index); - /* Use a safe push because if there is a definition of VAR in every basic block, then WORK_STACK may eventually have more than N_BASIC_BLOCK entries. */ - VEC_safe_push (basic_block, work_stack, bb); + VEC_safe_push (int, work_stack, bb_index); bitmap_set_bit (phi_insertion_points, bb_index); } } - VEC_free (basic_block, work_stack); + VEC_free (int, work_stack); return phi_insertion_points; } |