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>
Fix PR tree-optimization/32571
......
......@@ -8584,7 +8584,7 @@ fold_builtin_memory_op (tree dest, tree src, tree len, tree type, bool ignore, i
if (srctype == desttype
|| (gimple_in_ssa_p (cfun)
&& tree_ssa_useless_type_conversion_1 (desttype, srctype)))
&& useless_type_conversion_p (desttype, srctype)))
expr = srcvar;
else if ((INTEGRAL_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)
}
/* Check to make sure the second operand is an integer with type of
sizetype. */
if (!tree_ssa_useless_type_conversion_1 (sizetype,
TREE_TYPE (TREE_OPERAND (t, 1))))
if (!useless_type_conversion_p (sizetype,
TREE_TYPE (TREE_OPERAND (t, 1))))
{
error ("invalid operand to pointer plus, second operand is not an "
"integer with type of sizetype.");
......
......@@ -868,7 +868,7 @@ extern void init_tree_ssa (void);
extern edge ssa_redirect_edge (edge, basic_block);
extern void flush_pending_stmts (edge);
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 delete_tree_ssa (void);
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,
/* Check that both the references access the location in the same type. */
typea = TREE_TYPE (DR_REF (a));
typeb = TREE_TYPE (DR_REF (b));
if (!tree_ssa_useless_type_conversion_1 (typeb, typea))
if (!useless_type_conversion_p (typeb, typea))
return false;
/* 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)
/* Add the symbol to base, eventually forcing it to register. */
if (parts.base)
{
gcc_assert (tree_ssa_useless_type_conversion_1
gcc_assert (useless_type_conversion_p
(sizetype, TREE_TYPE (parts.base)));
if (parts.index)
......
......@@ -899,8 +899,7 @@ ccp_fold (tree stmt)
}
if ((code == NOP_EXPR || code == CONVERT_EXPR)
&& tree_ssa_useless_type_conversion_1 (TREE_TYPE (rhs),
TREE_TYPE (op0)))
&& useless_type_conversion_p (TREE_TYPE (rhs), TREE_TYPE (op0)))
return op0;
return fold_unary (code, TREE_TYPE (rhs), op0);
}
......
......@@ -82,7 +82,7 @@ may_propagate_copy (tree dest, tree orig)
DECL_UID (SSA_NAME_VAR (dest)))));
/* 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;
/* FIXME. GIMPLE is allowing pointer assignments and comparisons of
......
......@@ -1515,8 +1515,8 @@ eliminate_redundant_computations (tree stmt)
if (cached_lhs
&& ((TREE_CODE (cached_lhs) != SSA_NAME
&& (modify_expr_p
|| tree_ssa_useless_type_conversion_1 (TREE_TYPE (*expr_p),
TREE_TYPE (cached_lhs))))
|| useless_type_conversion_p (TREE_TYPE (*expr_p),
TREE_TYPE (cached_lhs))))
|| may_propagate_copy (*expr_p, cached_lhs)))
{
if (dump_file && (dump_flags & TDF_DETAILS))
......@@ -1541,8 +1541,8 @@ eliminate_redundant_computations (tree stmt)
retval = true;
if (modify_expr_p
&& !tree_ssa_useless_type_conversion_1 (TREE_TYPE (*expr_p),
TREE_TYPE (cached_lhs)))
&& !useless_type_conversion_p (TREE_TYPE (*expr_p),
TREE_TYPE (cached_lhs)))
cached_lhs = fold_convert (TREE_TYPE (*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,
&& rhs == name)
|| ((TREE_CODE (rhs) == NOP_EXPR
|| TREE_CODE (rhs) == CONVERT_EXPR)
&& tree_ssa_useless_type_conversion_1 (TREE_TYPE (rhs),
TREE_TYPE (def_rhs))))
&& useless_type_conversion_p (TREE_TYPE (rhs),
TREE_TYPE (def_rhs))))
return forward_propagate_addr_expr (lhs, def_rhs);
/* 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,
STRIP_SIGN_NOPS (c0);
STRIP_SIGN_NOPS (c1);
ctype = TREE_TYPE (c0);
if (!tree_ssa_useless_type_conversion_1 (ctype, type))
if (!useless_type_conversion_p (ctype, type))
return;
break;
......
......@@ -3698,8 +3698,8 @@ eliminate (void)
which may require adding a simple cast, which fold_convert
will do for us. */
if (TREE_CODE (*rhs_p) != SSA_NAME
&& !tree_ssa_useless_type_conversion_1 (TREE_TYPE (*rhs_p),
TREE_TYPE (sprime)))
&& !useless_type_conversion_p (TREE_TYPE (*rhs_p),
TREE_TYPE (sprime)))
sprime = fold_convert (TREE_TYPE (*rhs_p), sprime);
pre_stats.eliminations++;
......
......@@ -891,7 +891,7 @@ delete_tree_ssa (void)
useless type conversion, otherwise return false. */
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)
return true;
......@@ -964,7 +964,7 @@ tree_ssa_useless_type_conversion_1 (tree outer_type, tree inner_type)
/* Recurse for complex types. */
else if (TREE_CODE (inner_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)))
return true;
......@@ -987,7 +987,7 @@ tree_ssa_useless_type_conversion (tree expr)
/* FIXME: Use of GENERIC_TREE_TYPE here is a temporary measure to work
around known bugs with GIMPLE_MODIFY_STMTs appearing in places
they shouldn't. See PR 30391. */
return tree_ssa_useless_type_conversion_1
return useless_type_conversion_p
(TREE_TYPE (expr),
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)
if (code == POINTER_PLUS_EXPR && arg0 && arg1 && tt)
gcc_assert (POINTER_TYPE_P (tt) && POINTER_TYPE_P (TREE_TYPE (arg0))
&& TREE_CODE (TREE_TYPE (arg1)) == INTEGER_TYPE
&& tree_ssa_useless_type_conversion_1 (sizetype,
TREE_TYPE (arg1)));
&& useless_type_conversion_p (sizetype, TREE_TYPE (arg1)));
t = make_node_stat (code PASS_MEM_STAT);
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