diff options
author | Paolo Bonzini <bonzini@gnu.org> | 2009-06-27 14:45:51 +0000 |
---|---|---|
committer | Paolo Bonzini <bonzini@gcc.gnu.org> | 2009-06-27 14:45:51 +0000 |
commit | ccf5c864c9bae45e3c1a9858529f346005e5ca25 (patch) | |
tree | 4d282ef2e7bba7ac8b8f57bfadf3057c91cb6a6b /gcc/domwalk.c | |
parent | c6bd4220c947db8bccef32768766ea2f030f70d5 (diff) | |
download | gcc-ccf5c864c9bae45e3c1a9858529f346005e5ca25.zip gcc-ccf5c864c9bae45e3c1a9858529f346005e5ca25.tar.gz gcc-ccf5c864c9bae45e3c1a9858529f346005e5ca25.tar.bz2 |
domwalk.h (struct dom_walk_data): Remove all callbacks except before_dom_children_before_stmts and...
2009-06-27 Paolo Bonzini <bonzini@gnu.org>
* domwalk.h (struct dom_walk_data): Remove all callbacks except
before_dom_children_before_stmts and after_dom_children_after_stmts.
Rename the two remaining callbacks to just before_dom_children and
after_dom_children. Remove other GIMPLE statement walking bits.
* domwalk.c (walk_dominator_tree): Remove now unsupported features.
* graphite.c: Do not include domwalk.h.
* tree-into-ssa.c (interesting_blocks): New global.
(struct mark_def_sites_global_data): Remove it and names_to_rename.
(mark_def_sites, rewrite_stmt, rewrite_add_phi_arguments,
rewrite_update_stmt, rewrite_update_phi_arguments): Simplify
now that they're not domwalk callbacks.
(rewrite_initialize_block): Rename to...
(rewrite_enter_block): ... this, place after called functions. Test
interesting_blocks, call rewrite_stmt and rewrite_add_phi_arguments.
(rewrite_finalize_block): Rename to...
(rewrite_leave_block): ... this, place after called functions.
(rewrite_update_init_block): Rename to...
(rewrite_update_enter_block): ... this, place after called functions.
Test interesting_blocks, call rewrite_update_stmt and
rewrite_update_phi_arguments.
(rewrite_update_fini_block): Rename to...
(rewrite_leave_block): ... this, place after called functions.
(rewrite_blocks): Remove last argument, simplify initialization of
walk_data.
(mark_def_sites_initialize_block): Rename to...
(mark_def_sites_block): ... this, call mark_def_sites.
(mark_def_sites_blocks): Remove argument, simplify initialization of
walk_data.
(rewrite_into_ssa): Adjust for interesting_blocks_being a global.
(update_ssa): Likewise.
* tree-ssa-dom.c (optimize_stmt): Simplify now that it's not a domwalk
callback.
(tree_ssa_dominator_optimize): Simplify initialization of walk_data.
(dom_opt_initialize_block): Rename to...
(dom_opt_enter_block): ... this, place after called functions. Walk
statements here, inline propagate_to_outgoing_edges.
(dom_opt_finalize_block): Rename to...
(dom_opt_leave_block): ... this, place after called functions.
* tree-ssa-dse.c (dse_optimize_stmt): Simplify now that it's not a
domwalk callback.
(dse_enter_block, dse_record_phi): New.
(dse_record_phis): Delete.
(dse_finalize_block): Rename to...
(dse_leave_block): ... this.
(tree_ssa_dse): Simplify initialization of walk_data.
* tree-ssa-loop-im.c (determine_invariantness, move_computations):
Adjust initialization of walk_data.
* tree-ssa-loop-unswitch.c: Do not include domwalk.h.
* tree-ssa-loop-phiopt.c (get_non_trapping):
Adjust initialization of walk_data.
* tree-ssa-loop-threadedge.c: Do not include domwalk.h.
* tree-ssa-uncprop.c (uncprop_into_successor_phis): Simplify now that
it's not a domwalk callback.
(uncprop_initialize_block): Rename to...
(dse_enter_block): ... this, call uncprop_into_successor_phis.
(dse_finalize_block): Rename to...
(dse_leave_block): ... this.
(tree_ssa_uncprop): Simplify initialization of walk_data.
* Makefile.in: Adjust dependencies.
From-SVN: r149008
Diffstat (limited to 'gcc/domwalk.c')
-rw-r--r-- | gcc/domwalk.c | 63 |
1 files changed, 6 insertions, 57 deletions
diff --git a/gcc/domwalk.c b/gcc/domwalk.c index 8f77922..b70a807 100644 --- a/gcc/domwalk.c +++ b/gcc/domwalk.c @@ -23,9 +23,7 @@ along with GCC; see the file COPYING3. If not see #include "system.h" #include "coretypes.h" #include "tm.h" -#include "tree.h" #include "basic-block.h" -#include "tree-flow.h" #include "domwalk.h" #include "ggc.h" @@ -144,8 +142,6 @@ walk_dominator_tree (struct dom_walk_data *walk_data, basic_block bb) { void *bd = NULL; basic_block dest; - gimple_stmt_iterator gsi; - bool is_interesting; basic_block *worklist = XNEWVEC (basic_block, n_basic_blocks * 2); int sp = 0; @@ -156,13 +152,6 @@ walk_dominator_tree (struct dom_walk_data *walk_data, basic_block bb) || bb == ENTRY_BLOCK_PTR || bb == EXIT_BLOCK_PTR) { - /* If block BB is not interesting to the caller, then none of the - callbacks that walk the statements in BB are going to be - executed. */ - is_interesting = walk_data->interesting_blocks == NULL - || TEST_BIT (walk_data->interesting_blocks, - bb->index); - /* Callback to initialize the local data structure. */ if (walk_data->initialize_block_local_data) { @@ -192,27 +181,8 @@ walk_dominator_tree (struct dom_walk_data *walk_data, basic_block bb) /* Callback for operations to execute before we have walked the dominator children, but before we walk statements. */ - if (walk_data->before_dom_children_before_stmts) - (*walk_data->before_dom_children_before_stmts) (walk_data, bb); - - /* Statement walk before walking dominator children. */ - if (is_interesting && walk_data->before_dom_children_walk_stmts) - { - if (walk_data->walk_stmts_backward) - for (gsi = gsi_last (bb_seq (bb)); !gsi_end_p (gsi); - gsi_prev (&gsi)) - (*walk_data->before_dom_children_walk_stmts) (walk_data, bb, - gsi); - else - for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi)) - (*walk_data->before_dom_children_walk_stmts) (walk_data, bb, - gsi); - } - - /* Callback for operations to execute before we have walked the - dominator children, and after we walk statements. */ - if (walk_data->before_dom_children_after_stmts) - (*walk_data->before_dom_children_after_stmts) (walk_data, bb); + if (walk_data->before_dom_children) + (*walk_data->before_dom_children) (walk_data, bb); /* Mark the current BB to be popped out of the recursion stack once children are processed. */ @@ -223,37 +193,16 @@ walk_dominator_tree (struct dom_walk_data *walk_data, basic_block bb) dest; dest = next_dom_son (walk_data->dom_direction, dest)) worklist[sp++] = dest; } - /* NULL is used to signalize pop operation in recursion stack. */ + /* NULL is used to mark pop operations in the recursion stack. */ while (sp > 0 && !worklist[sp - 1]) { --sp; bb = worklist[--sp]; - is_interesting = walk_data->interesting_blocks == NULL - || TEST_BIT (walk_data->interesting_blocks, - bb->index); - /* Callback for operations to execute after we have walked the - dominator children, but before we walk statements. */ - if (walk_data->after_dom_children_before_stmts) - (*walk_data->after_dom_children_before_stmts) (walk_data, bb); - - /* Statement walk after walking dominator children. */ - if (is_interesting && walk_data->after_dom_children_walk_stmts) - { - if (walk_data->walk_stmts_backward) - for (gsi = gsi_last (bb_seq (bb)); !gsi_end_p (gsi); - gsi_prev (&gsi)) - (*walk_data->after_dom_children_walk_stmts) (walk_data, bb, - gsi); - else - for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi)) - (*walk_data->after_dom_children_walk_stmts) (walk_data, bb, - gsi); - } /* Callback for operations to execute after we have walked the - dominator children and after we have walked statements. */ - if (walk_data->after_dom_children_after_stmts) - (*walk_data->after_dom_children_after_stmts) (walk_data, bb); + dominator children, but before we walk statements. */ + if (walk_data->after_dom_children) + (*walk_data->after_dom_children) (walk_data, bb); if (walk_data->initialize_block_local_data) { |