+2014-10-31 Richard Biener <rguenther@suse.de>
+
+ * builtins.c (fold_builtin_atomic_always_lock_free): Use
+ CONVERT_EXPR_P, CONVERT_EXPR_CODE_P and CASE_CONVERT where
+ approprate.
+ (fold_builtin_expect): Likewise.
+ (integer_valued_real_p): Likewise.
+ * cfgexpand.c (expand_debug_expr): Likewise.
+ * ipa-inline-analysis.c (eliminated_by_inlining_prob): Likewise.
+ (find_foldable_builtin_expect): Likewise.
+ * trans-mem.c (thread_private_new_memory): Likewise.
+ * tree-affine.c (aff_combination_expand): Likewise.
+ * tree-data-ref.c (initialize_matrix_A): Likewise.
+ * tree-inline.c (copy_bb): Likewise.
+ * tree-pretty-print.c (dump_function_name): Likewise.
+ (print_call_name): Likewise.
+ * tree-ssa-forwprop.c (constant_pointer_difference): Likewise.
+ * tree-ssa-math-opts.c (find_bswap_or_nop_1): Likewise.
+ * tree-vect-generic.c (expand_vector_operations_1): Likewise.
+ * tree-vect-patterns.c (vect_handle_widen_op_by_const): Likewise.
+ (vect_recog_widen_mult_pattern): Likewise.
+ (vect_operation_fits_smaller_type): Likewise.
+ * tree-vrp.c (find_assert_locations_1): Likewise.
+ * tree-ssa-dom.c (initialize_hash_element): Canonicalize
+ converts to NOP_EXPR.
+
2014-10-31 Richard Biener <rguenther@suse.de>
* genmatch.c (expr::gen_transform): Use NOP_EXPRs instead of
end before anything else has a chance to look at it. The pointer
parameter at this point is usually cast to a void *, so check for that
and look past the cast. */
- if (TREE_CODE (arg1) == NOP_EXPR && POINTER_TYPE_P (ttype)
+ if (CONVERT_EXPR_P (arg1) && POINTER_TYPE_P (ttype)
&& VOID_TYPE_P (TREE_TYPE (ttype)))
arg1 = TREE_OPERAND (arg1, 0);
/* Distribute the expected value over short-circuiting operators.
See through the cast from truthvalue_type_node to long. */
inner_arg0 = arg0;
- while (TREE_CODE (inner_arg0) == NOP_EXPR
+ while (CONVERT_EXPR_P (inner_arg0)
&& INTEGRAL_TYPE_P (TREE_TYPE (inner_arg0))
&& INTEGRAL_TYPE_P (TREE_TYPE (TREE_OPERAND (inner_arg0, 0))))
inner_arg0 = TREE_OPERAND (inner_arg0, 0);
case REAL_CST:
return real_isinteger (TREE_REAL_CST_PTR (t), TYPE_MODE (TREE_TYPE (t)));
- case NOP_EXPR:
+ CASE_CONVERT:
{
tree type = TREE_TYPE (TREE_OPERAND (t, 0));
if (TREE_CODE (type) == INTEGER_TYPE)
adjust_mode:
case PAREN_EXPR:
- case NOP_EXPR:
- case CONVERT_EXPR:
+ CASE_CONVERT:
{
inner_mode = GET_MODE (op0);
and stores to return value or parameters are often free after
inlining dua to SRA and further combining.
Assume that half of statements goes away. */
- if (rhs_code == CONVERT_EXPR
- || rhs_code == NOP_EXPR
+ if (CONVERT_EXPR_CODE_P (rhs_code)
|| rhs_code == VIEW_CONVERT_EXPR
|| rhs_code == ADDR_EXPR
|| gimple_assign_rhs_class (stmt) == GIMPLE_SINGLE_RHS)
match = true;
done = true;
break;
- case NOP_EXPR:
+ CASE_CONVERT:
break;
default:
done = true;
else if (code == POINTER_PLUS_EXPR)
x = gimple_assign_rhs1 (stmt);
/* x = (cast*) foo ==> foo */
- else if (code == VIEW_CONVERT_EXPR || code == NOP_EXPR)
+ else if (code == VIEW_CONVERT_EXPR || CONVERT_EXPR_CODE_P (code))
x = gimple_assign_rhs1 (stmt);
/* x = c ? op1 : op2 == > op1 or op2 just like a PHI */
else if (code == COND_EXPR)
type = TREE_TYPE (e);
name = e;
/* Look through some conversions. */
- if (TREE_CODE (e) == NOP_EXPR
+ if (CONVERT_EXPR_P (e)
&& (TYPE_PRECISION (type)
>= TYPE_PRECISION (TREE_TYPE (TREE_OPERAND (e, 0)))))
name = TREE_OPERAND (e, 0);
return chrec_fold_op (TREE_CODE (chrec), chrec_type (chrec), op0, op1);
}
- case NOP_EXPR:
+ CASE_CONVERT:
{
tree op = initialize_matrix_A (A, TREE_OPERAND (chrec, 0), index, mult);
return chrec_convert (chrec_type (chrec), op, NULL);
/* With return slot optimization we can end up with
non-gimple (foo *)&this->m, fix that here. */
if (is_gimple_assign (stmt)
- && gimple_assign_rhs_code (stmt) == NOP_EXPR
+ && CONVERT_EXPR_CODE_P (gimple_assign_rhs_code (stmt))
&& !is_gimple_val (gimple_assign_rhs1 (stmt)))
{
tree new_rhs;
static void
dump_function_name (pretty_printer *buffer, tree node, int flags)
{
- if (TREE_CODE (node) == NOP_EXPR)
+ if (CONVERT_EXPR_P (node))
node = TREE_OPERAND (node, 0);
if (DECL_NAME (node) && (flags & TDF_ASMNAME) == 0)
pp_string (buffer, lang_hooks.decl_printable_name (node, 1));
case ADDR_EXPR:
case INDIRECT_REF:
- case NOP_EXPR:
+ CASE_CONVERT:
op0 = TREE_OPERAND (op0, 0);
goto again;
expr->kind = EXPR_UNARY;
expr->type = TREE_TYPE (gimple_assign_lhs (stmt));
if (CONVERT_EXPR_CODE_P (subcode))
- subcode = CONVERT_EXPR;
+ subcode = NOP_EXPR;
expr->ops.unary.op = subcode;
expr->ops.unary.opnd = gimple_assign_rhs1 (stmt);
break;
off = size_binop (PLUS_EXPR, off, gimple_assign_rhs2 (stmt));
p = gimple_assign_rhs1 (stmt);
}
- else if (code == ADDR_EXPR || code == NOP_EXPR)
+ else if (code == ADDR_EXPR || CONVERT_EXPR_CODE_P (code))
p = gimple_assign_rhs1 (stmt);
else
break;
&& code != RSHIFT_EXPR
&& code != LROTATE_EXPR
&& code != RROTATE_EXPR
- && code != NOP_EXPR
- && code != CONVERT_EXPR)
+ && !CONVERT_EXPR_CODE_P (code))
return NULL;
source_stmt1 = find_bswap_or_nop_1 (rhs1_stmt, n, limit - 1);
if (TREE_CODE (type) != VECTOR_TYPE)
return;
- if (code == NOP_EXPR
+ if (CONVERT_EXPR_CODE_P (code)
|| code == FLOAT_EXPR
|| code == FIX_TRUNC_EXPR
|| code == VIEW_CONVERT_EXPR)
return;
- gcc_assert (code != CONVERT_EXPR);
-
/* The signedness is determined from input argument. */
if (code == VEC_UNPACK_FLOAT_HI_EXPR
|| code == VEC_UNPACK_FLOAT_LO_EXPR)
new_stmt = STMT_VINFO_RELATED_STMT (vinfo_for_stmt (def_stmt));
/* Check if the already created pattern stmt is what we need. */
if (!is_gimple_assign (new_stmt)
- || gimple_assign_rhs_code (new_stmt) != NOP_EXPR
+ || !CONVERT_EXPR_CODE_P (gimple_assign_rhs_code (new_stmt))
|| TREE_TYPE (gimple_assign_lhs (new_stmt)) != new_type)
return false;
use_stmt = vect_single_imm_use (last_stmt);
if (!use_stmt || !is_gimple_assign (use_stmt)
- || gimple_assign_rhs_code (use_stmt) != NOP_EXPR)
+ || !CONVERT_EXPR_CODE_P (gimple_assign_rhs_code (use_stmt)))
return NULL;
use_lhs = gimple_assign_lhs (use_stmt);
new_stmt = STMT_VINFO_RELATED_STMT (vinfo_for_stmt (def_stmt));
/* Check if the already created pattern stmt is what we need. */
if (!is_gimple_assign (new_stmt)
- || gimple_assign_rhs_code (new_stmt) != NOP_EXPR
+ || !CONVERT_EXPR_CODE_P (gimple_assign_rhs_code (new_stmt))
|| TREE_TYPE (gimple_assign_lhs (new_stmt)) != interm_type)
return false;
gimple def_stmt = SSA_NAME_DEF_STMT (t);
while (is_gimple_assign (def_stmt)
- && gimple_assign_rhs_code (def_stmt) == NOP_EXPR
+ && CONVERT_EXPR_CODE_P
+ (gimple_assign_rhs_code (def_stmt))
&& TREE_CODE
(gimple_assign_rhs1 (def_stmt)) == SSA_NAME
&& POINTER_TYPE_P