diff options
author | Richard Guenther <rguenther@suse.de> | 2009-04-17 12:43:02 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2009-04-17 12:43:02 +0000 |
commit | 7e673273293d34110b16bdf56b90192b3382bad9 (patch) | |
tree | 4e1243fcafbe74f6c2f33ad441126888a2896ae8 /gcc | |
parent | 01cd0938b55019565dd76224d0b20edfbd496cc6 (diff) | |
download | gcc-7e673273293d34110b16bdf56b90192b3382bad9.zip gcc-7e673273293d34110b16bdf56b90192b3382bad9.tar.gz gcc-7e673273293d34110b16bdf56b90192b3382bad9.tar.bz2 |
tree-ssa-dom.c (gimple_assign_unary_useless_conversion_p): Remove.
2009-04-17 Richard Guenther <rguenther@suse.de>
* tree-ssa-dom.c (gimple_assign_unary_useless_conversion_p): Remove.
(record_equivalences_from_stmt): Remove useless checks and
simplifications.
* tree-ssa-pre.c (eliminate): Avoid converting a constant if
the type is already suitable.
From-SVN: r146260
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/tree-ssa-dom.c | 26 | ||||
-rw-r--r-- | gcc/tree-ssa-pre.c | 6 |
3 files changed, 13 insertions, 27 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 5aad48d..3aaa681 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2009-04-17 Richard Guenther <rguenther@suse.de> + + * tree-ssa-dom.c (gimple_assign_unary_useless_conversion_p): Remove. + (record_equivalences_from_stmt): Remove useless checks and + simplifications. + * tree-ssa-pre.c (eliminate): Avoid converting a constant if + the type is already suitable. + 2009-04-17 Paolo Bonzini <bonzini@gnu.org> * config/sh/sh.h (FUNCTION_VALUE): Fix call to sh_promote_prototypes. diff --git a/gcc/tree-ssa-dom.c b/gcc/tree-ssa-dom.c index e2909e8..1a851fa 100644 --- a/gcc/tree-ssa-dom.c +++ b/gcc/tree-ssa-dom.c @@ -1915,26 +1915,6 @@ eliminate_redundant_computations (gimple_stmt_iterator* gsi) return retval; } -/* Return true if statement GS is an assignment that peforms a useless - type conversion. It is is intended to be a tuples analog of function - tree_ssa_useless_type_conversion. */ - -static bool -gimple_assign_unary_useless_conversion_p (gimple gs) -{ - if (is_gimple_assign (gs) - && (CONVERT_EXPR_CODE_P (gimple_assign_rhs_code (gs)) - || gimple_assign_rhs_code (gs) == VIEW_CONVERT_EXPR - || gimple_assign_rhs_code (gs) == NON_LVALUE_EXPR)) - { - tree lhs_type = TREE_TYPE (gimple_assign_lhs (gs)); - tree rhs_type = TREE_TYPE (gimple_assign_rhs1 (gs)); - return useless_type_conversion_p (lhs_type, rhs_type); - } - - return false; -} - /* STMT, a GIMPLE_ASSIGN, may create certain equivalences, in either the available expressions table or the const_and_copies table. Detect and record those equivalences. */ @@ -1953,14 +1933,10 @@ record_equivalences_from_stmt (gimple stmt, int may_optimize_p) lhs_code = TREE_CODE (lhs); if (lhs_code == SSA_NAME - && (gimple_assign_single_p (stmt) - || gimple_assign_unary_useless_conversion_p (stmt))) + && gimple_assign_single_p (stmt)) { tree rhs = gimple_assign_rhs1 (stmt); - /* Strip away any useless type conversions. */ - STRIP_USELESS_TYPE_CONVERSION (rhs); - /* If the RHS of the assignment is a constant or another variable that may be propagated, register it in the CONST_AND_COPIES table. We do not need to record unwind data for this, since this is a true diff --git a/gcc/tree-ssa-pre.c b/gcc/tree-ssa-pre.c index 1119f07..61207b2 100644 --- a/gcc/tree-ssa-pre.c +++ b/gcc/tree-ssa-pre.c @@ -3981,8 +3981,10 @@ eliminate (void) value is constant, use that constant. */ if (!sprime && is_gimple_min_invariant (VN_INFO (lhs)->valnum)) { - sprime = fold_convert (TREE_TYPE (lhs), - VN_INFO (lhs)->valnum); + sprime = VN_INFO (lhs)->valnum; + if (!useless_type_conversion_p (TREE_TYPE (lhs), + TREE_TYPE (sprime))) + sprime = fold_convert (TREE_TYPE (lhs), sprime); if (dump_file && (dump_flags & TDF_DETAILS)) { |