summaryrefslogtreecommitdiff
path: root/gcc/gimple.c
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2010-11-27 14:32:47 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2010-11-27 14:32:47 +0000
commit09937c79d6fc38165805d31ca230fb2043137385 (patch)
tree2ef7f1febc0aea12d3964123c22645dfb8cb316b /gcc/gimple.c
parent04324e294846a522a86098f5699dc79a0417e27e (diff)
downloadgcc-09937c79d6fc38165805d31ca230fb2043137385.tar.gz
2010-11-27 Richard Guenther <rguenther@suse.de>
* gimple.c (gimple_assign_copy_p): Use gimple_assign_single_p. (gimple_assign_ssa_name_copy_p): Likewise. (gimple_assign_unary_nop_p): Use is_gimple_assign. (is_gimple_cast): Remove. (gimple_assign_single_p): Move ... * gimple.h (gimple_assign_single_p): ... here. (is_gimple_cast): Remove. (gimple_assign_rhs_code): Simplify. * gimple-fold.c (gimple_fold_builtin): Use CONVERT_EXPR_P instead of is_gimple_cast. * ipa-type-escape.c (look_for_casts): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@167200 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/gimple.c')
-rw-r--r--gcc/gimple.c36
1 files changed, 5 insertions, 31 deletions
diff --git a/gcc/gimple.c b/gcc/gimple.c
index 67c80e327c3..7713dab21f9 100644
--- a/gcc/gimple.c
+++ b/gcc/gimple.c
@@ -1873,15 +1873,14 @@ gimple_call_return_flags (const_gimple stmt)
}
}
+
/* Return true if GS is a copy assignment. */
bool
gimple_assign_copy_p (gimple gs)
{
- return gimple_code (gs) == GIMPLE_ASSIGN
- && get_gimple_rhs_class (gimple_assign_rhs_code (gs))
- == GIMPLE_SINGLE_RHS
- && is_gimple_val (gimple_op (gs, 1));
+ return (gimple_assign_single_p (gs)
+ && is_gimple_val (gimple_op (gs, 1)));
}
@@ -1890,28 +1889,12 @@ gimple_assign_copy_p (gimple gs)
bool
gimple_assign_ssa_name_copy_p (gimple gs)
{
- return (gimple_code (gs) == GIMPLE_ASSIGN
- && (get_gimple_rhs_class (gimple_assign_rhs_code (gs))
- == GIMPLE_SINGLE_RHS)
+ return (gimple_assign_single_p (gs)
&& TREE_CODE (gimple_assign_lhs (gs)) == SSA_NAME
&& TREE_CODE (gimple_assign_rhs1 (gs)) == SSA_NAME);
}
-/* Return true if GS is an assignment with a singleton RHS, i.e.,
- there is no operator associated with the assignment itself.
- Unlike gimple_assign_copy_p, this predicate returns true for
- any RHS operand, including those that perform an operation
- and do not have the semantics of a copy, such as COND_EXPR. */
-
-bool
-gimple_assign_single_p (gimple gs)
-{
- return (gimple_code (gs) == GIMPLE_ASSIGN
- && get_gimple_rhs_class (gimple_assign_rhs_code (gs))
- == GIMPLE_SINGLE_RHS);
-}
-
/* Return true if GS is an assignment with a unary RHS, but the
operator has no effect on the assigned value. The logic is adapted
from STRIP_NOPS. This predicate is intended to be used in tuplifying
@@ -1929,7 +1912,7 @@ gimple_assign_single_p (gimple gs)
bool
gimple_assign_unary_nop_p (gimple gs)
{
- return (gimple_code (gs) == GIMPLE_ASSIGN
+ return (is_gimple_assign (gs)
&& (CONVERT_EXPR_CODE_P (gimple_assign_rhs_code (gs))
|| gimple_assign_rhs_code (gs) == NON_LVALUE_EXPR)
&& gimple_assign_rhs1 (gs) != error_mark_node
@@ -2950,15 +2933,6 @@ is_gimple_min_lval (tree t)
return (is_gimple_id (t) || TREE_CODE (t) == MEM_REF);
}
-/* Return true if T is a typecast operation. */
-
-bool
-is_gimple_cast (tree t)
-{
- return (CONVERT_EXPR_P (t)
- || TREE_CODE (t) == FIX_TRUNC_EXPR);
-}
-
/* Return true if T is a valid function operand of a CALL_EXPR. */
bool