Commit ccf5c864 by Paolo Bonzini Committed by Paolo Bonzini

domwalk.h (struct dom_walk_data): Remove all callbacks except…

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
parent c6bd4220
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.
2009-06-27 Richard Earnshaw <rearnsha@arm.com>
* arm.md (casesi): Fix test for Thumb1.
......
......@@ -2221,7 +2221,7 @@ tree-ssa-threadedge.o : tree-ssa-threadedge.c $(TREE_FLOW_H) $(CONFIG_H) \
$(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) $(FLAGS_H) $(RTL_H) $(TM_P_H) $(GGC_H) \
$(BASIC_BLOCK_H) $(CFGLOOP_H) output.h $(EXPR_H) \
$(FUNCTION_H) $(DIAGNOSTIC_H) $(TIMEVAR_H) $(TREE_DUMP_H) $(TREE_FLOW_H) \
domwalk.h $(REAL_H) $(TREE_PASS_H) tree-ssa-propagate.h langhooks.h \
$(REAL_H) $(TREE_PASS_H) tree-ssa-propagate.h langhooks.h \
$(PARAMS_H)
tree-ssa-threadupdate.o : tree-ssa-threadupdate.c $(TREE_FLOW_H) $(CONFIG_H) \
$(SYSTEM_H) $(RTL_H) $(TREE_H) $(TM_P_H) $(EXPR_H) $(GGC_H) output.h \
......@@ -2233,7 +2233,7 @@ tree-phinodes.o : tree-phinodes.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
$(TM_H) $(TREE_H) $(VARRAY_H) $(GGC_H) $(BASIC_BLOCK_H) $(TREE_FLOW_H) \
gt-tree-phinodes.h $(RTL_H) $(TOPLEV.H) $(GIMPLE_H)
domwalk.o : domwalk.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(TREE_H) $(BASIC_BLOCK_H) $(TREE_FLOW_H) domwalk.h $(GGC_H)
$(BASIC_BLOCK_H) domwalk.h $(GGC_H)
tree-ssa-live.o : tree-ssa-live.c $(TREE_FLOW_H) $(CONFIG_H) $(SYSTEM_H) \
$(TREE_H) $(DIAGNOSTIC_H) $(TM_H) coretypes.h $(TREE_DUMP_H) \
$(TREE_SSA_LIVE_H) $(BITMAP_H) $(TOPLEV_H) debug.h $(FLAGS_H)
......@@ -2310,7 +2310,7 @@ tree-ssa-loop.o : tree-ssa-loop.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(CFGLOOP_H) $(FLAGS_H) $(TREE_INLINE_H) tree-scalar-evolution.h
tree-ssa-loop-unswitch.o : tree-ssa-loop-unswitch.c $(TREE_FLOW_H) \
$(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TREE_H) $(TM_P_H) $(CFGLOOP_H) \
domwalk.h $(PARAMS_H) output.h $(DIAGNOSTIC_H) $(TIMEVAR_H) $(TM_H) \
$(PARAMS_H) output.h $(DIAGNOSTIC_H) $(TIMEVAR_H) $(TM_H) \
coretypes.h $(TREE_DUMP_H) $(TREE_PASS_H) $(BASIC_BLOCK_H) hard-reg-set.h \
$(TREE_INLINE_H)
tree-ssa-address.o : tree-ssa-address.c $(TREE_FLOW_H) $(CONFIG_H) \
......@@ -2425,7 +2425,7 @@ tree-data-ref.o: tree-data-ref.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(TREE_DATA_REF_H) $(SCEV_H) $(TREE_PASS_H) tree-chrec.h langhooks.h
graphite.o: graphite.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(GGC_H) $(TREE_H) $(RTL_H) $(BASIC_BLOCK_H) $(DIAGNOSTIC_H) $(TOPLEV_H) \
$(TREE_FLOW_H) $(TREE_DUMP_H) $(TIMEVAR_H) $(CFGLOOP_H) $(GIMPLE_H) domwalk.h \
$(TREE_FLOW_H) $(TREE_DUMP_H) $(TIMEVAR_H) $(CFGLOOP_H) $(GIMPLE_H) \
$(TREE_DATA_REF_H) $(SCEV_H) $(TREE_PASS_H) tree-chrec.h graphite.h \
pointer-set.h value-prof.h
tree-vect-loop.o: tree-vect-loop.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
......
......@@ -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)
{
......
......@@ -34,15 +34,6 @@ struct dom_walk_data
dominator tree. */
ENUM_BITFIELD (cdi_direction) dom_direction : 2;
/* Nonzero if the statement walker should walk the statements from
last to first within a basic block instead of first to last.
Note this affects both statement walkers. We haven't yet needed
to use the second statement walker for anything, so it's hard to
predict if we really need the ability to select their direction
independently. */
BOOL_BITFIELD walk_stmts_backward : 1;
/* Function to initialize block local data.
Note that the dominator walker infrastructure may provide a new
......@@ -55,41 +46,11 @@ struct dom_walk_data
void (*initialize_block_local_data) (struct dom_walk_data *,
basic_block, bool);
/* Function to call before the statement walk occurring before the
recursive walk of the dominator children.
This typically initializes a block local data and pushes that
data onto BLOCK_DATA_STACK. */
void (*before_dom_children_before_stmts) (struct dom_walk_data *,
basic_block);
/* Function to call to walk statements before the recursive walk
of the dominator children. */
void (*before_dom_children_walk_stmts) (struct dom_walk_data *,
basic_block, gimple_stmt_iterator);
/* Function to call after the statement walk occurring before the
recursive walk of the dominator children. */
void (*before_dom_children_after_stmts) (struct dom_walk_data *,
basic_block);
/* Function to call before the recursive walk of the dominator children. */
void (*before_dom_children) (struct dom_walk_data *, basic_block);
/* Function to call before the statement walk occurring after the
recursive walk of the dominator children. */
void (*after_dom_children_before_stmts) (struct dom_walk_data *,
basic_block);
/* Function to call to walk statements after the recursive walk
of the dominator children. */
void (*after_dom_children_walk_stmts) (struct dom_walk_data *,
basic_block, gimple_stmt_iterator);
/* Function to call after the statement walk occurring after the
recursive walk of the dominator children.
This typically finalizes any block local data and pops
that data from BLOCK_DATA_STACK. */
void (*after_dom_children_after_stmts) (struct dom_walk_data *,
basic_block);
/* Function to call after the recursive walk of the dominator children. */
void (*after_dom_children) (struct dom_walk_data *, basic_block);
/* Global data for a walk through the dominator tree. */
void *global_data;
......@@ -108,14 +69,6 @@ struct dom_walk_data
/* Stack of available block local structures. */
VEC(void_p,heap) *free_block_data;
/* Interesting blocks to process. If this field is not NULL, this
set is used to determine which blocks to walk. If we encounter
block I in the dominator traversal, but block I is not present in
INTERESTING_BLOCKS, then none of the callback functions are
invoked on it. This is useful when a particular traversal wants
to filter out non-interesting blocks from the dominator tree. */
sbitmap interesting_blocks;
};
void walk_dominator_tree (struct dom_walk_data *, basic_block);
......
......@@ -50,7 +50,6 @@ along with GCC; see the file COPYING3. If not see
#include "tree-data-ref.h"
#include "tree-scalar-evolution.h"
#include "tree-pass.h"
#include "domwalk.h"
#include "value-prof.h"
#include "pointer-set.h"
#include "gimple.h"
......
......@@ -1259,7 +1259,7 @@ execute_one_pass (struct opt_pass *pass)
if (pass->gate && !pass->gate ())
return false;
if (!quiet_flag && !cfun)
if (!quiet_flag)
fprintf (stderr, " <%s>", pass->name ? pass->name : "");
if (pass->todo_flags_start & TODO_set_props)
......
......@@ -1358,13 +1358,10 @@ walk_non_aliased_vuses (ao_ref *ref, tree vuse,
bitmap visited = NULL;
void *res;
timevar_push (TV_ALIAS_STMT_WALK);
do
{
gimple def_stmt;
/* ??? Do we want to account this to TV_ALIAS_STMT_WALK? */
res = (*walker) (ref, vuse, data);
if (res)
break;
......@@ -1400,8 +1397,6 @@ walk_non_aliased_vuses (ao_ref *ref, tree vuse,
if (visited)
BITMAP_FREE (visited);
timevar_pop (TV_ALIAS_STMT_WALK);
return res;
}
......@@ -1445,7 +1440,6 @@ walk_aliased_vdefs_1 (tree ref, tree vdef,
return cnt;
}
/* ??? Do we want to account this to TV_ALIAS_STMT_WALK? */
cnt++;
if ((!ref
|| stmt_may_clobber_ref_p (def_stmt, ref))
......@@ -1465,15 +1459,11 @@ walk_aliased_vdefs (tree ref, tree vdef,
bitmap local_visited = NULL;
unsigned int ret;
timevar_push (TV_ALIAS_STMT_WALK);
ret = walk_aliased_vdefs_1 (ref, vdef, walker, data,
visited ? visited : &local_visited, 0);
if (local_visited)
BITMAP_FREE (local_visited);
timevar_pop (TV_ALIAS_STMT_WALK);
return ret;
}
......@@ -89,11 +89,8 @@ static unsigned int tree_ssa_dse (void);
static void dse_initialize_block_local_data (struct dom_walk_data *,
basic_block,
bool);
static void dse_optimize_stmt (struct dom_walk_data *,
basic_block,
gimple_stmt_iterator);
static void dse_record_phis (struct dom_walk_data *, basic_block);
static void dse_finalize_block (struct dom_walk_data *, basic_block);
static void dse_enter_block (struct dom_walk_data *, basic_block);
static void dse_leave_block (struct dom_walk_data *, basic_block);
static void record_voperand_set (bitmap, bitmap *, unsigned int);
/* Returns uid of statement STMT. */
......@@ -267,15 +264,10 @@ dse_possible_dead_store_p (gimple stmt, gimple *use_stmt)
post dominates the first store, then the first store is dead. */
static void
dse_optimize_stmt (struct dom_walk_data *walk_data,
basic_block bb ATTRIBUTE_UNUSED,
dse_optimize_stmt (struct dse_global_data *dse_gd,
struct dse_block_local_data *bd,
gimple_stmt_iterator gsi)
{
struct dse_block_local_data *bd
= (struct dse_block_local_data *)
VEC_last (void_p, walk_data->block_data_stack);
struct dse_global_data *dse_gd
= (struct dse_global_data *) walk_data->global_data;
gimple stmt = gsi_stmt (gsi);
/* If this statement has no virtual defs, then there is nothing
......@@ -351,27 +343,33 @@ dse_optimize_stmt (struct dom_walk_data *walk_data,
/* Record that we have seen the PHIs at the start of BB which correspond
to virtual operands. */
static void
dse_record_phis (struct dom_walk_data *walk_data, basic_block bb)
dse_record_phi (struct dse_global_data *dse_gd,
struct dse_block_local_data *bd,
gimple phi)
{
if (!is_gimple_reg (gimple_phi_result (phi)))
record_voperand_set (dse_gd->stores, &bd->stores, get_stmt_uid (phi));
}
static void
dse_enter_block (struct dom_walk_data *walk_data, basic_block bb)
{
struct dse_block_local_data *bd
= (struct dse_block_local_data *)
VEC_last (void_p, walk_data->block_data_stack);
struct dse_global_data *dse_gd
= (struct dse_global_data *) walk_data->global_data;
gimple phi;
gimple_stmt_iterator gsi;
for (gsi = gsi_last (bb_seq (bb)); !gsi_end_p (gsi); gsi_prev (&gsi))
dse_optimize_stmt (dse_gd, bd, gsi);
for (gsi = gsi_start_phis (bb); !gsi_end_p (gsi); gsi_next (&gsi))
{
phi = gsi_stmt (gsi);
if (!is_gimple_reg (gimple_phi_result (phi)))
record_voperand_set (dse_gd->stores, &bd->stores, get_stmt_uid (phi));
}
dse_record_phi (dse_gd, bd, gsi_stmt (gsi));
}
static void
dse_finalize_block (struct dom_walk_data *walk_data,
basic_block bb ATTRIBUTE_UNUSED)
dse_leave_block (struct dom_walk_data *walk_data,
basic_block bb ATTRIBUTE_UNUSED)
{
struct dse_block_local_data *bd
= (struct dse_block_local_data *)
......@@ -409,16 +407,10 @@ tree_ssa_dse (void)
/* Dead store elimination is fundamentally a walk of the post-dominator
tree and a backwards walk of statements within each block. */
walk_data.walk_stmts_backward = true;
walk_data.dom_direction = CDI_POST_DOMINATORS;
walk_data.initialize_block_local_data = dse_initialize_block_local_data;
walk_data.before_dom_children_before_stmts = NULL;
walk_data.before_dom_children_walk_stmts = dse_optimize_stmt;
walk_data.before_dom_children_after_stmts = dse_record_phis;
walk_data.after_dom_children_before_stmts = NULL;
walk_data.after_dom_children_walk_stmts = NULL;
walk_data.after_dom_children_after_stmts = dse_finalize_block;
walk_data.interesting_blocks = NULL;
walk_data.before_dom_children = dse_enter_block;
walk_data.after_dom_children = dse_leave_block;
walk_data.block_local_data_size = sizeof (struct dse_block_local_data);
......
......@@ -999,7 +999,7 @@ determine_invariantness (void)
memset (&walk_data, 0, sizeof (struct dom_walk_data));
walk_data.dom_direction = CDI_DOMINATORS;
walk_data.before_dom_children_before_stmts = determine_invariantness_stmt;
walk_data.before_dom_children = determine_invariantness_stmt;
init_walk_dominator_tree (&walk_data);
walk_dominator_tree (&walk_data, ENTRY_BLOCK_PTR);
......@@ -1073,7 +1073,7 @@ move_computations (void)
memset (&walk_data, 0, sizeof (struct dom_walk_data));
walk_data.dom_direction = CDI_DOMINATORS;
walk_data.before_dom_children_before_stmts = move_computations_stmt;
walk_data.before_dom_children = move_computations_stmt;
init_walk_dominator_tree (&walk_data);
walk_dominator_tree (&walk_data, ENTRY_BLOCK_PTR);
......
......@@ -32,7 +32,6 @@ along with GCC; see the file COPYING3. If not see
#include "tree-dump.h"
#include "timevar.h"
#include "cfgloop.h"
#include "domwalk.h"
#include "params.h"
#include "tree-pass.h"
#include "tree-inline.h"
......
......@@ -1139,18 +1139,12 @@ get_non_trapping (void)
/* Setup callbacks for the generic dominator tree walker. */
nontrap_set = nontrap;
walk_data.walk_stmts_backward = false;
walk_data.dom_direction = CDI_DOMINATORS;
walk_data.initialize_block_local_data = NULL;
walk_data.before_dom_children_before_stmts = nt_init_block;
walk_data.before_dom_children_walk_stmts = NULL;
walk_data.before_dom_children_after_stmts = NULL;
walk_data.after_dom_children_before_stmts = NULL;
walk_data.after_dom_children_walk_stmts = NULL;
walk_data.after_dom_children_after_stmts = nt_fini_block;
walk_data.before_dom_children = nt_init_block;
walk_data.after_dom_children = nt_fini_block;
walk_data.global_data = NULL;
walk_data.block_local_data_size = 0;
walk_data.interesting_blocks = NULL;
init_walk_dominator_tree (&walk_data);
walk_dominator_tree (&walk_data, ENTRY_BLOCK_PTR);
......
......@@ -36,7 +36,6 @@ along with GCC; see the file COPYING3. If not see
#include "timevar.h"
#include "tree-dump.h"
#include "tree-flow.h"
#include "domwalk.h"
#include "real.h"
#include "tree-pass.h"
#include "tree-ssa-propagate.h"
......
......@@ -289,9 +289,9 @@ struct equiv_hash_elt
VEC(tree,heap) *equivalences;
};
static void uncprop_initialize_block (struct dom_walk_data *, basic_block);
static void uncprop_finalize_block (struct dom_walk_data *, basic_block);
static void uncprop_into_successor_phis (struct dom_walk_data *, basic_block);
static void uncprop_enter_block (struct dom_walk_data *, basic_block);
static void uncprop_leave_block (struct dom_walk_data *, basic_block);
static void uncprop_into_successor_phis (basic_block);
/* Hashing and equality routines for the hash table. */
......@@ -381,18 +381,12 @@ tree_ssa_uncprop (void)
calculate_dominance_info (CDI_DOMINATORS);
/* Setup callbacks for the generic dominator tree walker. */
walk_data.walk_stmts_backward = false;
walk_data.dom_direction = CDI_DOMINATORS;
walk_data.initialize_block_local_data = NULL;
walk_data.before_dom_children_before_stmts = uncprop_initialize_block;
walk_data.before_dom_children_walk_stmts = NULL;
walk_data.before_dom_children_after_stmts = uncprop_into_successor_phis;
walk_data.after_dom_children_before_stmts = NULL;
walk_data.after_dom_children_walk_stmts = NULL;
walk_data.after_dom_children_after_stmts = uncprop_finalize_block;
walk_data.before_dom_children = uncprop_enter_block;
walk_data.after_dom_children = uncprop_leave_block;
walk_data.global_data = NULL;
walk_data.block_local_data_size = 0;
walk_data.interesting_blocks = NULL;
/* Now initialize the dominator walker. */
init_walk_dominator_tree (&walk_data);
......@@ -432,8 +426,8 @@ tree_ssa_uncprop (void)
the dominator tree. */
static void
uncprop_finalize_block (struct dom_walk_data *walk_data ATTRIBUTE_UNUSED,
basic_block bb ATTRIBUTE_UNUSED)
uncprop_leave_block (struct dom_walk_data *walk_data ATTRIBUTE_UNUSED,
basic_block bb ATTRIBUTE_UNUSED)
{
/* Pop the topmost value off the equiv stack. */
tree value = VEC_pop (tree, equiv_stack);
......@@ -447,8 +441,7 @@ uncprop_finalize_block (struct dom_walk_data *walk_data ATTRIBUTE_UNUSED,
/* Unpropagate values from PHI nodes in successor blocks of BB. */
static void
uncprop_into_successor_phis (struct dom_walk_data *walk_data ATTRIBUTE_UNUSED,
basic_block bb)
uncprop_into_successor_phis (basic_block bb)
{
edge e;
edge_iterator ei;
......@@ -476,7 +469,6 @@ uncprop_into_successor_phis (struct dom_walk_data *walk_data ATTRIBUTE_UNUSED,
/* Walk over the PHI nodes, unpropagating values. */
for (gsi = gsi_start (phis) ; !gsi_end_p (gsi); gsi_next (&gsi))
{
/* Sigh. We'll have more efficient access to this one day. */
gimple phi = gsi_stmt (gsi);
tree arg = PHI_ARG_DEF (phi, e->dest_idx);
struct equiv_hash_elt equiv_hash_elt;
......@@ -556,8 +548,8 @@ single_incoming_edge_ignoring_loop_edges (basic_block bb)
}
static void
uncprop_initialize_block (struct dom_walk_data *walk_data ATTRIBUTE_UNUSED,
basic_block bb)
uncprop_enter_block (struct dom_walk_data *walk_data ATTRIBUTE_UNUSED,
basic_block bb)
{
basic_block parent;
edge e;
......@@ -583,6 +575,8 @@ uncprop_initialize_block (struct dom_walk_data *walk_data ATTRIBUTE_UNUSED,
if (!recorded)
VEC_safe_push (tree, heap, equiv_stack, NULL_TREE);
uncprop_into_successor_phis (bb);
}
static bool
......
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