Commit caf55296 by Richard Guenther Committed by Richard Biener

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
parent d27cc24c
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> 2008-07-14 Martin Jambor <mjambor@suse.cz>
* tree-switch-conversion.c (gen_inbound_check): Make sure the type * tree-switch-conversion.c (gen_inbound_check): Make sure the type
......
...@@ -1659,34 +1659,6 @@ set_symbol_mem_tag (tree sym, tree tag) ...@@ -1659,34 +1659,6 @@ set_symbol_mem_tag (tree sym, tree tag)
get_var_ann (sym)->symbol_mem_tag = 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. */ /* Accessor to tree-ssa-operands.c caches. */
static inline struct ssa_operands * static inline struct ssa_operands *
gimple_ssa_operands (const struct function *fun) gimple_ssa_operands (const struct function *fun)
......
...@@ -1134,7 +1134,6 @@ void print_value_expressions (FILE *, unsigned int); ...@@ -1134,7 +1134,6 @@ void print_value_expressions (FILE *, unsigned int);
tree make_value_handle (tree); tree make_value_handle (tree);
void set_value_handle (tree, tree); void set_value_handle (tree, tree);
bool expressions_equal_p (tree, tree); bool expressions_equal_p (tree, tree);
static inline tree get_value_handle (tree);
void sort_vuses (VEC (tree, gc) *); void sort_vuses (VEC (tree, gc) *);
void sort_vuses_heap (VEC (tree, heap) *); void sort_vuses_heap (VEC (tree, heap) *);
tree vn_lookup_or_add (tree); tree vn_lookup_or_add (tree);
......
...@@ -310,13 +310,10 @@ get_symbol_constant_value (tree sym) ...@@ -310,13 +310,10 @@ get_symbol_constant_value (tree sym)
change the constant value of the PHI node, which allows for more change the constant value of the PHI node, which allows for more
constants to be propagated. constants to be propagated.
3- If SSA_NAME_VALUE is set and it is a constant, its value is 3- Variables defined by statements other than assignments and PHI
used.
4- Variables defined by statements other than assignments and PHI
nodes are considered VARYING. 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. */ considered VARYING. */
static prop_value_t static prop_value_t
...@@ -332,12 +329,6 @@ get_default_value (tree var) ...@@ -332,12 +329,6 @@ get_default_value (tree var)
non-register when DO_STORE_CCP is false. */ non-register when DO_STORE_CCP is false. */
val.lattice_val = VARYING; 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) else if ((cst_val = get_symbol_constant_value (sym)) != NULL_TREE)
{ {
/* Globals and static variables declared 'const' take their /* Globals and static variables declared 'const' take their
......
...@@ -129,11 +129,6 @@ static vn_tables_t valid_info; ...@@ -129,11 +129,6 @@ static vn_tables_t valid_info;
static vn_tables_t optimistic_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. /* Pointer to the set of hashtables that is currently being used.
Should always point to either the optimistic_info, or the Should always point to either the optimistic_info, or the
valid_info. */ valid_info. */
...@@ -2376,15 +2371,6 @@ init_scc_vn (void) ...@@ -2376,15 +2371,6 @@ init_scc_vn (void)
allocate_vn_table (valid_info); allocate_vn_table (valid_info);
optimistic_info = XCNEW (struct vn_tables_s); optimistic_info = XCNEW (struct vn_tables_s);
allocate_vn_table (optimistic_info); 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 void
...@@ -2403,9 +2389,6 @@ free_scc_vn (void) ...@@ -2403,9 +2389,6 @@ free_scc_vn (void)
{ {
tree name = ssa_name (i); tree name = ssa_name (i);
if (name if (name
&& SSA_NAME_VALUE (name))
SSA_NAME_VALUE (name) = NULL;
if (name
&& VN_INFO (name)->needs_insertion) && VN_INFO (name)->needs_insertion)
release_ssa_name (name); release_ssa_name (name);
} }
...@@ -2417,14 +2400,9 @@ free_scc_vn (void) ...@@ -2417,14 +2400,9 @@ free_scc_vn (void)
XDELETE (valid_info); XDELETE (valid_info);
free_vn_table (optimistic_info); free_vn_table (optimistic_info);
XDELETE (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 static void
set_hashtable_value_ids (void) set_hashtable_value_ids (void)
...@@ -2449,18 +2427,6 @@ set_hashtable_value_ids (void) ...@@ -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, FOR_EACH_HTAB_ELEMENT (valid_info->phis,
vp, vn_phi_t, hi) vp, vn_phi_t, hi)
{ {
...@@ -2472,18 +2438,6 @@ set_hashtable_value_ids (void) ...@@ -2472,18 +2438,6 @@ set_hashtable_value_ids (void)
vp->value_id = get_or_alloc_constant_value_id (vp->result); 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, FOR_EACH_HTAB_ELEMENT (valid_info->references,
vr, vn_reference_t, hi) vr, vn_reference_t, hi)
...@@ -2496,17 +2450,6 @@ set_hashtable_value_ids (void) ...@@ -2496,17 +2450,6 @@ set_hashtable_value_ids (void)
vr->value_id = get_or_alloc_constant_value_id (vr->result); 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 /* Do SCCVN. Returns true if it finished, false if we bailed out
...@@ -2577,7 +2520,6 @@ run_scc_vn (bool may_insert_arg) ...@@ -2577,7 +2520,6 @@ run_scc_vn (bool may_insert_arg)
info = VN_INFO (name); info = VN_INFO (name);
if (TREE_CODE (info->valnum) == SSA_NAME if (TREE_CODE (info->valnum) == SSA_NAME
&& info->valnum != name && info->valnum != name
&& TREE_CODE (info->valnum) == SSA_NAME
&& info->value_id != VN_INFO (info->valnum)->value_id) && info->value_id != VN_INFO (info->valnum)->value_id)
{ {
changed = true; changed = true;
...@@ -2594,15 +2536,12 @@ run_scc_vn (bool may_insert_arg) ...@@ -2594,15 +2536,12 @@ run_scc_vn (bool may_insert_arg)
for (i = 0; i < num_ssa_names; i++) for (i = 0; i < num_ssa_names; i++)
{ {
tree name = ssa_name (i); tree name = ssa_name (i);
if (name && VN_INFO (name)->visited if (name
&& (SSA_VAL (name) != name && VN_INFO (name)->visited
|| is_gimple_min_invariant (VN_INFO (name)->expr))) && SSA_VAL (name) != name)
{ {
print_generic_expr (dump_file, name, 0); print_generic_expr (dump_file, name, 0);
fprintf (dump_file, " = "); 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"); fprintf (dump_file, "\n");
} }
......
...@@ -140,7 +140,6 @@ extern vn_ssa_aux_t VN_INFO (tree); ...@@ -140,7 +140,6 @@ extern vn_ssa_aux_t VN_INFO (tree);
extern vn_ssa_aux_t VN_INFO_GET (tree); extern vn_ssa_aux_t VN_INFO_GET (tree);
bool run_scc_vn (bool); bool run_scc_vn (bool);
void free_scc_vn (void); 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 (tree, vn_nary_op_t *);
tree vn_nary_op_lookup_pieces (unsigned int, enum tree_code, tree vn_nary_op_lookup_pieces (unsigned int, enum tree_code,
tree, tree, tree, tree, tree, tree, tree, tree, tree, tree,
......
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