diff options
author | Richard Guenther <rguenther@suse.de> | 2010-08-10 09:13:37 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2010-08-10 09:13:37 +0000 |
commit | a024390f71187444954cc0001bdea390fb31551f (patch) | |
tree | 013c16e35d556e45198777483ba6a98a958d5edc /gcc | |
parent | 0a5c2065bd4c06217c2035e1103d2f73a124285e (diff) | |
download | gcc-a024390f71187444954cc0001bdea390fb31551f.zip gcc-a024390f71187444954cc0001bdea390fb31551f.tar.gz gcc-a024390f71187444954cc0001bdea390fb31551f.tar.bz2 |
tree-ssa-copy.c (set_copy_of_val): Use operand_equal_p.
2010-08-10 Richard Guenther <rguenther@suse.de>
* tree-ssa-copy.c (set_copy_of_val): Use operand_equal_p.
(copy_prop_visit_assignment): Simplify.
(copy_prop_visit_stmt): Also visit assignments from
constants.
(copy_prop_visit_phi_node): Use operand_equal_p.
From-SVN: r163050
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/tree-ssa-copy.c | 24 |
2 files changed, 16 insertions, 16 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index e86fac8..5b066a6 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2010-08-10 Richard Guenther <rguenther@suse.de> + + * tree-ssa-copy.c (set_copy_of_val): Use operand_equal_p. + (copy_prop_visit_assignment): Simplify. + (copy_prop_visit_stmt): Also visit assignments from + constants. + (copy_prop_visit_phi_node): Use operand_equal_p. + 2010-08-09 Nathan Froyd <froydnj@codesourcery.com> * ipa-split.c (find_split_points): Free stack. diff --git a/gcc/tree-ssa-copy.c b/gcc/tree-ssa-copy.c index e148b8d..c82943c 100644 --- a/gcc/tree-ssa-copy.c +++ b/gcc/tree-ssa-copy.c @@ -366,7 +366,8 @@ set_copy_of_val (tree var, tree val) old = copy_of[ver].value; copy_of[ver].value = val; - if (old != val) + if (old != val + || (val && !operand_equal_p (old, val, 0))) return true; return false; @@ -409,14 +410,9 @@ static enum ssa_prop_result copy_prop_visit_assignment (gimple stmt, tree *result_p) { tree lhs, rhs; - prop_value_t *rhs_val; lhs = gimple_assign_lhs (stmt); - rhs = gimple_assign_rhs1 (stmt); - - gcc_assert (gimple_assign_rhs_code (stmt) == SSA_NAME); - - rhs_val = get_copy_of_val (rhs); + rhs = valueize_val (gimple_assign_rhs1 (stmt)); if (TREE_CODE (lhs) == SSA_NAME) { @@ -425,14 +421,8 @@ copy_prop_visit_assignment (gimple stmt, tree *result_p) if (!may_propagate_copy (lhs, rhs)) return SSA_PROP_VARYING; - /* Notice that in the case of assignments, we make the LHS be a - copy of RHS's value, not of RHS itself. This avoids keeping - unnecessary copy-of chains (assignments cannot be in a cycle - like PHI nodes), speeding up the propagation process. - This is different from what we do in copy_prop_visit_phi_node. - In those cases, we are interested in the copy-of chains. */ *result_p = lhs; - if (set_copy_of_val (*result_p, rhs_val->value)) + if (set_copy_of_val (*result_p, rhs)) return SSA_PROP_INTERESTING; else return SSA_PROP_NOT_INTERESTING; @@ -518,7 +508,8 @@ copy_prop_visit_stmt (gimple stmt, edge *taken_edge_p, tree *result_p) if (gimple_assign_single_p (stmt) && TREE_CODE (gimple_assign_lhs (stmt)) == SSA_NAME - && TREE_CODE (gimple_assign_rhs1 (stmt)) == SSA_NAME) + && (TREE_CODE (gimple_assign_rhs1 (stmt)) == SSA_NAME + || is_gimple_min_invariant (gimple_assign_rhs1 (stmt)))) { /* If the statement is a copy assignment, evaluate its RHS to see if the lattice value of its output has changed. */ @@ -631,7 +622,8 @@ copy_prop_visit_phi_node (gimple phi) /* If PHI_VAL and ARG don't have a common copy-of chain, then this PHI node cannot be a copy operation. */ - if (phi_val.value != arg_val->value) + if (phi_val.value != arg_val->value + && !operand_equal_p (phi_val.value, arg_val->value, 0)) { phi_val.value = lhs; break; |