+2007-03-08 Roger Sayle <roger@eyesopen.com>
+
+ * tree-eh.c (do_return_redirection): Call build_gimple_modify_stmt
+ instead of calling build2 with a GIMPLE_MODIFY_STMT.
+ (honor_protect_cleanup_actions, lower_try_finally_switch):
+ Likewise.
+ * tree-if-conv.c (replace_phi_with_cond_gimple_modify_stmt,
+ ifc_temp_var): Likewise.
+ * tree-inline.c (setup_one_parameter): Likewise.
+ * tree-mudflap.c (mf_decl_cache_locals,
+ mf_build_check_statement_for): Likewise.
+ * tree-nested.c (init_tmp_var, save_tmp_var,
+ finalize_nesting_tree_1): Likewise.
+ * tree-outof-ssa.c (insert_copy_on_edge,
+ insert_backedge_copies): Likewise.
+ * tree-profile.c (tree_gen_edge_profiler,
+ tree_gen_ic_profiler): Likewise.
+ * tree-scalar-evolution.c (scev_const_prop): Likewise.
+ * tree-sra.c (sra_build_assignment): Likewise.
+ * tree-ssa-loop-im.c (determine_invariantness_stmt): Likewise.
+ * tree-ssa-math-opts.c (insert_reciprocals,
+ execute_cse_sincos_1): Likewise.
+ * tree-tailcall.c (adjust_accumulator_values,
+ adjust_return_value): Likewise.
+ * tree-vect-patterns.c (vect_pattern_recog_1): Likewise.
+ * tree-vect-transform.c (vect_create_data_ref_ptr,
+ bump_vector_ptr, vect_init_vector, get_initial_def_for_induction,
+ vect_create_epilog_for_reduction, vectorizable_reduction,
+ vectorizable_call, vectorizable_conversion,
+ vectorizable_assignment, vectorizable_operation,
+ vectorizable_type_demotion, vect_gen_widened_results_half,
+ vect_permute_store_chain, vectorizable_store,
+ vect_setup_realignment, vect_permute_load_chain,
+ vectorizable_load, vectorizable_condition,
+ vect_create_cond_for_align_checks): Likewise.
+ * tree-vrp.c (build_assert_expr_for): Likewise.
+
2007-03-08 Ian Lance Taylor <iant@google.com>
* tree-vrp.c: Include "intl.h".
else
new = *return_value_p;
- x = build2 (GIMPLE_MODIFY_STMT, TREE_TYPE (new), new, old);
+ x = build_gimple_modify_stmt (new, old);
append_to_statement_list (x, &q->repl_stmt);
if (new == result)
x = result;
else
- x = build2 (GIMPLE_MODIFY_STMT, TREE_TYPE (result), result, new);
+ x = build_gimple_modify_stmt (result, new);
q->cont_stmt = build1 (RETURN_EXPR, void_type_node, x);
}
i = tsi_start (finally);
x = build0 (EXC_PTR_EXPR, ptr_type_node);
- x = build2 (GIMPLE_MODIFY_STMT, void_type_node, save_eptr, x);
+ x = build_gimple_modify_stmt (save_eptr, x);
tsi_link_before (&i, x, TSI_CONTINUE_LINKING);
x = build0 (FILTER_EXPR, integer_type_node);
- x = build2 (GIMPLE_MODIFY_STMT, void_type_node, save_filt, x);
+ x = build_gimple_modify_stmt (save_filt, x);
tsi_link_before (&i, x, TSI_CONTINUE_LINKING);
i = tsi_last (finally);
x = build0 (EXC_PTR_EXPR, ptr_type_node);
- x = build2 (GIMPLE_MODIFY_STMT, void_type_node, x, save_eptr);
+ x = build_gimple_modify_stmt (x, save_eptr);
tsi_link_after (&i, x, TSI_CONTINUE_LINKING);
x = build0 (FILTER_EXPR, integer_type_node);
- x = build2 (GIMPLE_MODIFY_STMT, void_type_node, x, save_filt);
+ x = build_gimple_modify_stmt (x, save_filt);
tsi_link_after (&i, x, TSI_CONTINUE_LINKING);
x = build_resx (get_eh_region_number (tf->region));
if (tf->may_fallthru)
{
- x = build2 (GIMPLE_MODIFY_STMT, void_type_node, finally_tmp,
- build_int_cst (NULL_TREE, fallthru_index));
+ x = build_gimple_modify_stmt (finally_tmp,
+ build_int_cst (integer_type_node,
+ fallthru_index));
append_to_statement_list (x, tf->top_p);
if (tf->may_throw)
x = build1 (LABEL_EXPR, void_type_node, tf->eh_label);
append_to_statement_list (x, tf->top_p);
- x = build2 (GIMPLE_MODIFY_STMT, void_type_node, finally_tmp,
- build_int_cst (NULL_TREE, eh_index));
+ x = build_gimple_modify_stmt (finally_tmp,
+ build_int_cst (integer_type_node,
+ eh_index));
append_to_statement_list (x, tf->top_p);
last_case = build3 (CASE_LABEL_EXPR, void_type_node,
if (q->index < 0)
{
- mod = build2 (GIMPLE_MODIFY_STMT, void_type_node, finally_tmp,
- build_int_cst (NULL_TREE, return_index));
+ mod = build_gimple_modify_stmt (finally_tmp,
+ build_int_cst (integer_type_node,
+ return_index));
do_return_redirection (q, finally_label, mod, &return_val);
switch_id = return_index;
}
else
{
- mod = build2 (GIMPLE_MODIFY_STMT, void_type_node, finally_tmp,
- build_int_cst (NULL_TREE, q->index));
+ mod = build_gimple_modify_stmt (finally_tmp,
+ build_int_cst (integer_type_node,
+ q->index));
do_goto_redirection (q, finally_label, mod);
switch_id = q->index;
}
/* If-conversion for vectorizer.
- Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
Contributed by Devang Patel <dpatel@apple.com>
This file is part of GCC.
unshare_expr (arg_1));
/* Create new MODIFY expression using RHS. */
- new_stmt = build2 (GIMPLE_MODIFY_STMT, TREE_TYPE (PHI_RESULT (phi)),
- unshare_expr (PHI_RESULT (phi)), rhs);
+ new_stmt = build_gimple_modify_stmt (unshare_expr (PHI_RESULT (phi)), rhs);
/* Make new statement definition of the original phi result. */
SSA_NAME_DEF_STMT (PHI_RESULT (phi)) = new_stmt;
add_referenced_var (var);
/* Build new statement to assign EXP to new variable. */
- stmt = build2 (GIMPLE_MODIFY_STMT, type, var, exp);
+ stmt = build_gimple_modify_stmt (var, exp);
/* Get SSA name for the new variable and set make new statement
its definition statement. */
/* Tree inlining.
- Copyright 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+ Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007
+ Free Software Foundation, Inc.
Contributed by Alexandre Oliva <aoliva@redhat.com>
This file is part of GCC.
if (def && gimple_in_ssa_p (cfun) && is_gimple_reg (p))
{
def = remap_ssa_name (def, id);
- init_stmt = build2 (GIMPLE_MODIFY_STMT, TREE_TYPE (var), def, rhs);
+ init_stmt = build_gimple_modify_stmt (def, rhs);
SSA_NAME_DEF_STMT (def) = init_stmt;
SSA_NAME_IS_DEFAULT_DEF (def) = 0;
set_default_def (var, NULL);
}
else
- init_stmt = build2 (GIMPLE_MODIFY_STMT, TREE_TYPE (var), var, rhs);
+ init_stmt = build_gimple_modify_stmt (var, rhs);
/* If we did not create a gimple value and we did not create a gimple
cast of a gimple value, then we will need to gimplify INIT_STMTS
/* Mudflap: narrow-pointer bounds-checking by tree rewriting.
- Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007
+ Free Software Foundation, Inc.
Contributed by Frank Ch. Eigler <fche@redhat.com>
and Graydon Hoare <graydon@redhat.com>
/* Build initialization nodes for the cache vars. We just load the
globals into the cache variables. */
- t = build2 (GIMPLE_MODIFY_STMT, TREE_TYPE (mf_cache_shift_decl_l),
- mf_cache_shift_decl_l, mf_cache_shift_decl);
+ t = build_gimple_modify_stmt (mf_cache_shift_decl_l, mf_cache_shift_decl);
SET_EXPR_LOCATION (t, DECL_SOURCE_LOCATION (current_function_decl));
gimplify_to_stmt_list (&t);
shift_init_stmts = t;
- t = build2 (GIMPLE_MODIFY_STMT, TREE_TYPE (mf_cache_mask_decl_l),
- mf_cache_mask_decl_l, mf_cache_mask_decl);
+ t = build_gimple_modify_stmt (mf_cache_mask_decl_l, mf_cache_mask_decl);
SET_EXPR_LOCATION (t, DECL_SOURCE_LOCATION (current_function_decl));
gimplify_to_stmt_list (&t);
mask_init_stmts = t;
mf_limit = create_tmp_var (mf_uintptr_type, "__mf_limit");
/* Build: __mf_base = (uintptr_t) <base address expression>. */
- t = build2 (GIMPLE_MODIFY_STMT, void_type_node, mf_base,
- convert (mf_uintptr_type, unshare_expr (base)));
+ t = build_gimple_modify_stmt (mf_base,
+ fold_convert (mf_uintptr_type,
+ unshare_expr (base)));
SET_EXPR_LOCUS (t, locus);
gimplify_to_stmt_list (&t);
head = tsi_start (t);
tsi = tsi_last (t);
/* Build: __mf_limit = (uintptr_t) <limit address expression>. */
- t = build2 (GIMPLE_MODIFY_STMT, void_type_node, mf_limit,
- convert (mf_uintptr_type, unshare_expr (limit)));
+ t = build_gimple_modify_stmt (mf_limit,
+ fold_convert (mf_uintptr_type,
+ unshare_expr (limit)));
SET_EXPR_LOCUS (t, locus);
gimplify_to_stmt_list (&t);
tsi_link_after (&tsi, t, TSI_CONTINUE_LINKING);
TREE_TYPE (TREE_TYPE (mf_cache_array_decl)),
mf_cache_array_decl, t, NULL_TREE, NULL_TREE);
t = build1 (ADDR_EXPR, mf_cache_structptr_type, t);
- t = build2 (GIMPLE_MODIFY_STMT, void_type_node, mf_elem, t);
+ t = build_gimple_modify_stmt (mf_elem, t);
SET_EXPR_LOCUS (t, locus);
gimplify_to_stmt_list (&t);
tsi_link_after (&tsi, t, TSI_CONTINUE_LINKING);
can use as the condition for the conditional jump. */
t = build2 (TRUTH_OR_EXPR, boolean_type_node, t, u);
cond = create_tmp_var (boolean_type_node, "__mf_unlikely_cond");
- t = build2 (GIMPLE_MODIFY_STMT, boolean_type_node, cond, t);
+ t = build_gimple_modify_stmt (cond, t);
gimplify_to_stmt_list (&t);
tsi_link_after (&tsi, t, TSI_CONTINUE_LINKING);
if (! flag_mudflap_threads)
{
- t = build2 (GIMPLE_MODIFY_STMT, void_type_node,
- mf_cache_shift_decl_l, mf_cache_shift_decl);
+ t = build_gimple_modify_stmt (mf_cache_shift_decl_l,
+ mf_cache_shift_decl);
tsi_link_after (&tsi, t, TSI_CONTINUE_LINKING);
- t = build2 (GIMPLE_MODIFY_STMT, void_type_node,
- mf_cache_mask_decl_l, mf_cache_mask_decl);
+ t = build_gimple_modify_stmt (mf_cache_mask_decl_l,
+ mf_cache_mask_decl);
tsi_link_after (&tsi, t, TSI_CONTINUE_LINKING);
}
/* Nested function decomposition for trees.
- Copyright (C) 2004, 2005, 2006 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
This file is part of GCC.
tree t, stmt;
t = create_tmp_var_for (info, TREE_TYPE (exp), NULL);
- stmt = build2 (GIMPLE_MODIFY_STMT, TREE_TYPE (t), t, exp);
+ stmt = build_gimple_modify_stmt (t, exp);
SET_EXPR_LOCUS (stmt, EXPR_LOCUS (tsi_stmt (*tsi)));
tsi_link_before (tsi, stmt, TSI_SAME_STMT);
tree t, stmt;
t = create_tmp_var_for (info, TREE_TYPE (exp), NULL);
- stmt = build2 (GIMPLE_MODIFY_STMT, TREE_TYPE (t), exp, t);
+ stmt = build_gimple_modify_stmt (exp, t);
SET_EXPR_LOCUS (stmt, EXPR_LOCUS (tsi_stmt (*tsi)));
tsi_link_after (tsi, stmt, TSI_SAME_STMT);
y = build3 (COMPONENT_REF, TREE_TYPE (field),
root->frame_decl, field, NULL_TREE);
- x = build2 (GIMPLE_MODIFY_STMT, TREE_TYPE (field), y, x);
+ x = build_gimple_modify_stmt (y, x);
append_to_statement_list (x, &stmt_list);
}
}
{
tree x = build3 (COMPONENT_REF, TREE_TYPE (root->chain_field),
root->frame_decl, root->chain_field, NULL_TREE);
- x = build2 (GIMPLE_MODIFY_STMT, TREE_TYPE (x), x, get_chain_decl (root));
+ x = build_gimple_modify_stmt (x, get_chain_decl (root));
append_to_statement_list (x, &stmt_list);
}
/* Convert a program in SSA form into Normal form.
- Copyright (C) 2004, 2005, 2006 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
Contributed by Andrew Macleod <amacleod@redhat.com>
This file is part of GCC.
{
tree copy;
- copy = build2 (GIMPLE_MODIFY_STMT, TREE_TYPE (dest), dest, src);
+ copy = build_gimple_modify_stmt (dest, src);
set_is_used (dest);
if (TREE_CODE (src) == ADDR_EXPR)
/* Create a new instance of the underlying variable of the
PHI result. */
- stmt = build2 (GIMPLE_MODIFY_STMT, TREE_TYPE (result_var),
- NULL_TREE, PHI_ARG_DEF (phi, i));
+ stmt = build_gimple_modify_stmt (NULL_TREE,
+ PHI_ARG_DEF (phi, i));
name = make_ssa_name (result_var, stmt);
GIMPLE_STMT_OPERAND (stmt, 0) = name;
/* Calculate branch probabilities, and basic block execution counts.
Copyright (C) 1990, 1991, 1992, 1993, 1994, 1996, 1997, 1998, 1999,
- 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+ 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
+ Free Software Foundation, Inc.
Contributed by James E. Wilson, UC Berkeley/Cygnus Support;
based on some ideas from Dain Samples of UC Berkeley.
Further mangling by Bob Manson, Cygnus Support.
tree tmp1 = create_tmp_var (gcov_type_node, "PROF");
tree tmp2 = create_tmp_var (gcov_type_node, "PROF");
tree ref = tree_coverage_counter_ref (GCOV_COUNTER_ARCS, edgeno);
- tree stmt1 = build2 (GIMPLE_MODIFY_STMT, gcov_type_node, tmp1, ref);
- tree stmt2 = build2 (GIMPLE_MODIFY_STMT, gcov_type_node, tmp2,
- build2 (PLUS_EXPR, gcov_type_node,
- tmp1, integer_one_node));
- tree stmt3 = build2 (GIMPLE_MODIFY_STMT, gcov_type_node, ref, tmp2);
+ tree one = build_int_cst (gcov_type_node, 1);
+ tree stmt1 = build_gimple_modify_stmt (tmp1, ref);
+ tree stmt2 = build_gimple_modify_stmt (tmp2,
+ build2 (PLUS_EXPR, gcov_type_node,
+ tmp1, one));
+ tree stmt3 = build_gimple_modify_stmt (ref, tmp2);
bsi_insert_on_edge (e, stmt1);
bsi_insert_on_edge (e, stmt2);
bsi_insert_on_edge (e, stmt3);
*/
tmp1 = create_tmp_var (ptr_void, "PROF");
- stmt1 = build2 (GIMPLE_MODIFY_STMT,
- build_pointer_type (get_gcov_type ()),
- ic_gcov_type_ptr_var, ref_ptr);
- stmt2 = build2 (GIMPLE_MODIFY_STMT, ptr_void, tmp1,
- unshare_expr (value->hvalue.value));
- stmt3 = build2 (GIMPLE_MODIFY_STMT, ptr_void,
- ic_void_ptr_var, tmp1);
+ stmt1 = build_gimple_modify_stmt (ic_gcov_type_ptr_var, ref_ptr);
+ stmt2 = build_gimple_modify_stmt (tmp1, unshare_expr (value->hvalue.value));
+ stmt3 = build_gimple_modify_stmt (ic_void_ptr_var, tmp1);
bsi_insert_before (&bsi, stmt1, BSI_SAME_STMT);
bsi_insert_before (&bsi, stmt2, BSI_SAME_STMT);
def = unshare_expr (def);
remove_phi_node (phi, NULL_TREE, false);
- ass = build2 (GIMPLE_MODIFY_STMT, void_type_node, rslt, NULL_TREE);
+ ass = build_gimple_modify_stmt (rslt, NULL_TREE);
SSA_NAME_DEF_STMT (rslt) = ass;
{
block_stmt_iterator dest = bsi;
anyway, there's little point in making tests and/or adding
conversions to ensure the types of src and dst are the same.
So we just assume type differences at this point are ok. */
- return build2 (GIMPLE_MODIFY_STMT, void_type_node, dst, src);
+ return build_gimple_modify_stmt (dst, src);
}
/* Generate a set of assignment statements in *LIST_P to copy all
&& outermost_invariant_loop_expr (rhs,
loop_containing_stmt (stmt)) == NULL)
{
- tree lhs, stmt1, stmt2, var, name;
+ tree lhs, stmt1, stmt2, var, name, tmp;
lhs = GENERIC_TREE_OPERAND (stmt, 0);
var = create_tmp_var (TREE_TYPE (rhs), "reciptmp");
add_referenced_var (var);
- stmt1 = build2 (GIMPLE_MODIFY_STMT, void_type_node, var,
- build2 (RDIV_EXPR, TREE_TYPE (rhs),
- build_real (TREE_TYPE (rhs), dconst1),
- TREE_OPERAND (rhs, 1)));
+ tmp = build2 (RDIV_EXPR, TREE_TYPE (rhs),
+ build_real (TREE_TYPE (rhs), dconst1),
+ TREE_OPERAND (rhs, 1));
+ stmt1 = build_gimple_modify_stmt (var, tmp);
name = make_ssa_name (var, stmt1);
GIMPLE_STMT_OPERAND (stmt1, 0) = name;
- stmt2 = build2 (GIMPLE_MODIFY_STMT, void_type_node, lhs,
- build2 (MULT_EXPR, TREE_TYPE (rhs),
- name, TREE_OPERAND (rhs, 0)));
+ tmp = build2 (MULT_EXPR, TREE_TYPE (rhs),
+ name, TREE_OPERAND (rhs, 0));
+ stmt2 = build_gimple_modify_stmt (lhs, tmp);
/* Replace division stmt with reciprocal and multiply stmts.
The multiply stmt is not invariant, so update iterator
/* Global, SSA-based optimizations using mathematical identities.
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
This file is part of GCC.
/* Make a variable with the replacement and substitute it. */
type = TREE_TYPE (def);
recip_def = make_rename_temp (type, "reciptmp");
- new_stmt = build2 (GIMPLE_MODIFY_STMT, void_type_node, recip_def,
- fold_build2 (RDIV_EXPR, type, build_one_cst (type),
- def));
+ new_stmt = build_gimple_modify_stmt (recip_def,
+ fold_build2 (RDIV_EXPR, type,
+ build_one_cst (type),
+ def));
if (occ->bb_has_division)
return;
res = make_rename_temp (TREE_TYPE (TREE_TYPE (fndecl)), "sincostmp");
call = build_call_expr (fndecl, 1, name);
- stmt = build2 (GIMPLE_MODIFY_STMT, NULL_TREE, res, call);
+ stmt = build_gimple_modify_stmt (res, call);
def_stmt = SSA_NAME_DEF_STMT (name);
if (bb_for_stmt (def_stmt) == top_bb
&& TREE_CODE (def_stmt) == GIMPLE_MODIFY_STMT)
/* Tail call optimization on trees.
- Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
This file is part of GCC.
var = m_acc;
else
{
- stmt = build2 (GIMPLE_MODIFY_STMT, ret_type, NULL_TREE,
- build2 (MULT_EXPR, ret_type, m_acc, a));
+ stmt = build_gimple_modify_stmt (NULL_TREE,
+ build2 (MULT_EXPR, ret_type,
+ m_acc, a));
tmp = create_tmp_var (ret_type, "acc_tmp");
add_referenced_var (tmp);
else
var = a;
- stmt = build2 (GIMPLE_MODIFY_STMT, ret_type, NULL_TREE,
- build2 (PLUS_EXPR, ret_type, a_acc, var));
+ stmt = build_gimple_modify_stmt (NULL_TREE, build2 (PLUS_EXPR, ret_type,
+ a_acc, var));
var = make_ssa_name (SSA_NAME_VAR (a_acc), stmt);
GIMPLE_STMT_OPERAND (stmt, 0) = var;
bsi_insert_after (&bsi, stmt, BSI_NEW_STMT);
if (m)
{
- stmt = build2 (GIMPLE_MODIFY_STMT, ret_type, NULL_TREE,
- build2 (MULT_EXPR, ret_type, m_acc, m));
+ stmt = build_gimple_modify_stmt (NULL_TREE,
+ build2 (MULT_EXPR, ret_type,
+ m_acc, m));
var = make_ssa_name (SSA_NAME_VAR (m_acc), stmt);
GIMPLE_STMT_OPERAND (stmt, 0) = var;
bsi_insert_after (&bsi, stmt, BSI_NEW_STMT);
if (m)
{
- stmt = build2 (GIMPLE_MODIFY_STMT, ret_type, NULL_TREE,
- build2 (MULT_EXPR, ret_type, m_acc, ret_var));
+ stmt = build_gimple_modify_stmt (NULL_TREE,
+ build2 (MULT_EXPR, ret_type,
+ m_acc, ret_var));
tmp = create_tmp_var (ret_type, "acc_tmp");
add_referenced_var (tmp);
if (a)
{
- stmt = build2 (GIMPLE_MODIFY_STMT, ret_type, NULL_TREE,
- build2 (PLUS_EXPR, ret_type, a_acc, var));
+ stmt = build_gimple_modify_stmt (NULL_TREE,
+ build2 (PLUS_EXPR, ret_type,
+ a_acc, var));
tmp = create_tmp_var (ret_type, "acc_tmp");
add_referenced_var (tmp);
/* Analysis Utilities for Loop Vectorization.
- Copyright (C) 2006 Free Software Foundation, Inc.
+ Copyright (C) 2006, 2007 Free Software Foundation, Inc.
Contributed by Dorit Nuzman <dorit@il.ibm.com>
This file is part of GCC.
var = create_tmp_var (pattern_type, "patt");
add_referenced_var (var);
var_name = make_ssa_name (var, NULL_TREE);
- pattern_expr = build2 (GIMPLE_MODIFY_STMT, void_type_node, var_name,
- pattern_expr);
+ pattern_expr = build_gimple_modify_stmt (var_name, pattern_expr);
SSA_NAME_DEF_STMT (var_name) = pattern_expr;
bsi_insert_before (&si, pattern_expr, BSI_SAME_STMT);
ann = stmt_ann (pattern_expr);
/* Transformation Utilities for Loop Vectorization.
- Copyright (C) 2003,2004,2005,2006 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
Contributed by Dorit Naishlos <dorit@il.ibm.com>
This file is part of GCC.
/* Create: p = (vectype *) initial_base */
vec_stmt = fold_convert (vect_ptr_type, new_temp);
- vec_stmt = build2 (GIMPLE_MODIFY_STMT, void_type_node, vect_ptr, vec_stmt);
+ vec_stmt = build_gimple_modify_stmt (vect_ptr, vec_stmt);
vect_ptr_init = make_ssa_name (vect_ptr, vec_stmt);
GIMPLE_STMT_OPERAND (vec_stmt, 0) = vect_ptr_init;
new_bb = bsi_insert_on_edge_immediate (pe, vec_stmt);
use_operand_p use_p;
tree new_dataref_ptr;
- incr_stmt = build2 (GIMPLE_MODIFY_STMT, void_type_node, ptr_var,
- build2 (PLUS_EXPR, vptr_type, dataref_ptr, update));
+ incr_stmt = build_gimple_modify_stmt (ptr_var,
+ build2 (PLUS_EXPR, vptr_type,
+ dataref_ptr, update));
new_dataref_ptr = make_ssa_name (ptr_var, incr_stmt);
GIMPLE_STMT_OPERAND (incr_stmt, 0) = new_dataref_ptr;
vect_finish_stmt_generation (stmt, incr_stmt, bsi);
new_var = vect_get_new_vect_var (vector_type, vect_simple_var, "cst_");
add_referenced_var (new_var);
- init_stmt = build2 (GIMPLE_MODIFY_STMT, void_type_node, new_var, vector_var);
+ init_stmt = build_gimple_modify_stmt (new_var, vector_var);
new_temp = make_ssa_name (new_var, init_stmt);
GIMPLE_STMT_OPERAND (init_stmt, 0) = new_temp;
t = tree_cons (NULL_TREE, init_expr, t);
for (i = 1; i < nunits; i++)
{
+ tree tmp;
+
/* Create: new_name = new_name + step_expr */
new_var = vect_get_new_vect_var (scalar_type, vect_scalar_var, "var_");
add_referenced_var (new_var);
- init_stmt = build2 (GIMPLE_MODIFY_STMT, void_type_node, new_var,
- fold_build2 (PLUS_EXPR, scalar_type, new_name, step_expr));
+ tmp = fold_build2 (PLUS_EXPR, scalar_type, new_name, step_expr);
+ init_stmt = build_gimple_modify_stmt (new_var, tmp);
new_name = make_ssa_name (new_var, init_stmt);
GIMPLE_STMT_OPERAND (init_stmt, 0) = new_name;
induc_def = PHI_RESULT (induction_phi);
/* Create the iv update inside the loop */
- new_stmt = build2 (GIMPLE_MODIFY_STMT, void_type_node, NULL_TREE,
- build2 (PLUS_EXPR, vectype, induc_def, vec_step));
+ new_stmt = build_gimple_modify_stmt (NULL_TREE,
+ build2 (PLUS_EXPR, vectype,
+ induc_def, vec_step));
vec_def = make_ssa_name (vec_dest, new_stmt);
GIMPLE_STMT_OPERAND (new_stmt, 0) = vec_def;
bsi = bsi_for_stmt (stmt);
prev_stmt_vinfo = vinfo_for_stmt (induction_phi);
for (i = 1; i < ncopies; i++)
{
+ tree tmp;
+
/* vec_i = vec_prev + vec_{step*nunits} */
-
- new_stmt = build2 (GIMPLE_MODIFY_STMT, void_type_node, NULL_TREE,
- build2 (PLUS_EXPR, vectype, vec_def, vec_step));
+ tmp = build2 (PLUS_EXPR, vectype, vec_def, vec_step);
+ new_stmt = build_gimple_modify_stmt (NULL_TREE, tmp);
vec_def = make_ssa_name (vec_dest, new_stmt);
GIMPLE_STMT_OPERAND (new_stmt, 0) = vec_def;
bsi = bsi_for_stmt (stmt);
if (reduc_code < NUM_TREE_CODES)
{
+ tree tmp;
+
/*** Case 1: Create:
v_out2 = reduc_expr <v_out1> */
fprintf (vect_dump, "Reduce using direct vector reduction.");
vec_dest = vect_create_destination_var (scalar_dest, vectype);
- epilog_stmt = build2 (GIMPLE_MODIFY_STMT, void_type_node, vec_dest,
- build1 (reduc_code, vectype, PHI_RESULT (new_phi)));
+ tmp = build1 (reduc_code, vectype, PHI_RESULT (new_phi));
+ epilog_stmt = build_gimple_modify_stmt (vec_dest, tmp);
new_temp = make_ssa_name (vec_dest, epilog_stmt);
GIMPLE_STMT_OPERAND (epilog_stmt, 0) = new_temp;
bsi_insert_after (&exit_bsi, epilog_stmt, BSI_NEW_STMT);
bit_offset /= 2)
{
tree bitpos = size_int (bit_offset);
-
- epilog_stmt = build2 (GIMPLE_MODIFY_STMT, void_type_node,
- vec_dest,
- build2 (shift_code, vectype,
- new_temp, bitpos));
+ tree tmp = build2 (shift_code, vectype, new_temp, bitpos);
+ epilog_stmt = build_gimple_modify_stmt (vec_dest, tmp);
new_name = make_ssa_name (vec_dest, epilog_stmt);
GIMPLE_STMT_OPERAND (epilog_stmt, 0) = new_name;
bsi_insert_after (&exit_bsi, epilog_stmt, BSI_NEW_STMT);
- epilog_stmt = build2 (GIMPLE_MODIFY_STMT, void_type_node,
- vec_dest,
- build2 (code, vectype,
- new_name, new_temp));
+ tmp = build2 (code, vectype, new_name, new_temp);
+ epilog_stmt = build_gimple_modify_stmt (vec_dest, tmp);
new_temp = make_ssa_name (vec_dest, epilog_stmt);
GIMPLE_STMT_OPERAND (epilog_stmt, 0) = new_temp;
bsi_insert_after (&exit_bsi, epilog_stmt, BSI_NEW_STMT);
rhs = build3 (BIT_FIELD_REF, scalar_type, vec_temp, bitsize,
bitsize_zero_node);
BIT_FIELD_REF_UNSIGNED (rhs) = TYPE_UNSIGNED (scalar_type);
- epilog_stmt = build2 (GIMPLE_MODIFY_STMT, void_type_node,
- new_scalar_dest, rhs);
+ epilog_stmt = build_gimple_modify_stmt (new_scalar_dest, rhs);
new_temp = make_ssa_name (new_scalar_dest, epilog_stmt);
GIMPLE_STMT_OPERAND (epilog_stmt, 0) = new_temp;
bsi_insert_after (&exit_bsi, epilog_stmt, BSI_NEW_STMT);
bit_offset < vec_size_in_bits;
bit_offset += element_bitsize)
{
+ tree tmp;
tree bitpos = bitsize_int (bit_offset);
tree rhs = build3 (BIT_FIELD_REF, scalar_type, vec_temp, bitsize,
bitpos);
BIT_FIELD_REF_UNSIGNED (rhs) = TYPE_UNSIGNED (scalar_type);
- epilog_stmt = build2 (GIMPLE_MODIFY_STMT, void_type_node,
- new_scalar_dest, rhs);
+ epilog_stmt = build_gimple_modify_stmt (new_scalar_dest, rhs);
new_name = make_ssa_name (new_scalar_dest, epilog_stmt);
GIMPLE_STMT_OPERAND (epilog_stmt, 0) = new_name;
bsi_insert_after (&exit_bsi, epilog_stmt, BSI_NEW_STMT);
- epilog_stmt = build2 (GIMPLE_MODIFY_STMT, void_type_node,
- new_scalar_dest,
- build2 (code, scalar_type, new_name, new_temp));
+ tmp = build2 (code, scalar_type, new_name, new_temp);
+ epilog_stmt = build_gimple_modify_stmt (new_scalar_dest, tmp);
new_temp = make_ssa_name (new_scalar_dest, epilog_stmt);
GIMPLE_STMT_OPERAND (epilog_stmt, 0) = new_temp;
bsi_insert_after (&exit_bsi, epilog_stmt, BSI_NEW_STMT);
rhs = build3 (BIT_FIELD_REF, scalar_type, new_temp, bitsize, bitpos);
BIT_FIELD_REF_UNSIGNED (rhs) = TYPE_UNSIGNED (scalar_type);
- epilog_stmt = build2 (GIMPLE_MODIFY_STMT, void_type_node,
- new_scalar_dest, rhs);
+ epilog_stmt = build_gimple_modify_stmt (new_scalar_dest, rhs);
new_temp = make_ssa_name (new_scalar_dest, epilog_stmt);
GIMPLE_STMT_OPERAND (epilog_stmt, 0) = new_temp;
bsi_insert_after (&exit_bsi, epilog_stmt, BSI_NEW_STMT);
if (scalar_initial_def)
{
- epilog_stmt = build2 (GIMPLE_MODIFY_STMT, void_type_node,
- new_scalar_dest,
- build2 (code, scalar_type, new_temp, scalar_initial_def));
+ tree tmp = build2 (code, scalar_type, new_temp, scalar_initial_def);
+ epilog_stmt = build_gimple_modify_stmt (new_scalar_dest, tmp);
new_temp = make_ssa_name (new_scalar_dest, epilog_stmt);
GIMPLE_STMT_OPERAND (epilog_stmt, 0) = new_temp;
bsi_insert_after (&exit_bsi, epilog_stmt, BSI_NEW_STMT);
else
expr = build3 (code, vectype, loop_vec_def0, loop_vec_def1,
reduc_def);
- new_stmt = build2 (GIMPLE_MODIFY_STMT, void_type_node, vec_dest, expr);
+ new_stmt = build_gimple_modify_stmt (vec_dest, expr);
new_temp = make_ssa_name (vec_dest, new_stmt);
GIMPLE_STMT_OPERAND (new_stmt, 0) = new_temp;
vect_finish_stmt_generation (stmt, new_stmt, bsi);
vargs = nreverse (vargs);
rhs = build_function_call_expr (fndecl, vargs);
- new_stmt = build2 (GIMPLE_MODIFY_STMT, NULL_TREE, vec_dest, rhs);
+ new_stmt = build_gimple_modify_stmt (vec_dest, rhs);
new_temp = make_ssa_name (vec_dest, new_stmt);
GIMPLE_STMT_OPERAND (new_stmt, 0) = new_temp;
new_stmt = build_call_expr (builtin_decl, 1, vec_oprnd0);
/* Arguments are ready. create the new vector stmt. */
- new_stmt = build2 (GIMPLE_MODIFY_STMT, void_type_node, vec_dest,
- new_stmt);
+ new_stmt = build_gimple_modify_stmt (vec_dest, new_stmt);
new_temp = make_ssa_name (vec_dest, new_stmt);
GIMPLE_STMT_OPERAND (new_stmt, 0) = new_temp;
vect_finish_stmt_generation (stmt, new_stmt, bsi);
vec_oprnd = vect_get_vec_def_for_operand (op, stmt, NULL);
/* Arguments are ready. create the new vector stmt. */
- *vec_stmt = build2 (GIMPLE_MODIFY_STMT, void_type_node, vec_dest, vec_oprnd);
+ *vec_stmt = build_gimple_modify_stmt (vec_dest, vec_oprnd);
new_temp = make_ssa_name (vec_dest, *vec_stmt);
GIMPLE_STMT_OPERAND (*vec_stmt, 0) = new_temp;
vect_finish_stmt_generation (stmt, *vec_stmt, bsi);
/* Arguments are ready. create the new vector stmt. */
if (op_type == binary_op)
- new_stmt = build2 (GIMPLE_MODIFY_STMT, void_type_node, vec_dest,
+ new_stmt = build_gimple_modify_stmt (vec_dest,
build2 (code, vectype, vec_oprnd0, vec_oprnd1));
else
- new_stmt = build2 (GIMPLE_MODIFY_STMT, void_type_node, vec_dest,
+ new_stmt = build_gimple_modify_stmt (vec_dest,
build1 (code, vectype, vec_oprnd0));
new_temp = make_ssa_name (vec_dest, new_stmt);
GIMPLE_STMT_OPERAND (new_stmt, 0) = new_temp;
/* Arguments are ready. Create the new vector stmt. */
expr = build2 (code, vectype_out, vec_oprnd0, vec_oprnd1);
- new_stmt = build2 (GIMPLE_MODIFY_STMT, void_type_node, vec_dest, expr);
+ new_stmt = build_gimple_modify_stmt (vec_dest, expr);
new_temp = make_ssa_name (vec_dest, new_stmt);
GIMPLE_STMT_OPERAND (new_stmt, 0) = new_temp;
vect_finish_stmt_generation (stmt, new_stmt, bsi);
else
expr = build1 (code, vectype, vec_oprnd0);
}
- new_stmt = build2 (GIMPLE_MODIFY_STMT, void_type_node, vec_dest, expr);
+ new_stmt = build_gimple_modify_stmt (vec_dest, expr);
new_temp = make_ssa_name (vec_dest, new_stmt);
GIMPLE_STMT_OPERAND (new_stmt, 0) = new_temp;
vect_finish_stmt_generation (stmt, new_stmt, bsi);
{
tree perm_dest, perm_stmt, vect1, vect2, high, low;
tree vectype = STMT_VINFO_VECTYPE (vinfo_for_stmt (stmt));
- tree scalar_dest;
+ tree scalar_dest, tmp;
int i;
unsigned int j;
VEC(tree,heap) *first, *second;
DECL_GIMPLE_REG_P (perm_dest) = 1;
add_referenced_var (perm_dest);
if (BYTES_BIG_ENDIAN)
- perm_stmt = build2 (GIMPLE_MODIFY_STMT, void_type_node, perm_dest,
- build2 (VEC_INTERLEAVE_HIGH_EXPR, vectype,
- vect1, vect2));
+ tmp = build2 (VEC_INTERLEAVE_HIGH_EXPR, vectype, vect1, vect2);
else
- perm_stmt = build2 (GIMPLE_MODIFY_STMT, void_type_node, perm_dest,
- build2 (VEC_INTERLEAVE_LOW_EXPR, vectype,
- vect1, vect2));
+ tmp = build2 (VEC_INTERLEAVE_LOW_EXPR, vectype, vect1, vect2);
+ perm_stmt = build_gimple_modify_stmt (perm_dest, tmp);
high = make_ssa_name (perm_dest, perm_stmt);
GIMPLE_STMT_OPERAND (perm_stmt, 0) = high;
vect_finish_stmt_generation (stmt, perm_stmt, bsi);
DECL_GIMPLE_REG_P (perm_dest) = 1;
add_referenced_var (perm_dest);
if (BYTES_BIG_ENDIAN)
- perm_stmt = build2 (GIMPLE_MODIFY_STMT, void_type_node, perm_dest,
- build2 (VEC_INTERLEAVE_LOW_EXPR, vectype,
- vect1, vect2));
+ tmp = build2 (VEC_INTERLEAVE_LOW_EXPR, vectype, vect1, vect2);
else
- perm_stmt = build2 (GIMPLE_MODIFY_STMT, void_type_node, perm_dest,
- build2 (VEC_INTERLEAVE_HIGH_EXPR, vectype,
- vect1, vect2));
+ tmp = build2 (VEC_INTERLEAVE_HIGH_EXPR, vectype, vect1, vect2);
+ perm_stmt = build_gimple_modify_stmt (perm_dest, tmp);
low = make_ssa_name (perm_dest, perm_stmt);
GIMPLE_STMT_OPERAND (perm_stmt, 0) = low;
vect_finish_stmt_generation (stmt, perm_stmt, bsi);
data_ref = build_fold_indirect_ref (dataref_ptr);
/* Arguments are ready. Create the new vector stmt. */
- new_stmt = build2 (GIMPLE_MODIFY_STMT, void_type_node, data_ref,
- vec_oprnd);
+ new_stmt = build_gimple_modify_stmt (data_ref, vec_oprnd);
vect_finish_stmt_generation (stmt, new_stmt, bsi);
/* Set the VDEFs for the vector pointer. If this virtual def
ptr = vect_create_data_ref_ptr (stmt, bsi, NULL_TREE, &init_addr, &inc, true,
NULL_TREE);
data_ref = build1 (ALIGN_INDIRECT_REF, vectype, ptr);
- new_stmt = build2 (GIMPLE_MODIFY_STMT, void_type_node, vec_dest, data_ref);
+ new_stmt = build_gimple_modify_stmt (vec_dest, data_ref);
new_temp = make_ssa_name (vec_dest, new_stmt);
GIMPLE_STMT_OPERAND (new_stmt, 0) = new_temp;
new_bb = bsi_insert_on_edge_immediate (pe, new_stmt);
new_stmt = build_call_expr (builtin_decl, 1, init_addr);
vec_dest = vect_create_destination_var (scalar_dest,
TREE_TYPE (new_stmt));
- new_stmt = build2 (GIMPLE_MODIFY_STMT, void_type_node, vec_dest,
- new_stmt);
+ new_stmt = build_gimple_modify_stmt (vec_dest, new_stmt);
new_temp = make_ssa_name (vec_dest, new_stmt);
GIMPLE_STMT_OPERAND (new_stmt, 0) = new_temp;
new_bb = bsi_insert_on_edge_immediate (pe, new_stmt);
{
tree perm_dest, perm_stmt, data_ref, first_vect, second_vect;
tree vectype = STMT_VINFO_VECTYPE (vinfo_for_stmt (stmt));
+ tree tmp;
int i;
unsigned int j;
perm_dest = create_tmp_var (vectype, "vect_perm_even");
DECL_GIMPLE_REG_P (perm_dest) = 1;
add_referenced_var (perm_dest);
-
- perm_stmt = build2 (GIMPLE_MODIFY_STMT, void_type_node, perm_dest,
- build2 (VEC_EXTRACT_EVEN_EXPR, vectype,
- first_vect, second_vect));
+
+ tmp = build2 (VEC_EXTRACT_EVEN_EXPR, vectype,
+ first_vect, second_vect);
+ perm_stmt = build_gimple_modify_stmt (perm_dest, tmp);
data_ref = make_ssa_name (perm_dest, perm_stmt);
GIMPLE_STMT_OPERAND (perm_stmt, 0) = data_ref;
DECL_GIMPLE_REG_P (perm_dest) = 1;
add_referenced_var (perm_dest);
- perm_stmt = build2 (GIMPLE_MODIFY_STMT, void_type_node, perm_dest,
- build2 (VEC_EXTRACT_ODD_EXPR, vectype,
- first_vect, second_vect));
+ tmp = build2 (VEC_EXTRACT_ODD_EXPR, vectype,
+ first_vect, second_vect);
+ perm_stmt = build_gimple_modify_stmt (perm_dest, tmp);
data_ref = make_ssa_name (perm_dest, perm_stmt);
GIMPLE_STMT_OPERAND (perm_stmt, 0) = data_ref;
vect_finish_stmt_generation (stmt, perm_stmt, bsi);
gcc_unreachable ();
}
vec_dest = vect_create_destination_var (scalar_dest, vectype);
- new_stmt = build2 (GIMPLE_MODIFY_STMT, void_type_node, vec_dest,
- data_ref);
+ new_stmt = build_gimple_modify_stmt (vec_dest, data_ref);
new_temp = make_ssa_name (vec_dest, new_stmt);
GIMPLE_STMT_OPERAND (new_stmt, 0) = new_temp;
vect_finish_stmt_generation (stmt, new_stmt, bsi);
vec_dest = vect_create_destination_var (scalar_dest, vectype);
new_stmt =
build3 (REALIGN_LOAD_EXPR, vectype, msq, lsq, realignment_token);
- new_stmt = build2 (GIMPLE_MODIFY_STMT, void_type_node, vec_dest,
- new_stmt);
+ new_stmt = build_gimple_modify_stmt (vec_dest, new_stmt);
new_temp = make_ssa_name (vec_dest, new_stmt);
GIMPLE_STMT_OPERAND (new_stmt, 0) = new_temp;
vect_finish_stmt_generation (stmt, new_stmt, bsi);
vec_cond_expr = build3 (VEC_COND_EXPR, vectype,
vec_compare, vec_then_clause, vec_else_clause);
- *vec_stmt = build2 (GIMPLE_MODIFY_STMT, void_type_node, vec_dest,
- vec_cond_expr);
+ *vec_stmt = build_gimple_modify_stmt (vec_dest, vec_cond_expr);
new_temp = make_ssa_name (vec_dest, *vec_stmt);
GIMPLE_STMT_OPERAND (*vec_stmt, 0) = new_temp;
vect_finish_stmt_generation (stmt, *vec_stmt, bsi);
{
VEC(tree,heap) *may_misalign_stmts
= LOOP_VINFO_MAY_MISALIGN_STMTS (loop_vinfo);
- tree ref_stmt;
+ tree ref_stmt, tmp;
int mask = LOOP_VINFO_PTR_MASK (loop_vinfo);
tree mask_cst;
unsigned int i;
add_referenced_var (addr_tmp);
addr_tmp_name = make_ssa_name (addr_tmp, NULL_TREE);
addr_stmt = fold_convert (int_ptrsize_type, addr_base);
- addr_stmt = build2 (GIMPLE_MODIFY_STMT, void_type_node,
- addr_tmp_name, addr_stmt);
+ addr_stmt = build_gimple_modify_stmt (addr_tmp_name, addr_stmt);
SSA_NAME_DEF_STMT (addr_tmp_name) = addr_stmt;
append_to_statement_list_force (addr_stmt, cond_expr_stmt_list);
or_tmp = create_tmp_var (int_ptrsize_type, tmp_name);
add_referenced_var (or_tmp);
new_or_tmp_name = make_ssa_name (or_tmp, NULL_TREE);
- or_stmt = build2 (GIMPLE_MODIFY_STMT, void_type_node,
- new_or_tmp_name,
- build2 (BIT_IOR_EXPR, int_ptrsize_type,
- or_tmp_name,
- addr_tmp_name));
+ tmp = build2 (BIT_IOR_EXPR, int_ptrsize_type,
+ or_tmp_name, addr_tmp_name);
+ or_stmt = build_gimple_modify_stmt (new_or_tmp_name, tmp);
SSA_NAME_DEF_STMT (new_or_tmp_name) = or_stmt;
append_to_statement_list_force (or_stmt, cond_expr_stmt_list);
or_tmp_name = new_or_tmp_name;
add_referenced_var (and_tmp);
and_tmp_name = make_ssa_name (and_tmp, NULL_TREE);
- and_stmt = build2 (GIMPLE_MODIFY_STMT, void_type_node,
- and_tmp_name,
- build2 (BIT_AND_EXPR, int_ptrsize_type,
- or_tmp_name, mask_cst));
+ tmp = build2 (BIT_AND_EXPR, int_ptrsize_type, or_tmp_name, mask_cst);
+ and_stmt = build_gimple_modify_stmt (and_tmp_name, tmp);
SSA_NAME_DEF_STMT (and_tmp_name) = and_stmt;
append_to_statement_list_force (and_stmt, cond_expr_stmt_list);
if (COMPARISON_CLASS_P (cond))
{
tree a = build2 (ASSERT_EXPR, TREE_TYPE (v), v, cond);
- assertion = build2 (GIMPLE_MODIFY_STMT, TREE_TYPE (v), n, a);
+ assertion = build_gimple_modify_stmt (n, a);
}
else if (TREE_CODE (cond) == TRUTH_NOT_EXPR)
{
/* Given !V, build the assignment N = false. */
tree op0 = TREE_OPERAND (cond, 0);
gcc_assert (op0 == v);
- assertion = build2 (GIMPLE_MODIFY_STMT, TREE_TYPE (v), n,
- boolean_false_node);
+ assertion = build_gimple_modify_stmt (n, boolean_false_node);
}
else if (TREE_CODE (cond) == SSA_NAME)
{
/* Given V, build the assignment N = true. */
gcc_assert (v == cond);
- assertion = build2 (GIMPLE_MODIFY_STMT,
- TREE_TYPE (v), n, boolean_true_node);
+ assertion = build_gimple_modify_stmt (n, boolean_true_node);
}
else
gcc_unreachable ();