summaryrefslogtreecommitdiff
path: root/gcc/tree-vect-loop-manip.c
diff options
context:
space:
mode:
authoramacleod <amacleod@138bc75d-0d04-0410-961f-82ee72b054a4>2009-07-30 18:36:30 +0000
committeramacleod <amacleod@138bc75d-0d04-0410-961f-82ee72b054a4>2009-07-30 18:36:30 +0000
commitefbcb6defd4842cee3bc73eec195fe425457ea13 (patch)
treec3c37452d20254e178bef3a30aeb83c4cc6ef27e /gcc/tree-vect-loop-manip.c
parent465afad97843b82f6b4a416c80add1988605e3a4 (diff)
downloadgcc-efbcb6defd4842cee3bc73eec195fe425457ea13.tar.gz
Add source_location support to PHI arguments.
2009-07-29 Andrew MacLeod <amacleod@redhat.com> PR debug 26475 * tree-into-ssa.c (insert_phi_nodes_for, rewrite_add_phi_arguments): Set location for phi arguments. (rewrite_update_phi_arguments): Find locations for reaching defs. * tree-ssa-threadupdate.c (create_edge_and_update_destination_phis): Add location to add_phi_arg calls. * tree-loop-districbution.c (update_phis_for_loop_copy): Add locations. * tree-ssa-loop-manip.c (create_iv, add_exit_phis_edge, split_loop_exit_edge, tree_transform_and_unroll_loop): Add locations. * tree-tailcall.c (add_successor_phi_arg, eliminate_tail_call, create_tailcall_accumulator, tree_optimize_tail_calls_1): Add locations. * tree.h (struct phi_arg_d): Add location_t to PHI arguments. * tree-phinodes.c (make_phi_node): Initialize location. (resize_phi_node): Initialize location to UNKNOWN_LOCATION. (add_phi_arg): Add location parameter. (remove_phi_arg_num): Move location when moving phi argument. * omp-low.c (expand_parallel_call, expand_omp_for_static_chunk): Set location. * tree-vect-loop-manip.c (slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_tree_duplicate_loop_to_edge_cfg, set_prologue_iterations, vect_loop_versioning): Set locations. * tree-parloops.c (create_phi_for_local_result, transform_to_exit_first_loop, create_parallel_loop): Add locations. * gimple-pretty-print.c (dump_gimple_phi): Dump lineno's if present. * tree-vect-loop.c (get_initial_def_for_induction, vect_create_epilog_for_reduction, vect_finalize_reduction): Add locations. * tree-flow-inline.h (gimple_phi_arg_location): New. Return locus. (gimple_phi_arg_location_from_edge): New. Return locus from an edge. (gimple_phi_arg_set_location): New. Set locus. (gimple_phi_arg_has_location): New. Check for locus. (redirect_edge_var_map_location): New. Return locus from var_map. * tree-vect-data-refs.c (vect_setup_realignment): Set location. * tree-ssa-phiopt.c (conditional_replacement): Set locus when combining PHI arguments. (cond_store_replacement): Set location. * cfgexpand.c (gimple_assign_rhs_to_tree): Transfer locus if possible. * grpahite.c (add_loop_exit_phis, add_guard_exit_phis, scop_add_exit_phis_edge): Add locations. * tree-cfgcleanup.c (remove_forwarder_block, remove_forwarder_block_with_phi): Add locations. * tree-ssa-pre.c (insert_into_preds_of_block): Add locations. * tree-predcom.c (initialize_root_vars, initialize_root_vars_lm): Add locations. * tree-ssa-dce.c (forward_edge_to_pdom): Add locations. * tree-ssa.c (redirect_edge_var_map_add, ssa_redirect_edge, flush_pending_stmts): Add source location. * lambda-code.c (perfect_nestify): Maintain location stack with argument stack to preserve locations. * tree-vect-stmts.c (vectorizable_load): Add location. * tree-inline.c (copy_phis_for_bb): Copy locus. (setup_one_parameter): Add call locus to inlined parameter stmts. (initialize_inlined_parameters): Pass in call location as parameter assignment locus. (tree_function_versioning): Pass location to setup_one_parameter. * tree-ssa-phiprop.c (phiprop_insert_phi): Set locations. * tree-outof-ssa.c (struct _elim_graph): Add source_location vecs for copy and edge lists. (insert_partition_copy_on_edge, insert_value_copy_on_edge, insert_rtx_to_part_on_edge, insert_part_to_rtx_on_edge): Provide a locus parameter and override the stmt default if provided. (new_elim_graph, clear_elim_graph, delete_elim_graph, elim_graph_add_edge, elim_graph_remove_succ_edge, FOR_EACH_ELIM_GRAPH_SUCC, FOR_EACH_ELIM_GRAPH_PRED, eliminate_build, elim_forward, elim_unvisited_predecessor, elim_backward, elim_create, eliminate_phi): Add locus info in elimination graph for each edge and value copy. (insert_backedge_copies): Copy locus if present. * tree-flow.h (struct _edge_var_map): Add locus field. * tree-switch_conversions.c (fix_phi_nodes): Add locations. * tree-cfg.c (reinstall_phi_args, gimple_make_forwarder_block, add_phi_args_after_copy_edge, gimple_lv_adjust_loop_header_phi): Add locations. * ipa-struct-reorg.c (make_edge_and_fix_phis_of_dest): Add locations. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@150267 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-vect-loop-manip.c')
-rw-r--r--gcc/tree-vect-loop-manip.c44
1 files changed, 30 insertions, 14 deletions
diff --git a/gcc/tree-vect-loop-manip.c b/gcc/tree-vect-loop-manip.c
index eaf263c4270..c0b15cd98a5 100644
--- a/gcc/tree-vect-loop-manip.c
+++ b/gcc/tree-vect-loop-manip.c
@@ -169,15 +169,18 @@ slpeel_update_phis_for_duplicate_loop (struct loop *orig_loop,
!gsi_end_p (gsi_new) && !gsi_end_p (gsi_orig);
gsi_next (&gsi_new), gsi_next (&gsi_orig))
{
+ source_location locus;
phi_new = gsi_stmt (gsi_new);
phi_orig = gsi_stmt (gsi_orig);
/* step 1. */
def = PHI_ARG_DEF_FROM_EDGE (phi_orig, entry_arg_e);
- add_phi_arg (phi_new, def, new_loop_entry_e);
+ locus = gimple_phi_arg_location_from_edge (phi_orig, entry_arg_e);
+ add_phi_arg (phi_new, def, new_loop_entry_e, locus);
/* step 2. */
def = PHI_ARG_DEF_FROM_EDGE (phi_orig, orig_loop_latch);
+ locus = gimple_phi_arg_location_from_edge (phi_orig, orig_loop_latch);
if (TREE_CODE (def) != SSA_NAME)
continue;
@@ -190,7 +193,7 @@ slpeel_update_phis_for_duplicate_loop (struct loop *orig_loop,
}
/* An ordinary ssa name defined in the loop. */
- add_phi_arg (phi_new, new_ssa_name, loop_latch_edge (new_loop));
+ add_phi_arg (phi_new, new_ssa_name, loop_latch_edge (new_loop), locus);
/* step 3 (case 1). */
if (!after)
@@ -383,6 +386,7 @@ slpeel_update_phi_nodes_for_guard1 (edge guard_edge, struct loop *loop,
!gsi_end_p (gsi_orig) && !gsi_end_p (gsi_update);
gsi_next (&gsi_orig), gsi_next (&gsi_update))
{
+ source_location loop_locus, guard_locus;;
orig_phi = gsi_stmt (gsi_orig);
update_phi = gsi_stmt (gsi_update);
@@ -395,10 +399,16 @@ slpeel_update_phi_nodes_for_guard1 (edge guard_edge, struct loop *loop,
/* 1.2. NEW_MERGE_BB has two incoming edges: GUARD_EDGE and the exit-edge
of LOOP. Set the two phi args in NEW_PHI for these edges: */
loop_arg = PHI_ARG_DEF_FROM_EDGE (orig_phi, EDGE_SUCC (loop->latch, 0));
+ loop_locus = gimple_phi_arg_location_from_edge (orig_phi,
+ EDGE_SUCC (loop->latch,
+ 0));
guard_arg = PHI_ARG_DEF_FROM_EDGE (orig_phi, loop_preheader_edge (loop));
+ guard_locus
+ = gimple_phi_arg_location_from_edge (orig_phi,
+ loop_preheader_edge (loop));
- add_phi_arg (new_phi, loop_arg, new_exit_e);
- add_phi_arg (new_phi, guard_arg, guard_edge);
+ add_phi_arg (new_phi, loop_arg, new_exit_e, loop_locus);
+ add_phi_arg (new_phi, guard_arg, guard_edge, guard_locus);
/* 1.3. Update phi in successor block. */
gcc_assert (PHI_ARG_DEF_FROM_EDGE (update_phi, e) == loop_arg
@@ -417,7 +427,7 @@ slpeel_update_phi_nodes_for_guard1 (edge guard_edge, struct loop *loop,
*new_exit_bb);
/* 2.2. NEW_EXIT_BB has one incoming edge: the exit-edge of the loop. */
- add_phi_arg (new_phi, loop_arg, single_exit (loop));
+ add_phi_arg (new_phi, loop_arg, single_exit (loop), loop_locus);
/* 2.3. Update phi in successor of NEW_EXIT_BB: */
gcc_assert (PHI_ARG_DEF_FROM_EDGE (update_phi2, new_exit_e) == loop_arg);
@@ -545,8 +555,8 @@ slpeel_update_phi_nodes_for_guard2 (edge guard_edge, struct loop *loop,
if (new_name2)
guard_arg = new_name2;
- add_phi_arg (new_phi, loop_arg, new_exit_e);
- add_phi_arg (new_phi, guard_arg, guard_edge);
+ add_phi_arg (new_phi, loop_arg, new_exit_e, UNKNOWN_LOCATION);
+ add_phi_arg (new_phi, guard_arg, guard_edge, UNKNOWN_LOCATION);
/* 1.3. Update phi in successor block. */
gcc_assert (PHI_ARG_DEF_FROM_EDGE (update_phi, e) == orig_def);
@@ -561,7 +571,7 @@ slpeel_update_phi_nodes_for_guard2 (edge guard_edge, struct loop *loop,
*new_exit_bb);
/* 2.2. NEW_EXIT_BB has one incoming edge: the exit-edge of the loop. */
- add_phi_arg (new_phi, loop_arg, single_exit (loop));
+ add_phi_arg (new_phi, loop_arg, single_exit (loop), UNKNOWN_LOCATION);
/* 2.3. Update phi in successor of NEW_EXIT_BB: */
gcc_assert (PHI_ARG_DEF_FROM_EDGE (update_phi2, new_exit_e) == loop_arg);
@@ -596,7 +606,8 @@ slpeel_update_phi_nodes_for_guard2 (edge guard_edge, struct loop *loop,
/* 3.3. GUARD_BB has one incoming edge: */
gcc_assert (EDGE_COUNT (guard_edge->src->preds) == 1);
- add_phi_arg (new_phi, arg, EDGE_PRED (guard_edge->src, 0));
+ add_phi_arg (new_phi, arg, EDGE_PRED (guard_edge->src, 0),
+ UNKNOWN_LOCATION);
/* 3.4. Update phi in successor of GUARD_BB: */
gcc_assert (PHI_ARG_DEF_FROM_EDGE (update_phi2, guard_edge)
@@ -720,13 +731,15 @@ slpeel_tree_duplicate_loop_to_edge_cfg (struct loop *loop, edge e)
if (phi_arg)
{
edge new_loop_exit_edge;
+ source_location locus;
+ locus = gimple_phi_arg_location_from_edge (phi, single_exit (loop));
if (EDGE_SUCC (new_loop->header, 0)->dest == new_loop->latch)
new_loop_exit_edge = EDGE_SUCC (new_loop->header, 1);
else
new_loop_exit_edge = EDGE_SUCC (new_loop->header, 0);
- add_phi_arg (phi, phi_arg, new_loop_exit_edge);
+ add_phi_arg (phi, phi_arg, new_loop_exit_edge, locus);
}
}
@@ -764,7 +777,8 @@ slpeel_tree_duplicate_loop_to_edge_cfg (struct loop *loop, edge e)
phi = gsi_stmt (gsi);
phi_arg = PHI_ARG_DEF_FROM_EDGE (phi, entry_e);
if (phi_arg)
- add_phi_arg (phi, phi_arg, new_exit_e);
+ add_phi_arg (phi, phi_arg, new_exit_e,
+ gimple_phi_arg_location_from_edge (phi, entry_e));
}
redirect_edge_and_branch_force (entry_e, new_loop->header);
@@ -954,8 +968,9 @@ set_prologue_iterations (basic_block bb_before_first_loop,
gsi_insert_seq_after (&gsi, stmts, GSI_NEW_STMT);
newphi = create_phi_node (var, bb_before_first_loop);
- add_phi_arg (newphi, prologue_after_cost_adjust_name, e_fallthru);
- add_phi_arg (newphi, first_niters, e_false);
+ add_phi_arg (newphi, prologue_after_cost_adjust_name, e_fallthru,
+ UNKNOWN_LOCATION);
+ add_phi_arg (newphi, first_niters, e_false, UNKNOWN_LOCATION);
first_niters = PHI_RESULT (newphi);
}
@@ -2383,7 +2398,8 @@ vect_loop_versioning (loop_vec_info loop_vinfo, bool do_versioning,
new_phi = create_phi_node (SSA_NAME_VAR (PHI_RESULT (orig_phi)),
new_exit_bb);
arg = PHI_ARG_DEF_FROM_EDGE (orig_phi, e);
- add_phi_arg (new_phi, arg, new_exit_e);
+ add_phi_arg (new_phi, arg, new_exit_e,
+ gimple_phi_arg_location_from_edge (orig_phi, e));
SET_PHI_ARG_DEF (orig_phi, e->dest_idx, PHI_RESULT (new_phi));
}