tree-vrp.c (pass_vrp): Remove PROP_smt_usage.
2006-12-05 Daniel Berlin <dberlin@dberlin.org> * tree-vrp.c (pass_vrp): Remove PROP_smt_usage. * tree-complex.c (pass_lower_complex): Ditto. * tree-ssa-ccp.c (pass_ccp): Ditto. (pass_store_ccp): Ditto. * tree-ssa-dom.c (pass_dominator): Ditto. (pass_phi_only_cprop): Ditto. * tree-sra.c (pass_sra): Ditto. * tree-ssa-forwprop.c (pass_forwprop): Ditto. * tree-flow.h (updating_used_alone): Remove. (updating_used_alone): Ditto. * tree-ssa-alias.c (updating_used_alone): Remove variable. (lhs_may_store_to): Remove function. (recalculate_used_alone): Ditto. (compute_may_aliases): Remove used_alone calculation. * tree.h (struct tree_memory_tag): Remove is_used_alone and old_used_alone. Remove SMT_USED_ALONE and SMT_OLD_USED_ALONE. * tree-pass.h (PROP_smt_usage): Remove. * passes.c (execute_todo): Remove used alone recalculation. (execute_one_pass): Ditto. * tree-ssa-operands.c (add_virtual_operand): Remove used_alone stuff. From-SVN: r119550
This commit is contained in:
parent
c1ac94fbe9
commit
ae07b4632c
16
gcc/passes.c
16
gcc/passes.c
|
@ -721,24 +721,14 @@ execute_todo (unsigned int flags)
|
|||
if (!flags)
|
||||
return;
|
||||
|
||||
/* Always recalculate SMT usage before doing anything else. */
|
||||
if (flags & TODO_update_smt_usage)
|
||||
recalculate_used_alone ();
|
||||
|
||||
/* Always cleanup the CFG before trying to update SSA . */
|
||||
if (flags & TODO_cleanup_cfg)
|
||||
{
|
||||
/* CFG Cleanup can cause a constant to prop into an ARRAY_REF. */
|
||||
updating_used_alone = true;
|
||||
|
||||
if (current_loops)
|
||||
cleanup_tree_cfg_loop ();
|
||||
else
|
||||
cleanup_tree_cfg ();
|
||||
|
||||
/* Update the used alone after cleanup cfg. */
|
||||
recalculate_used_alone ();
|
||||
|
||||
/* When cleanup_tree_cfg merges consecutive blocks, it may
|
||||
perform some simplistic propagation when removing single
|
||||
valued PHI nodes. This propagation may, in turn, cause the
|
||||
|
@ -835,9 +825,6 @@ execute_one_pass (struct tree_opt_pass *pass)
|
|||
gcc_assert ((curr_properties & pass->properties_required)
|
||||
== pass->properties_required);
|
||||
|
||||
if (pass->properties_destroyed & PROP_smt_usage)
|
||||
updating_used_alone = true;
|
||||
|
||||
/* If a dump file name is present, open it if enabled. */
|
||||
if (pass->static_pass_number != -1)
|
||||
{
|
||||
|
@ -904,9 +891,6 @@ execute_one_pass (struct tree_opt_pass *pass)
|
|||
dump_file = NULL;
|
||||
}
|
||||
|
||||
if (pass->properties_destroyed & PROP_smt_usage)
|
||||
updating_used_alone = false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -1540,7 +1540,7 @@ struct tree_opt_pass pass_lower_complex =
|
|||
0, /* tv_id */
|
||||
PROP_ssa, /* properties_required */
|
||||
0, /* properties_provided */
|
||||
PROP_smt_usage, /* properties_destroyed */
|
||||
0, /* properties_destroyed */
|
||||
0, /* todo_flags_start */
|
||||
TODO_dump_func | TODO_ggc_collect
|
||||
| TODO_update_smt_usage
|
||||
|
|
|
@ -1060,9 +1060,6 @@ void delete_alias_heapvars (void);
|
|||
|
||||
void swap_tree_operands (tree, tree *, tree *);
|
||||
|
||||
extern void recalculate_used_alone (void);
|
||||
extern bool updating_used_alone;
|
||||
|
||||
int least_common_multiple (int, int);
|
||||
|
||||
#endif /* _TREE_FLOW_H */
|
||||
|
|
|
@ -151,8 +151,6 @@ struct dump_file_info
|
|||
#define PROP_rtl (1 << 8)
|
||||
#define PROP_alias (1 << 9)
|
||||
#define PROP_gimple_lomp (1 << 10) /* lowered OpenMP directives */
|
||||
#define PROP_smt_usage (1 << 11) /* which SMT's are
|
||||
used alone. */
|
||||
|
||||
#define PROP_trees \
|
||||
(PROP_gimple_any | PROP_gimple_lcf | PROP_gimple_leh | PROP_gimple_lomp)
|
||||
|
|
|
@ -2356,7 +2356,7 @@ struct tree_opt_pass pass_sra =
|
|||
TV_TREE_SRA, /* tv_id */
|
||||
PROP_cfg | PROP_ssa | PROP_alias, /* properties_required */
|
||||
0, /* properties_provided */
|
||||
PROP_smt_usage, /* properties_destroyed */
|
||||
0, /* properties_destroyed */
|
||||
0, /* todo_flags_start */
|
||||
TODO_dump_func /* todo_flags_finish */
|
||||
| TODO_update_ssa
|
||||
|
|
|
@ -370,12 +370,6 @@ set_initial_properties (struct alias_info *ai)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/* This variable is set to true if we are updating the used alone
|
||||
information for SMTs, or are in a pass that is going to break it
|
||||
temporarily. */
|
||||
bool updating_used_alone;
|
||||
|
||||
/* Compute which variables need to be marked call clobbered because
|
||||
their tag is call clobbered, and which tags need to be marked
|
||||
global because they contain global variables. */
|
||||
|
@ -401,120 +395,6 @@ compute_call_clobbered (struct alias_info *ai)
|
|||
compute_tag_properties ();
|
||||
}
|
||||
|
||||
|
||||
/* Helper for recalculate_used_alone. Return a conservatively correct
|
||||
answer as to whether STMT may make a store on the LHS to SYM. */
|
||||
|
||||
static bool
|
||||
lhs_may_store_to (tree stmt, tree sym ATTRIBUTE_UNUSED)
|
||||
{
|
||||
tree lhs = GENERIC_TREE_OPERAND (stmt, 0);
|
||||
|
||||
lhs = get_base_address (lhs);
|
||||
|
||||
if (!lhs)
|
||||
return false;
|
||||
|
||||
if (TREE_CODE (lhs) == SSA_NAME)
|
||||
return false;
|
||||
/* We could do better here by looking at the type tag of LHS, but it
|
||||
is unclear whether this is worth it. */
|
||||
return true;
|
||||
}
|
||||
|
||||
/* Recalculate the used_alone information for SMTs . */
|
||||
|
||||
void
|
||||
recalculate_used_alone (void)
|
||||
{
|
||||
VEC (tree, heap) *calls = NULL;
|
||||
block_stmt_iterator bsi;
|
||||
basic_block bb;
|
||||
tree stmt;
|
||||
size_t i;
|
||||
referenced_var_iterator rvi;
|
||||
tree var;
|
||||
|
||||
/* First, reset all the SMT used alone bits to zero. */
|
||||
updating_used_alone = true;
|
||||
FOR_EACH_REFERENCED_VAR (var, rvi)
|
||||
if (TREE_CODE (var) == SYMBOL_MEMORY_TAG)
|
||||
{
|
||||
SMT_OLD_USED_ALONE (var) = SMT_USED_ALONE (var);
|
||||
SMT_USED_ALONE (var) = 0;
|
||||
}
|
||||
|
||||
/* Walk all the statements.
|
||||
Calls get put into a list of statements to update, since we will
|
||||
need to update operands on them if we make any changes.
|
||||
If we see a bare use of a SMT anywhere in a real virtual use or virtual
|
||||
def, mark the SMT as used alone, and for renaming. */
|
||||
FOR_EACH_BB (bb)
|
||||
{
|
||||
for (bsi = bsi_start (bb); !bsi_end_p (bsi); bsi_next (&bsi))
|
||||
{
|
||||
bool iscall = false;
|
||||
ssa_op_iter iter;
|
||||
|
||||
stmt = bsi_stmt (bsi);
|
||||
|
||||
if (TREE_CODE (stmt) == CALL_EXPR
|
||||
|| (TREE_CODE (stmt) == GIMPLE_MODIFY_STMT
|
||||
&& TREE_CODE (GIMPLE_STMT_OPERAND (stmt, 1)) == CALL_EXPR))
|
||||
{
|
||||
iscall = true;
|
||||
VEC_safe_push (tree, heap, calls, stmt);
|
||||
}
|
||||
|
||||
FOR_EACH_SSA_TREE_OPERAND (var, stmt, iter,
|
||||
SSA_OP_VUSE | SSA_OP_VIRTUAL_DEFS)
|
||||
{
|
||||
tree svar = var;
|
||||
|
||||
if (TREE_CODE (var) == SSA_NAME)
|
||||
svar = SSA_NAME_VAR (var);
|
||||
|
||||
if (TREE_CODE (svar) == SYMBOL_MEMORY_TAG)
|
||||
{
|
||||
/* We only care about the LHS on calls. */
|
||||
if (iscall && !lhs_may_store_to (stmt, svar))
|
||||
continue;
|
||||
|
||||
if (!SMT_USED_ALONE (svar))
|
||||
{
|
||||
SMT_USED_ALONE (svar) = true;
|
||||
|
||||
/* Only need to mark for renaming if it wasn't
|
||||
used alone before. */
|
||||
if (!SMT_OLD_USED_ALONE (svar))
|
||||
mark_sym_for_renaming (svar);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Update the operands on all the calls we saw. */
|
||||
if (calls)
|
||||
{
|
||||
for (i = 0; VEC_iterate (tree, calls, i, stmt); i++)
|
||||
update_stmt (stmt);
|
||||
}
|
||||
|
||||
/* We need to mark SMT's that are no longer used for renaming so the
|
||||
symbols go away, or else verification will be angry with us, even
|
||||
though they are dead. */
|
||||
FOR_EACH_REFERENCED_VAR (var, rvi)
|
||||
if (TREE_CODE (var) == SYMBOL_MEMORY_TAG)
|
||||
{
|
||||
if (SMT_OLD_USED_ALONE (var) && !SMT_USED_ALONE (var))
|
||||
mark_sym_for_renaming (var);
|
||||
}
|
||||
|
||||
VEC_free (tree, heap, calls);
|
||||
updating_used_alone = false;
|
||||
}
|
||||
|
||||
/* Compute may-alias information for every variable referenced in function
|
||||
FNDECL.
|
||||
|
||||
|
@ -687,7 +567,6 @@ compute_may_aliases (void)
|
|||
/* Deallocate memory used by aliasing data structures. */
|
||||
delete_alias_info (ai);
|
||||
|
||||
updating_used_alone = true;
|
||||
{
|
||||
block_stmt_iterator bsi;
|
||||
basic_block bb;
|
||||
|
@ -699,8 +578,6 @@ compute_may_aliases (void)
|
|||
}
|
||||
}
|
||||
}
|
||||
recalculate_used_alone ();
|
||||
updating_used_alone = false;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -1434,7 +1434,7 @@ struct tree_opt_pass pass_ccp =
|
|||
TV_TREE_CCP, /* tv_id */
|
||||
PROP_cfg | PROP_ssa | PROP_alias, /* properties_required */
|
||||
0, /* properties_provided */
|
||||
PROP_smt_usage, /* properties_destroyed */
|
||||
0, /* properties_destroyed */
|
||||
0, /* todo_flags_start */
|
||||
TODO_cleanup_cfg | TODO_dump_func | TODO_update_ssa
|
||||
| TODO_ggc_collect | TODO_verify_ssa
|
||||
|
@ -1472,7 +1472,7 @@ struct tree_opt_pass pass_store_ccp =
|
|||
TV_TREE_STORE_CCP, /* tv_id */
|
||||
PROP_cfg | PROP_ssa | PROP_alias, /* properties_required */
|
||||
0, /* properties_provided */
|
||||
PROP_smt_usage, /* properties_destroyed */
|
||||
0, /* properties_destroyed */
|
||||
0, /* todo_flags_start */
|
||||
TODO_dump_func | TODO_update_ssa
|
||||
| TODO_ggc_collect | TODO_verify_ssa
|
||||
|
|
|
@ -380,7 +380,7 @@ struct tree_opt_pass pass_dominator =
|
|||
TV_TREE_SSA_DOMINATOR_OPTS, /* tv_id */
|
||||
PROP_cfg | PROP_ssa | PROP_alias, /* properties_required */
|
||||
0, /* properties_provided */
|
||||
PROP_smt_usage, /* properties_destroyed */
|
||||
0, /* properties_destroyed */
|
||||
0, /* todo_flags_start */
|
||||
TODO_dump_func
|
||||
| TODO_update_ssa
|
||||
|
@ -2521,7 +2521,7 @@ struct tree_opt_pass pass_phi_only_cprop =
|
|||
TV_TREE_PHI_CPROP, /* tv_id */
|
||||
PROP_cfg | PROP_ssa | PROP_alias, /* properties_required */
|
||||
0, /* properties_provided */
|
||||
PROP_smt_usage, /* properties_destroyed */
|
||||
0, /* properties_destroyed */
|
||||
0, /* todo_flags_start */
|
||||
TODO_cleanup_cfg | TODO_dump_func
|
||||
| TODO_ggc_collect | TODO_verify_ssa
|
||||
|
|
|
@ -1049,7 +1049,7 @@ struct tree_opt_pass pass_forwprop = {
|
|||
PROP_cfg | PROP_ssa
|
||||
| PROP_alias, /* properties_required */
|
||||
0, /* properties_provided */
|
||||
PROP_smt_usage, /* properties_destroyed */
|
||||
0, /* properties_destroyed */
|
||||
0, /* todo_flags_start */
|
||||
TODO_dump_func /* todo_flags_finish */
|
||||
| TODO_ggc_collect
|
||||
|
|
|
@ -1303,17 +1303,8 @@ add_virtual_operand (tree var, stmt_ann_t s_ann, int flags,
|
|||
if (v_ann->is_aliased
|
||||
|| none_added
|
||||
|| (TREE_CODE (var) == SYMBOL_MEMORY_TAG
|
||||
&& for_clobber
|
||||
&& SMT_USED_ALONE (var)))
|
||||
&& for_clobber))
|
||||
{
|
||||
/* Every bare SMT def we add should have SMT_USED_ALONE
|
||||
set on it, or else we will get the wrong answer on
|
||||
clobbers. */
|
||||
if (none_added
|
||||
&& !updating_used_alone && gimple_aliases_computed_p (cfun)
|
||||
&& TREE_CODE (var) == SYMBOL_MEMORY_TAG)
|
||||
gcc_assert (SMT_USED_ALONE (var));
|
||||
|
||||
append_v_may_def (var);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4810,7 +4810,7 @@ struct tree_opt_pass pass_vrp =
|
|||
TV_TREE_VRP, /* tv_id */
|
||||
PROP_ssa | PROP_alias, /* properties_required */
|
||||
0, /* properties_provided */
|
||||
PROP_smt_usage, /* properties_destroyed */
|
||||
0, /* properties_destroyed */
|
||||
0, /* todo_flags_start */
|
||||
TODO_cleanup_cfg
|
||||
| TODO_ggc_collect
|
||||
|
|
12
gcc/tree.h
12
gcc/tree.h
|
@ -2407,22 +2407,10 @@ struct tree_memory_tag GTY(())
|
|||
{
|
||||
struct tree_decl_minimal common;
|
||||
unsigned int is_global:1;
|
||||
unsigned int is_used_alone:1;
|
||||
unsigned int old_used_alone:1;
|
||||
};
|
||||
|
||||
#define MTAG_GLOBAL(NODE) (TREE_MEMORY_TAG_CHECK (NODE)->mtag.is_global)
|
||||
|
||||
/* This flag is true if a SMT is used as the V_MAY_DEF or VUSE operand
|
||||
directly, because the access had all of the SMT's aliases pruned
|
||||
from it. */
|
||||
#define SMT_USED_ALONE(NODE) (SYMBOL_MEMORY_TAG_CHECK (NODE)->mtag.is_used_alone)
|
||||
|
||||
/* This flag is used to temporarily store the old value of the used alone
|
||||
flag when updating so we know whether to mark the symbol for
|
||||
renaming. */
|
||||
#define SMT_OLD_USED_ALONE(NODE) (SYMBOL_MEMORY_TAG_CHECK (NODE)->mtag.old_used_alone)
|
||||
|
||||
struct tree_struct_field_tag GTY(())
|
||||
{
|
||||
struct tree_memory_tag common;
|
||||
|
|
Loading…
Reference in New Issue