tree-ssa-sccvn.c (pre_info): Remove.

2008-07-14  Richard Guenther  <rguenther@suse.de>

	* tree-ssa-sccvn.c (pre_info): Remove.
	(switch_to_PRE_table): Likewise.
	(free_scc_vn): Do not clear SSA_NAME_VALUE.
	Do not free pre_info.
	(set_hashtable_value_ids): Do not create value-ids for the
	optimistic tables.
	(run_scc_vn): Remove double test.  Remove bogus special-case
	in value-number printing.
	* tree-ssa-sccvn.h (switch_to_PRE_table): Remove.
	* tree-ssa-ccp.c (get_symbol_constant_value): Do not look at
	SSA_NAME_VALUE.
	* tree-flow-inline.h (get_value_handle): Remove.
	* tree-flow.h (get_value_handle): Remove.

From-SVN: r137787
This commit is contained in:
Richard Guenther 2008-07-14 15:38:49 +00:00 committed by Richard Biener
parent d27cc24c97
commit caf55296b9
6 changed files with 24 additions and 108 deletions

View File

@ -1,3 +1,19 @@
2008-07-14 Richard Guenther <rguenther@suse.de>
* tree-ssa-sccvn.c (pre_info): Remove.
(switch_to_PRE_table): Likewise.
(free_scc_vn): Do not clear SSA_NAME_VALUE.
Do not free pre_info.
(set_hashtable_value_ids): Do not create value-ids for the
optimistic tables.
(run_scc_vn): Remove double test. Remove bogus special-case
in value-number printing.
* tree-ssa-sccvn.h (switch_to_PRE_table): Remove.
* tree-ssa-ccp.c (get_symbol_constant_value): Do not look at
SSA_NAME_VALUE.
* tree-flow-inline.h (get_value_handle): Remove.
* tree-flow.h (get_value_handle): Remove.
2008-07-14 Martin Jambor <mjambor@suse.cz>
* tree-switch-conversion.c (gen_inbound_check): Make sure the type

View File

@ -1659,34 +1659,6 @@ set_symbol_mem_tag (tree sym, tree tag)
get_var_ann (sym)->symbol_mem_tag = tag;
}
/* Get the value handle of EXPR. This is the only correct way to get
the value handle for a "thing". If EXPR does not have a value
handle associated, it returns NULL_TREE.
NB: If EXPR is min_invariant, this function is *required* to return
EXPR. */
static inline tree
get_value_handle (tree expr)
{
if (TREE_CODE (expr) == SSA_NAME)
return SSA_NAME_VALUE (expr);
else if (DECL_P (expr) || TREE_CODE (expr) == TREE_LIST
|| TREE_CODE (expr) == CONSTRUCTOR)
{
tree_ann_common_t ann = tree_common_ann (expr);
return ((ann) ? ann->value_handle : NULL_TREE);
}
else if (is_gimple_min_invariant (expr))
return expr;
else if (EXPR_P (expr))
{
tree_ann_common_t ann = tree_common_ann (expr);
return ((ann) ? ann->value_handle : NULL_TREE);
}
else
gcc_unreachable ();
}
/* Accessor to tree-ssa-operands.c caches. */
static inline struct ssa_operands *
gimple_ssa_operands (const struct function *fun)

View File

@ -1134,7 +1134,6 @@ void print_value_expressions (FILE *, unsigned int);
tree make_value_handle (tree);
void set_value_handle (tree, tree);
bool expressions_equal_p (tree, tree);
static inline tree get_value_handle (tree);
void sort_vuses (VEC (tree, gc) *);
void sort_vuses_heap (VEC (tree, heap) *);
tree vn_lookup_or_add (tree);

View File

@ -310,13 +310,10 @@ get_symbol_constant_value (tree sym)
change the constant value of the PHI node, which allows for more
constants to be propagated.
3- If SSA_NAME_VALUE is set and it is a constant, its value is
used.
4- Variables defined by statements other than assignments and PHI
3- Variables defined by statements other than assignments and PHI
nodes are considered VARYING.
5- Initial values of variables that are not GIMPLE registers are
4- Initial values of variables that are not GIMPLE registers are
considered VARYING. */
static prop_value_t
@ -332,12 +329,6 @@ get_default_value (tree var)
non-register when DO_STORE_CCP is false. */
val.lattice_val = VARYING;
}
else if (SSA_NAME_VALUE (var)
&& is_gimple_min_invariant (SSA_NAME_VALUE (var)))
{
val.lattice_val = CONSTANT;
val.value = SSA_NAME_VALUE (var);
}
else if ((cst_val = get_symbol_constant_value (sym)) != NULL_TREE)
{
/* Globals and static variables declared 'const' take their

View File

@ -129,11 +129,6 @@ static vn_tables_t valid_info;
static vn_tables_t optimistic_info;
/* PRE hashtables storing information about mapping from expressions to
value handles. */
static vn_tables_t pre_info;
/* Pointer to the set of hashtables that is currently being used.
Should always point to either the optimistic_info, or the
valid_info. */
@ -2376,15 +2371,6 @@ init_scc_vn (void)
allocate_vn_table (valid_info);
optimistic_info = XCNEW (struct vn_tables_s);
allocate_vn_table (optimistic_info);
pre_info = NULL;
}
void
switch_to_PRE_table (void)
{
pre_info = XCNEW (struct vn_tables_s);
allocate_vn_table (pre_info);
current_info = pre_info;
}
void
@ -2402,9 +2388,6 @@ free_scc_vn (void)
for (i = 0; i < num_ssa_names; i++)
{
tree name = ssa_name (i);
if (name
&& SSA_NAME_VALUE (name))
SSA_NAME_VALUE (name) = NULL;
if (name
&& VN_INFO (name)->needs_insertion)
release_ssa_name (name);
@ -2417,14 +2400,9 @@ free_scc_vn (void)
XDELETE (valid_info);
free_vn_table (optimistic_info);
XDELETE (optimistic_info);
if (pre_info)
{
free_vn_table (pre_info);
XDELETE (pre_info);
}
}
/* Set the value ids in the valid/optimistic hash tables. */
/* Set the value ids in the valid hash tables. */
static void
set_hashtable_value_ids (void)
@ -2433,7 +2411,7 @@ set_hashtable_value_ids (void)
vn_nary_op_t vno;
vn_reference_t vr;
vn_phi_t vp;
/* Now set the value ids of the things we had put in the hash
table. */
@ -2449,18 +2427,6 @@ set_hashtable_value_ids (void)
}
}
FOR_EACH_HTAB_ELEMENT (optimistic_info->nary,
vno, vn_nary_op_t, hi)
{
if (vno->result)
{
if (TREE_CODE (vno->result) == SSA_NAME)
vno->value_id = VN_INFO (vno->result)->value_id;
else if (is_gimple_min_invariant (vno->result))
vno->value_id = get_or_alloc_constant_value_id (vno->result);
}
}
FOR_EACH_HTAB_ELEMENT (valid_info->phis,
vp, vn_phi_t, hi)
{
@ -2472,18 +2438,6 @@ set_hashtable_value_ids (void)
vp->value_id = get_or_alloc_constant_value_id (vp->result);
}
}
FOR_EACH_HTAB_ELEMENT (optimistic_info->phis,
vp, vn_phi_t, hi)
{
if (vp->result)
{
if (TREE_CODE (vp->result) == SSA_NAME)
vp->value_id = VN_INFO (vp->result)->value_id;
else if (is_gimple_min_invariant (vp->result))
vp->value_id = get_or_alloc_constant_value_id (vp->result);
}
}
FOR_EACH_HTAB_ELEMENT (valid_info->references,
vr, vn_reference_t, hi)
@ -2496,17 +2450,6 @@ set_hashtable_value_ids (void)
vr->value_id = get_or_alloc_constant_value_id (vr->result);
}
}
FOR_EACH_HTAB_ELEMENT (optimistic_info->references,
vr, vn_reference_t, hi)
{
if (vr->result)
{
if (TREE_CODE (vr->result) == SSA_NAME)
vr->value_id = VN_INFO (vr->result)->value_id;
else if (is_gimple_min_invariant (vr->result))
vr->value_id = get_or_alloc_constant_value_id (vr->result);
}
}
}
/* Do SCCVN. Returns true if it finished, false if we bailed out
@ -2577,7 +2520,6 @@ run_scc_vn (bool may_insert_arg)
info = VN_INFO (name);
if (TREE_CODE (info->valnum) == SSA_NAME
&& info->valnum != name
&& TREE_CODE (info->valnum) == SSA_NAME
&& info->value_id != VN_INFO (info->valnum)->value_id)
{
changed = true;
@ -2594,16 +2536,13 @@ run_scc_vn (bool may_insert_arg)
for (i = 0; i < num_ssa_names; i++)
{
tree name = ssa_name (i);
if (name && VN_INFO (name)->visited
&& (SSA_VAL (name) != name
|| is_gimple_min_invariant (VN_INFO (name)->expr)))
if (name
&& VN_INFO (name)->visited
&& SSA_VAL (name) != name)
{
print_generic_expr (dump_file, name, 0);
fprintf (dump_file, " = ");
if (is_gimple_min_invariant (VN_INFO (name)->expr))
print_generic_expr (dump_file, VN_INFO (name)->expr, 0);
else
print_generic_expr (dump_file, SSA_VAL (name), 0);
print_generic_expr (dump_file, SSA_VAL (name), 0);
fprintf (dump_file, "\n");
}
}

View File

@ -140,7 +140,6 @@ extern vn_ssa_aux_t VN_INFO (tree);
extern vn_ssa_aux_t VN_INFO_GET (tree);
bool run_scc_vn (bool);
void free_scc_vn (void);
void switch_to_PRE_table (void);
tree vn_nary_op_lookup (tree, vn_nary_op_t *);
tree vn_nary_op_lookup_pieces (unsigned int, enum tree_code,
tree, tree, tree, tree, tree,