* gimple.h (gimple_phi_set_result): Adjust SSA_NAME_DEF_STMT.
* tree-phinodes.c (make_phi_node): Allow a NULL var.
* tree-into-ssa.c (insert_phi_nodes_for): Simplify.
* tree-complex.c (update_phi_components): Likewise.
* tree-ssa-loop-manip.c (create_iv): Likewise.
(add_exit_phis_edge): Likewise.
(split_loop_exit_edge): Likewise.
(tree_transform_and_unroll_loop): Likewise.
* value-prof.c (gimple_ic): Likewise.
(gimple_stringop_fixed_value): Likewise.
* tree-tailcall.c (tree_optimize_tail_calls_1): Likewise.
* omp-low.c (expand_parallel_call): Likewise.
(expand_omp_for_static_chunk): Likewise.
(expand_omp_atomic_pipeline): Likewise.
* tree-parloops.c (create_phi_for_local_result): Likewise.
(transform_to_exit_first_loop): Likewise.
* tree-vect-data-refs.c (vect_setup_realignment): Likewise.
* graphite-scop-detection.c (canonicalize_loop_closed_ssa): Likewise.
* tree-predcom.c (initialize_root_vars): Likewise.
(initialize_root_vars_lm): Likewise.
* sese.c (sese_add_exit_phis_edge): Likewise.
* gimple-streamer-in.c (input_phi): Likewise.
* tree-inline.c (copy_phis_for_bb): Likewise.
* tree-ssa-phiprop.c (phiprop_insert_phi): Likewise.
* tree-cfg.c (gimple_make_forwarder_block): Likewise.
(gimple_duplicate_bb): Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@190199
138bc75d-0d04-0410-961f-
82ee72b054a4
+2012-08-07 Richard Guenther <rguenther@suse.de>
+
+ * gimple.h (gimple_phi_set_result): Adjust SSA_NAME_DEF_STMT.
+ * tree-phinodes.c (make_phi_node): Allow a NULL var.
+ * tree-into-ssa.c (insert_phi_nodes_for): Simplify.
+ * tree-complex.c (update_phi_components): Likewise.
+ * tree-ssa-loop-manip.c (create_iv): Likewise.
+ (add_exit_phis_edge): Likewise.
+ (split_loop_exit_edge): Likewise.
+ (tree_transform_and_unroll_loop): Likewise.
+ * value-prof.c (gimple_ic): Likewise.
+ (gimple_stringop_fixed_value): Likewise.
+ * tree-tailcall.c (tree_optimize_tail_calls_1): Likewise.
+ * omp-low.c (expand_parallel_call): Likewise.
+ (expand_omp_for_static_chunk): Likewise.
+ (expand_omp_atomic_pipeline): Likewise.
+ * tree-parloops.c (create_phi_for_local_result): Likewise.
+ (transform_to_exit_first_loop): Likewise.
+ * tree-vect-data-refs.c (vect_setup_realignment): Likewise.
+ * graphite-scop-detection.c (canonicalize_loop_closed_ssa): Likewise.
+ * tree-predcom.c (initialize_root_vars): Likewise.
+ (initialize_root_vars_lm): Likewise.
+ * sese.c (sese_add_exit_phis_edge): Likewise.
+ * gimple-streamer-in.c (input_phi): Likewise.
+ * tree-inline.c (copy_phis_for_bb): Likewise.
+ * tree-ssa-phiprop.c (phiprop_insert_phi): Likewise.
+ * tree-cfg.c (gimple_make_forwarder_block): Likewise.
+ (gimple_duplicate_bb): Likewise.
+
2012-08-07 Nick Clifton <nickc@redhat.com>
* config/mn10300/mn10300.c (mn10300_expand_prologue): Report
phi_result = VEC_index (tree, SSANAMES (fn), ix);
len = EDGE_COUNT (bb->preds);
result = create_phi_node (phi_result, bb);
- SSA_NAME_DEF_STMT (phi_result) = result;
/* We have to go through a lookup process here because the preds in the
reconstructed graph are generally in a different order than they
{
GIMPLE_CHECK (gs, GIMPLE_PHI);
gs->gimple_phi.result = result;
+ if (result && TREE_CODE (result) == SSA_NAME)
+ SSA_NAME_DEF_STMT (result) = gs;
}
if (TREE_CODE (arg) != SSA_NAME)
continue;
- close_phi = create_phi_node (arg, close);
- res = create_new_def_for (gimple_phi_result (close_phi),
- close_phi,
+ close_phi = create_phi_node (NULL_TREE, close);
+ res = create_new_def_for (arg, close_phi,
gimple_phi_result_ptr (close_phi));
add_phi_arg (close_phi, arg,
gimple_phi_arg_edge (close_phi, 0),
if (gimple_in_ssa_p (cfun))
{
gimple phi = create_phi_node (tmp_join, bb);
- SSA_NAME_DEF_STMT (tmp_join) = phi;
add_phi_arg (phi, tmp_then, e_then, UNKNOWN_LOCATION);
add_phi_arg (phi, tmp_else, e_else, UNKNOWN_LOCATION);
}
t = gimple_phi_result (phi);
gcc_assert (t == redirect_edge_var_map_result (vm));
nphi = create_phi_node (t, iter_part_bb);
- SSA_NAME_DEF_STMT (t) = nphi;
t = PHI_ARG_DEF_FROM_EDGE (phi, se);
locus = gimple_phi_arg_location_from_edge (phi, se);
/* Make phi node for trip. */
phi = create_phi_node (trip_main, iter_part_bb);
- SSA_NAME_DEF_STMT (trip_main) = phi;
add_phi_arg (phi, trip_back, single_succ_edge (trip_update_bb),
UNKNOWN_LOCATION);
add_phi_arg (phi, trip_init, single_succ_edge (entry_bb),
{
gcc_assert (gimple_seq_empty_p (phi_nodes (loop_header)));
phi = create_phi_node (loadedi, loop_header);
- SSA_NAME_DEF_STMT (loadedi) = phi;
SET_USE (PHI_ARG_DEF_PTR_FROM_EDGE (phi, single_succ_edge (load_bb)),
initial);
}
static void
sese_add_exit_phis_edge (basic_block exit, tree use, edge false_e, edge true_e)
{
- gimple phi = create_phi_node (use, exit);
-
- create_new_def_for (gimple_phi_result (phi), phi,
- gimple_phi_result_ptr (phi));
+ gimple phi = create_phi_node (NULL_TREE, exit);
+ create_new_def_for (use, phi, gimple_phi_result_ptr (phi));
add_phi_arg (phi, use, false_e, UNKNOWN_LOCATION);
add_phi_arg (phi, use, true_e, UNKNOWN_LOCATION);
}
phi = gsi_stmt (gsi);
var = gimple_phi_result (phi);
new_phi = create_phi_node (var, bb);
- SSA_NAME_DEF_STMT (var) = new_phi;
gimple_phi_set_result (phi, make_ssa_name (SSA_NAME_VAR (var), phi));
add_phi_arg (new_phi, gimple_phi_result (phi), fallthru,
UNKNOWN_LOCATION);
for (gsi = gsi_start (phis); !gsi_end_p (gsi); gsi_next (&gsi))
{
phi = gsi_stmt (gsi);
- copy = create_phi_node (gimple_phi_result (phi), new_bb);
- create_new_def_for (gimple_phi_result (copy), copy,
+ copy = create_phi_node (NULL_TREE, new_bb);
+ create_new_def_for (gimple_phi_result (phi), copy,
gimple_phi_result_ptr (copy));
}
lr = get_component_ssa_name (gimple_phi_result (phi), false);
if (TREE_CODE (lr) == SSA_NAME)
- {
- pr = create_phi_node (lr, bb);
- SSA_NAME_DEF_STMT (lr) = pr;
- }
+ pr = create_phi_node (lr, bb);
li = get_component_ssa_name (gimple_phi_result (phi), true);
if (TREE_CODE (li) == SSA_NAME)
- {
- pi = create_phi_node (li, bb);
- SSA_NAME_DEF_STMT (li) = pi;
- }
+ pi = create_phi_node (li, bb);
for (i = 0, n = gimple_phi_num_args (phi); i < n; ++i)
{
if (is_gimple_reg (res))
{
walk_tree (&new_res, copy_tree_body_r, id, NULL);
- SSA_NAME_DEF_STMT (new_res)
- = new_phi = create_phi_node (new_res, new_bb);
+ new_phi = create_phi_node (new_res, new_bb);
FOR_EACH_EDGE (new_edge, ei, new_bb->preds)
{
edge old_edge = find_edge ((basic_block) new_edge->src->aux, bb);
tree new_lhs;
gcc_assert (update_p);
- phi = create_phi_node (var, bb);
-
- new_lhs = duplicate_ssa_name (var, phi);
- gimple_phi_set_result (phi, new_lhs);
+ new_lhs = duplicate_ssa_name (var, NULL);
+ phi = create_phi_node (new_lhs, bb);
add_new_name_mapping (new_lhs, var);
/* Add VAR to every argument slot of PHI. We need VAR in
NULL);
locus = gimple_location (reduc->reduc_stmt);
new_phi = create_phi_node (local_res, store_bb);
- SSA_NAME_DEF_STMT (local_res) = new_phi;
add_phi_arg (new_phi, reduc->init, e, locus);
add_phi_arg (new_phi, gimple_assign_lhs (reduc->reduc_stmt),
FALLTHRU_EDGE (loop->latch), locus);
t = make_ssa_name (SSA_NAME_VAR (res), phi);
SET_PHI_RESULT (phi, t);
nphi = create_phi_node (res, orig_header);
- SSA_NAME_DEF_STMT (res) = nphi;
add_phi_arg (nphi, t, hpred, UNKNOWN_LOCATION);
if (res == control)
gimple_init_singleton (phi);
phi->gimple_phi.nargs = len;
phi->gimple_phi.capacity = capacity;
- if (TREE_CODE (var) == SSA_NAME)
+ if (!var)
+ ;
+ else if (TREE_CODE (var) == SSA_NAME)
gimple_phi_set_result (phi, var);
else
gimple_phi_set_result (phi, make_ssa_name (var, phi));
gsi_insert_seq_on_edge_immediate (entry, stmts);
phi = create_phi_node (var, loop->header);
- SSA_NAME_DEF_STMT (var) = phi;
add_phi_arg (phi, init, entry, UNKNOWN_LOCATION);
add_phi_arg (phi, next, latch, UNKNOWN_LOCATION);
}
{
next = VEC_index (tree, *vars, 1);
phi = create_phi_node (var, loop->header);
- SSA_NAME_DEF_STMT (var) = phi;
add_phi_arg (phi, init, entry, UNKNOWN_LOCATION);
add_phi_arg (phi, next, latch, UNKNOWN_LOCATION);
}
gsi_insert_seq_on_edge_immediate (pe, stmts);
stmt = create_phi_node (vb, loop->header);
- SSA_NAME_DEF_STMT (vb) = stmt;
add_phi_arg (stmt, initial, loop_preheader_edge (loop), UNKNOWN_LOCATION);
add_phi_arg (stmt, va, loop_latch_edge (loop), UNKNOWN_LOCATION);
}
if (!e)
return;
- phi = create_phi_node (use, exit);
- create_new_def_for (gimple_phi_result (phi), phi,
- gimple_phi_result_ptr (phi));
+ phi = create_phi_node (NULL_TREE, exit);
+ create_new_def_for (use, phi, gimple_phi_result_ptr (phi));
FOR_EACH_EDGE (e, ei, exit->preds)
add_phi_arg (phi, use, e, UNKNOWN_LOCATION);
}
of the SSA name out of the loop. */
new_name = duplicate_ssa_name (name, NULL);
new_phi = create_phi_node (new_name, bb);
- SSA_NAME_DEF_STMT (new_name) = new_phi;
add_phi_arg (new_phi, name, exit, locus);
SET_USE (op_p, new_name);
}
new_init = make_ssa_name (var, NULL);
phi_rest = create_phi_node (new_init, rest);
- SSA_NAME_DEF_STMT (new_init) = phi_rest;
add_phi_arg (phi_rest, init, precond_edge, UNKNOWN_LOCATION);
add_phi_arg (phi_rest, next, new_exit, UNKNOWN_LOCATION);
/* Build a new PHI node to replace the definition of
the indirect reference lhs. */
res = gimple_assign_lhs (use_stmt);
- SSA_NAME_DEF_STMT (res) = new_phi = create_phi_node (res, bb);
+ new_phi = create_phi_node (res, bb);
if (dump_file && (dump_flags & TDF_DETAILS))
{
set_ssa_default_def (cfun, param, new_name);
phi = create_phi_node (name, first);
- SSA_NAME_DEF_STMT (name) = phi;
add_phi_arg (phi, new_name, single_pred_edge (first),
EXPR_LOCATION (param));
}
vec_dest = vect_create_destination_var (scalar_dest, vectype);
msq = make_ssa_name (vec_dest, NULL);
phi_stmt = create_phi_node (msq, containing_loop->header);
- SSA_NAME_DEF_STMT (msq) = phi_stmt;
add_phi_arg (phi_stmt, msq_init, pe, UNKNOWN_LOCATION);
return msq;
{
tree result = gimple_call_lhs (icall_stmt);
gimple phi = create_phi_node (result, join_bb);
- SSA_NAME_DEF_STMT (result) = phi;
gimple_call_set_lhs (icall_stmt,
make_ssa_name (SSA_NAME_VAR (result), icall_stmt));
add_phi_arg (phi, gimple_call_lhs (icall_stmt), e_ij, UNKNOWN_LOCATION);
{
tree result = gimple_call_lhs (vcall_stmt);
gimple phi = create_phi_node (result, join_bb);
- SSA_NAME_DEF_STMT (result) = phi;
gimple_call_set_lhs (vcall_stmt,
make_ssa_name (SSA_NAME_VAR (result), vcall_stmt));
add_phi_arg (phi, gimple_call_lhs (vcall_stmt), e_vj, UNKNOWN_LOCATION);