Commit 7c3e9dc3 by Richard Guenther Committed by Richard Biener

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
parent aca600aa
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.
2009-04-17 Andrew Stubbs <ams@codesourcery.com> 2009-04-17 Andrew Stubbs <ams@codesourcery.com>
* configure.ac: Add new AC_SUBST for TM_ENDIAN_CONFIG, * configure.ac: Add new AC_SUBST for TM_ENDIAN_CONFIG,
......
...@@ -186,8 +186,7 @@ get_prop_dest_stmt (tree name, tree *final_name_p) ...@@ -186,8 +186,7 @@ get_prop_dest_stmt (tree name, tree *final_name_p)
return NULL; return NULL;
/* If this is not a trivial copy, we found it. */ /* If this is not a trivial copy, we found it. */
if (!gimple_assign_copy_p (use_stmt) if (!gimple_assign_ssa_name_copy_p (use_stmt)
|| TREE_CODE (gimple_assign_lhs (use_stmt)) != SSA_NAME
|| gimple_assign_rhs1 (use_stmt) != name) || gimple_assign_rhs1 (use_stmt) != name)
break; break;
...@@ -225,12 +224,11 @@ get_prop_source_stmt (tree name, bool single_use_only, bool *single_use_p) ...@@ -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 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; return NULL;
/* If name is not a simple copy destination, we found it. */ /* If def_stmt is not a simple copy, we possibly found it. */
if (!gimple_assign_copy_p (def_stmt) if (!gimple_assign_ssa_name_copy_p (def_stmt))
|| TREE_CODE (gimple_assign_rhs1 (def_stmt)) != SSA_NAME)
{ {
tree rhs; tree rhs;
...@@ -266,6 +264,7 @@ can_propagate_from (gimple def_stmt) ...@@ -266,6 +264,7 @@ can_propagate_from (gimple def_stmt)
ssa_op_iter iter; ssa_op_iter iter;
gcc_assert (is_gimple_assign (def_stmt)); gcc_assert (is_gimple_assign (def_stmt));
/* If the rhs has side-effects we cannot propagate from it. */ /* If the rhs has side-effects we cannot propagate from it. */
if (gimple_has_volatile_ops (def_stmt)) if (gimple_has_volatile_ops (def_stmt))
return false; return false;
...@@ -276,8 +275,8 @@ can_propagate_from (gimple def_stmt) ...@@ -276,8 +275,8 @@ can_propagate_from (gimple def_stmt)
return false; return false;
/* Constants can be always propagated. */ /* Constants can be always propagated. */
if (is_gimple_min_invariant if (gimple_assign_single_p (def_stmt)
(rhs_to_tree (TREE_TYPE (gimple_assign_lhs (def_stmt)), def_stmt))) && is_gimple_min_invariant (gimple_assign_rhs1 (def_stmt)))
return true; return true;
/* We cannot propagate ssa names that occur in abnormal phi nodes. */ /* We cannot propagate ssa names that occur in abnormal phi nodes. */
...@@ -289,14 +288,14 @@ can_propagate_from (gimple def_stmt) ...@@ -289,14 +288,14 @@ can_propagate_from (gimple def_stmt)
then we can not apply optimizations as some targets require then we can not apply optimizations as some targets require
function pointers to be canonicalized and in this case this function pointers to be canonicalized and in this case this
optimization could eliminate a necessary canonicalization. */ optimization could eliminate a necessary canonicalization. */
if (is_gimple_assign (def_stmt) if (CONVERT_EXPR_CODE_P (gimple_assign_rhs_code (def_stmt)))
&& (CONVERT_EXPR_CODE_P (gimple_assign_rhs_code (def_stmt))))
{ {
tree rhs = gimple_assign_rhs1 (def_stmt); tree rhs = gimple_assign_rhs1 (def_stmt);
if (POINTER_TYPE_P (TREE_TYPE (rhs)) if (POINTER_TYPE_P (TREE_TYPE (rhs))
&& TREE_CODE (TREE_TYPE (TREE_TYPE (rhs))) == FUNCTION_TYPE) && TREE_CODE (TREE_TYPE (TREE_TYPE (rhs))) == FUNCTION_TYPE)
return false; return false;
} }
return true; return true;
} }
......
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