Commit 36618b93 by Richard Guenther Committed by Richard Biener

tree-flow.h (tree_ssa_useless_type_conversion_1): Rename to ...

2007-07-02  Richard Guenther  <rguenther@suse.de>

	* tree-flow.h (tree_ssa_useless_type_conversion_1): Rename to ...
	(useless_type_conversion_p): ... this.
	* tree-ssa.c (tree_ssa_useless_type_conversion_1): Rename to ...
	(useless_type_conversion_p): ... this.
	* builtins.c (fold_builtin_memory_op): Rename
	tree_ssa_useless_type_conversion_1 to useless_type_conversion_p.
	* tree-cfg.c (verify_expr): Likewise.
	* tree-ssa-address.c (tree_ssa_useless_type_conversion_1): Likewise.
	* tree-ssa-ccp.c (ccp_fold): Likewise.
	* tree-ssa-copy.c (may_propagate_copy): Likewise.
	* tree-ssa-dom.c (eliminate_redundant_computations): Likewise.
	* tree-ssa-forwprop.c (forward_propagate_addr_expr_1): Likewise.
	* tree-ssa-loop-niter.c (refine_bounds_using_guard): Likewise.
	* tree-ssa-pre.c (eliminate): Likewise.
	* tree-ssa.c (delete_tree_ssa): Likewise.
	(tree_ssa_useless_type_conversion): Likewise.
	* tree.c (build2_stat): Likewise.

From-SVN: r126194
parent 1c00b503
2007-07-02 Richard Guenther <rguenther@suse.de>
* tree-flow.h (tree_ssa_useless_type_conversion_1): Rename to ...
(useless_type_conversion_p): ... this.
* tree-ssa.c (tree_ssa_useless_type_conversion_1): Rename to ...
(useless_type_conversion_p): ... this.
* builtins.c (fold_builtin_memory_op): Rename
tree_ssa_useless_type_conversion_1 to useless_type_conversion_p.
* tree-cfg.c (verify_expr): Likewise.
* tree-ssa-address.c (tree_ssa_useless_type_conversion_1): Likewise.
* tree-ssa-ccp.c (ccp_fold): Likewise.
* tree-ssa-copy.c (may_propagate_copy): Likewise.
* tree-ssa-dom.c (eliminate_redundant_computations): Likewise.
* tree-ssa-forwprop.c (forward_propagate_addr_expr_1): Likewise.
* tree-ssa-loop-niter.c (refine_bounds_using_guard): Likewise.
* tree-ssa-pre.c (eliminate): Likewise.
* tree-ssa.c (delete_tree_ssa): Likewise.
(tree_ssa_useless_type_conversion): Likewise.
* tree.c (build2_stat): Likewise.
2007-07-01 Daniel Berlin <dberlin@dberlin.org> 2007-07-01 Daniel Berlin <dberlin@dberlin.org>
Fix PR tree-optimization/32571 Fix PR tree-optimization/32571
......
...@@ -8584,7 +8584,7 @@ fold_builtin_memory_op (tree dest, tree src, tree len, tree type, bool ignore, i ...@@ -8584,7 +8584,7 @@ fold_builtin_memory_op (tree dest, tree src, tree len, tree type, bool ignore, i
if (srctype == desttype if (srctype == desttype
|| (gimple_in_ssa_p (cfun) || (gimple_in_ssa_p (cfun)
&& tree_ssa_useless_type_conversion_1 (desttype, srctype))) && useless_type_conversion_p (desttype, srctype)))
expr = srcvar; expr = srcvar;
else if ((INTEGRAL_TYPE_P (TREE_TYPE (srcvar)) else if ((INTEGRAL_TYPE_P (TREE_TYPE (srcvar))
|| POINTER_TYPE_P (TREE_TYPE (srcvar))) || POINTER_TYPE_P (TREE_TYPE (srcvar)))
......
...@@ -3287,8 +3287,8 @@ verify_expr (tree *tp, int *walk_subtrees, void *data ATTRIBUTE_UNUSED) ...@@ -3287,8 +3287,8 @@ verify_expr (tree *tp, int *walk_subtrees, void *data ATTRIBUTE_UNUSED)
} }
/* Check to make sure the second operand is an integer with type of /* Check to make sure the second operand is an integer with type of
sizetype. */ sizetype. */
if (!tree_ssa_useless_type_conversion_1 (sizetype, if (!useless_type_conversion_p (sizetype,
TREE_TYPE (TREE_OPERAND (t, 1)))) TREE_TYPE (TREE_OPERAND (t, 1))))
{ {
error ("invalid operand to pointer plus, second operand is not an " error ("invalid operand to pointer plus, second operand is not an "
"integer with type of sizetype."); "integer with type of sizetype.");
......
...@@ -868,7 +868,7 @@ extern void init_tree_ssa (void); ...@@ -868,7 +868,7 @@ extern void init_tree_ssa (void);
extern edge ssa_redirect_edge (edge, basic_block); extern edge ssa_redirect_edge (edge, basic_block);
extern void flush_pending_stmts (edge); extern void flush_pending_stmts (edge);
extern bool tree_ssa_useless_type_conversion (tree); extern bool tree_ssa_useless_type_conversion (tree);
extern bool tree_ssa_useless_type_conversion_1 (tree, tree); extern bool useless_type_conversion_p (tree, tree);
extern void verify_ssa (bool); extern void verify_ssa (bool);
extern void delete_tree_ssa (void); extern void delete_tree_ssa (void);
extern void walk_use_def_chains (tree, walk_use_def_chains_fn, void *, bool); extern void walk_use_def_chains (tree, walk_use_def_chains_fn, void *, bool);
......
...@@ -633,7 +633,7 @@ determine_offset (struct data_reference *a, struct data_reference *b, ...@@ -633,7 +633,7 @@ determine_offset (struct data_reference *a, struct data_reference *b,
/* Check that both the references access the location in the same type. */ /* Check that both the references access the location in the same type. */
typea = TREE_TYPE (DR_REF (a)); typea = TREE_TYPE (DR_REF (a));
typeb = TREE_TYPE (DR_REF (b)); typeb = TREE_TYPE (DR_REF (b));
if (!tree_ssa_useless_type_conversion_1 (typeb, typea)) if (!useless_type_conversion_p (typeb, typea))
return false; return false;
/* Check whether the base address and the step of both references is the /* Check whether the base address and the step of both references is the
......
...@@ -604,7 +604,7 @@ create_mem_ref (block_stmt_iterator *bsi, tree type, aff_tree *addr) ...@@ -604,7 +604,7 @@ create_mem_ref (block_stmt_iterator *bsi, tree type, aff_tree *addr)
/* Add the symbol to base, eventually forcing it to register. */ /* Add the symbol to base, eventually forcing it to register. */
if (parts.base) if (parts.base)
{ {
gcc_assert (tree_ssa_useless_type_conversion_1 gcc_assert (useless_type_conversion_p
(sizetype, TREE_TYPE (parts.base))); (sizetype, TREE_TYPE (parts.base)));
if (parts.index) if (parts.index)
......
...@@ -899,8 +899,7 @@ ccp_fold (tree stmt) ...@@ -899,8 +899,7 @@ ccp_fold (tree stmt)
} }
if ((code == NOP_EXPR || code == CONVERT_EXPR) if ((code == NOP_EXPR || code == CONVERT_EXPR)
&& tree_ssa_useless_type_conversion_1 (TREE_TYPE (rhs), && useless_type_conversion_p (TREE_TYPE (rhs), TREE_TYPE (op0)))
TREE_TYPE (op0)))
return op0; return op0;
return fold_unary (code, TREE_TYPE (rhs), op0); return fold_unary (code, TREE_TYPE (rhs), op0);
} }
......
...@@ -82,7 +82,7 @@ may_propagate_copy (tree dest, tree orig) ...@@ -82,7 +82,7 @@ may_propagate_copy (tree dest, tree orig)
DECL_UID (SSA_NAME_VAR (dest))))); DECL_UID (SSA_NAME_VAR (dest)))));
/* Do not copy between types for which we *do* need a conversion. */ /* Do not copy between types for which we *do* need a conversion. */
if (!tree_ssa_useless_type_conversion_1 (type_d, type_o)) if (!useless_type_conversion_p (type_d, type_o))
return false; return false;
/* FIXME. GIMPLE is allowing pointer assignments and comparisons of /* FIXME. GIMPLE is allowing pointer assignments and comparisons of
......
...@@ -1515,8 +1515,8 @@ eliminate_redundant_computations (tree stmt) ...@@ -1515,8 +1515,8 @@ eliminate_redundant_computations (tree stmt)
if (cached_lhs if (cached_lhs
&& ((TREE_CODE (cached_lhs) != SSA_NAME && ((TREE_CODE (cached_lhs) != SSA_NAME
&& (modify_expr_p && (modify_expr_p
|| tree_ssa_useless_type_conversion_1 (TREE_TYPE (*expr_p), || useless_type_conversion_p (TREE_TYPE (*expr_p),
TREE_TYPE (cached_lhs)))) TREE_TYPE (cached_lhs))))
|| may_propagate_copy (*expr_p, cached_lhs))) || may_propagate_copy (*expr_p, cached_lhs)))
{ {
if (dump_file && (dump_flags & TDF_DETAILS)) if (dump_file && (dump_flags & TDF_DETAILS))
...@@ -1541,8 +1541,8 @@ eliminate_redundant_computations (tree stmt) ...@@ -1541,8 +1541,8 @@ eliminate_redundant_computations (tree stmt)
retval = true; retval = true;
if (modify_expr_p if (modify_expr_p
&& !tree_ssa_useless_type_conversion_1 (TREE_TYPE (*expr_p), && !useless_type_conversion_p (TREE_TYPE (*expr_p),
TREE_TYPE (cached_lhs))) TREE_TYPE (cached_lhs)))
cached_lhs = fold_convert (TREE_TYPE (*expr_p), cached_lhs); cached_lhs = fold_convert (TREE_TYPE (*expr_p), cached_lhs);
propagate_tree_value (expr_p, cached_lhs); propagate_tree_value (expr_p, cached_lhs);
......
...@@ -601,8 +601,8 @@ forward_propagate_addr_expr_1 (tree name, tree def_rhs, tree use_stmt, ...@@ -601,8 +601,8 @@ forward_propagate_addr_expr_1 (tree name, tree def_rhs, tree use_stmt,
&& rhs == name) && rhs == name)
|| ((TREE_CODE (rhs) == NOP_EXPR || ((TREE_CODE (rhs) == NOP_EXPR
|| TREE_CODE (rhs) == CONVERT_EXPR) || TREE_CODE (rhs) == CONVERT_EXPR)
&& tree_ssa_useless_type_conversion_1 (TREE_TYPE (rhs), && useless_type_conversion_p (TREE_TYPE (rhs),
TREE_TYPE (def_rhs)))) TREE_TYPE (def_rhs))))
return forward_propagate_addr_expr (lhs, def_rhs); return forward_propagate_addr_expr (lhs, def_rhs);
/* Strip away any outer COMPONENT_REF, ARRAY_REF or ADDR_EXPR /* Strip away any outer COMPONENT_REF, ARRAY_REF or ADDR_EXPR
......
...@@ -213,7 +213,7 @@ refine_bounds_using_guard (tree type, tree varx, mpz_t offx, ...@@ -213,7 +213,7 @@ refine_bounds_using_guard (tree type, tree varx, mpz_t offx,
STRIP_SIGN_NOPS (c0); STRIP_SIGN_NOPS (c0);
STRIP_SIGN_NOPS (c1); STRIP_SIGN_NOPS (c1);
ctype = TREE_TYPE (c0); ctype = TREE_TYPE (c0);
if (!tree_ssa_useless_type_conversion_1 (ctype, type)) if (!useless_type_conversion_p (ctype, type))
return; return;
break; break;
......
...@@ -3698,8 +3698,8 @@ eliminate (void) ...@@ -3698,8 +3698,8 @@ eliminate (void)
which may require adding a simple cast, which fold_convert which may require adding a simple cast, which fold_convert
will do for us. */ will do for us. */
if (TREE_CODE (*rhs_p) != SSA_NAME if (TREE_CODE (*rhs_p) != SSA_NAME
&& !tree_ssa_useless_type_conversion_1 (TREE_TYPE (*rhs_p), && !useless_type_conversion_p (TREE_TYPE (*rhs_p),
TREE_TYPE (sprime))) TREE_TYPE (sprime)))
sprime = fold_convert (TREE_TYPE (*rhs_p), sprime); sprime = fold_convert (TREE_TYPE (*rhs_p), sprime);
pre_stats.eliminations++; pre_stats.eliminations++;
......
...@@ -891,7 +891,7 @@ delete_tree_ssa (void) ...@@ -891,7 +891,7 @@ delete_tree_ssa (void)
useless type conversion, otherwise return false. */ useless type conversion, otherwise return false. */
bool bool
tree_ssa_useless_type_conversion_1 (tree outer_type, tree inner_type) useless_type_conversion_p (tree outer_type, tree inner_type)
{ {
if (inner_type == outer_type) if (inner_type == outer_type)
return true; return true;
...@@ -964,7 +964,7 @@ tree_ssa_useless_type_conversion_1 (tree outer_type, tree inner_type) ...@@ -964,7 +964,7 @@ tree_ssa_useless_type_conversion_1 (tree outer_type, tree inner_type)
/* Recurse for complex types. */ /* Recurse for complex types. */
else if (TREE_CODE (inner_type) == COMPLEX_TYPE else if (TREE_CODE (inner_type) == COMPLEX_TYPE
&& TREE_CODE (outer_type) == COMPLEX_TYPE && TREE_CODE (outer_type) == COMPLEX_TYPE
&& tree_ssa_useless_type_conversion_1 (TREE_TYPE (outer_type), && useless_type_conversion_p (TREE_TYPE (outer_type),
TREE_TYPE (inner_type))) TREE_TYPE (inner_type)))
return true; return true;
...@@ -987,7 +987,7 @@ tree_ssa_useless_type_conversion (tree expr) ...@@ -987,7 +987,7 @@ tree_ssa_useless_type_conversion (tree expr)
/* FIXME: Use of GENERIC_TREE_TYPE here is a temporary measure to work /* FIXME: Use of GENERIC_TREE_TYPE here is a temporary measure to work
around known bugs with GIMPLE_MODIFY_STMTs appearing in places around known bugs with GIMPLE_MODIFY_STMTs appearing in places
they shouldn't. See PR 30391. */ they shouldn't. See PR 30391. */
return tree_ssa_useless_type_conversion_1 return useless_type_conversion_p
(TREE_TYPE (expr), (TREE_TYPE (expr),
GENERIC_TREE_TYPE (TREE_OPERAND (expr, 0))); GENERIC_TREE_TYPE (TREE_OPERAND (expr, 0)));
......
...@@ -3076,8 +3076,7 @@ build2_stat (enum tree_code code, tree tt, tree arg0, tree arg1 MEM_STAT_DECL) ...@@ -3076,8 +3076,7 @@ build2_stat (enum tree_code code, tree tt, tree arg0, tree arg1 MEM_STAT_DECL)
if (code == POINTER_PLUS_EXPR && arg0 && arg1 && tt) if (code == POINTER_PLUS_EXPR && arg0 && arg1 && tt)
gcc_assert (POINTER_TYPE_P (tt) && POINTER_TYPE_P (TREE_TYPE (arg0)) gcc_assert (POINTER_TYPE_P (tt) && POINTER_TYPE_P (TREE_TYPE (arg0))
&& TREE_CODE (TREE_TYPE (arg1)) == INTEGER_TYPE && TREE_CODE (TREE_TYPE (arg1)) == INTEGER_TYPE
&& tree_ssa_useless_type_conversion_1 (sizetype, && useless_type_conversion_p (sizetype, TREE_TYPE (arg1)));
TREE_TYPE (arg1)));
t = make_node_stat (code PASS_MEM_STAT); t = make_node_stat (code PASS_MEM_STAT);
TREE_TYPE (t) = tt; TREE_TYPE (t) = tt;
......
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