summaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-forwprop.c
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2009-04-17 18:16:51 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2009-04-17 18:16:51 +0000
commit7c3e9dc3ec5530773206a7a9c673f437d9ca0054 (patch)
treeb1efe2b33b558bac034ca5ab5c1f4a74c8905f39 /gcc/tree-ssa-forwprop.c
parentaca600aaf96fc061671829703b50ec8c6acae2c0 (diff)
downloadgcc-7c3e9dc3ec5530773206a7a9c673f437d9ca0054.tar.gz
tree-ssa-forwprop.c (get_prop_dest_stmt): Clean up tuplification.
2009-04-17 Richard Guenther <rguenther@suse.de> * tree-ssa-forwprop.c (get_prop_dest_stmt): Clean up tuplification. (get_prop_source_stmt): Likewise. (can_propagate_from): Likewise. From-SVN: r146281
Diffstat (limited to 'gcc/tree-ssa-forwprop.c')
-rw-r--r--gcc/tree-ssa-forwprop.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/gcc/tree-ssa-forwprop.c b/gcc/tree-ssa-forwprop.c
index f75e0afa73f..c596e8b7541 100644
--- a/gcc/tree-ssa-forwprop.c
+++ b/gcc/tree-ssa-forwprop.c
@@ -186,8 +186,7 @@ get_prop_dest_stmt (tree name, tree *final_name_p)
return NULL;
/* If this is not a trivial copy, we found it. */
- if (!gimple_assign_copy_p (use_stmt)
- || TREE_CODE (gimple_assign_lhs (use_stmt)) != SSA_NAME
+ if (!gimple_assign_ssa_name_copy_p (use_stmt)
|| gimple_assign_rhs1 (use_stmt) != name)
break;
@@ -225,12 +224,11 @@ get_prop_source_stmt (tree name, bool single_use_only, bool *single_use_p)
}
/* If name is defined by a PHI node or is the default def, bail out. */
- if (gimple_code (def_stmt) != GIMPLE_ASSIGN)
+ if (!is_gimple_assign (def_stmt))
return NULL;
- /* If name is not a simple copy destination, we found it. */
- if (!gimple_assign_copy_p (def_stmt)
- || TREE_CODE (gimple_assign_rhs1 (def_stmt)) != SSA_NAME)
+ /* If def_stmt is not a simple copy, we possibly found it. */
+ if (!gimple_assign_ssa_name_copy_p (def_stmt))
{
tree rhs;
@@ -266,6 +264,7 @@ can_propagate_from (gimple def_stmt)
ssa_op_iter iter;
gcc_assert (is_gimple_assign (def_stmt));
+
/* If the rhs has side-effects we cannot propagate from it. */
if (gimple_has_volatile_ops (def_stmt))
return false;
@@ -276,8 +275,8 @@ can_propagate_from (gimple def_stmt)
return false;
/* Constants can be always propagated. */
- if (is_gimple_min_invariant
- (rhs_to_tree (TREE_TYPE (gimple_assign_lhs (def_stmt)), def_stmt)))
+ if (gimple_assign_single_p (def_stmt)
+ && is_gimple_min_invariant (gimple_assign_rhs1 (def_stmt)))
return true;
/* We cannot propagate ssa names that occur in abnormal phi nodes. */
@@ -289,14 +288,14 @@ can_propagate_from (gimple def_stmt)
then we can not apply optimizations as some targets require
function pointers to be canonicalized and in this case this
optimization could eliminate a necessary canonicalization. */
- if (is_gimple_assign (def_stmt)
- && (CONVERT_EXPR_CODE_P (gimple_assign_rhs_code (def_stmt))))
+ if (CONVERT_EXPR_CODE_P (gimple_assign_rhs_code (def_stmt)))
{
tree rhs = gimple_assign_rhs1 (def_stmt);
if (POINTER_TYPE_P (TREE_TYPE (rhs))
&& TREE_CODE (TREE_TYPE (TREE_TYPE (rhs))) == FUNCTION_TYPE)
return false;
}
+
return true;
}