From: Richard Guenther Date: Fri, 17 Apr 2009 18:16:51 +0000 (+0000) Subject: tree-ssa-forwprop.c (get_prop_dest_stmt): Clean up tuplification. X-Git-Tag: releases/gcc-4.5.0~6458 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7c3e9dc3ec5530773206a7a9c673f437d9ca0054;p=thirdparty%2Fgcc.git tree-ssa-forwprop.c (get_prop_dest_stmt): Clean up tuplification. 2009-04-17 Richard Guenther * tree-ssa-forwprop.c (get_prop_dest_stmt): Clean up tuplification. (get_prop_source_stmt): Likewise. (can_propagate_from): Likewise. From-SVN: r146281 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 69aaa37fca67..c3c34e986adc 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2009-04-17 Richard Guenther + + * 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 * configure.ac: Add new AC_SUBST for TM_ENDIAN_CONFIG, diff --git a/gcc/tree-ssa-forwprop.c b/gcc/tree-ssa-forwprop.c index f75e0afa73ff..c596e8b75414 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; }