summaryrefslogtreecommitdiff
path: root/gcc/tree-vect-loop-manip.c
diff options
context:
space:
mode:
authordehao <dehao@138bc75d-0d04-0410-961f-82ee72b054a4>2012-07-10 04:28:32 +0000
committerdehao <dehao@138bc75d-0d04-0410-961f-82ee72b054a4>2012-07-10 04:28:32 +0000
commitb82a98eec632cc9cfe703de10d4501d678ef64c1 (patch)
tree9452b0caf38ccada7226e238193cb8e3a7344571 /gcc/tree-vect-loop-manip.c
parent7f974c5c0cee43758614070b943c43947c4fb9fd (diff)
downloadgcc-b82a98eec632cc9cfe703de10d4501d678ef64c1.tar.gz
2012-07-10 Dehao Chen <dehao@google.com>
* tree.h (phi_arg_d): New field. * tree-flow-inline.h (gimple_phi_arg_block): New function. (gimple_phi_arg_block_from_edge): New function. (gimple_phi_arg_set_block): New function. (gimple_phi_arg_has_block): New function. (redirect_edge_var_map_block): New function. * tree-flow.h (_edge_var_map): New field. * tree-ssa-live.c (remove_unused_locals): Mark phi_arg's block as used. * tree-eh.c (cleanup_empty_eh_merge_phis): Add block debug info for redirect_edge_var_map_add. * tree-outof-ssa.c (_elim_graph): New field. (insert_partition_copy_on_edge): New parameter. (insert_value_copy_on_edge): New parameter. (insert_rtx_to_part_on_edge): New parameter. (insert_part_to_rtx_on_edge): New parameter. (elim_graph_add_edge): New parameter. (elim_graph_remove_succ_edge): New parameter. (FOR_EACH_ELIM_GRAPH_SUCC): New parameter. (FOR_EACH_ELIM_GRAPH_PRED): New parameter. (new_elim_graph): Add block debug info. (clear_elim_graph): Likewise. (delete_elim_graph): Likewise. (elim_graph_add_node): Likewise. (elim_graph_add_edge): Likewise. (elim_graph_remove_succ_edge): Likewise. (eliminate_build): Likewise. (elim_forward): Likewise. (elim_unvisited_predecessor): Likewise. (elim_backward): Likewise. (elim_create): Likewise. (eliminate_phi): Likewise. (insert_backedge_copies): Likewise. * tree-into-ssa.c (insert_phi_nodes_for): Add block debug info for add_phi_arg. (rewrite_add_phi_arguments): Likewise. * tree-ssa-loop-im.c (execute_sm_if_changed): Likewise. * tree-ssa-tail-merge.c (replace_block_by): Likewise. * tree-ssa-threadupdate.c (copy_phi_args): Likewise. * tree-loop-distribution.c (update_phis_for_loop_copy): Likewise. * tree-ssa-loop-manip.c (create_iv): Likewise. (add_exit_phis_edge): Likewise. (split_loop_exit_edge): Likewise. (copy_phi_node_args): Likewise. (tree_transform_and_unroll_loop): Likewise. * value-prof.c (gimple_ic): Likewise. (gimple_stringop_fixed_value): Likewise. * tree-tailcall.c (add_successor_phi_arg): Likewise. (eliminate_tail_call): Likewise. (create_tailcall_accumulator): Likewise. (tree_optimize_tail_calls_1): Likewise. * tree-phinodes.c (add_phi_arg): Likewise. (make_phi_node): Likewise. (resize_phi_node): Likewise. (remove_phi_arg_num): Likewise. * omp-low.c (expand_parallel_call): Likewise. (expand_omp_for_static_chunk): Likewise. * tree-vect-loop-manip.c (slpeel_update_phis_for_duplicate_loop): Likewise. (slpeel_update_phi_nodes_for_guard1): Likewise. (slpeel_update_phi_nodes_for_guard2): Likewise. (slpeel_tree_duplicate_loop_to_edge_cfg): Likewise. (set_prologue_iterations): Likewise. (slpeel_tree_peel_loop_to_edge): Likewise. (vect_loop_versioning): Likewise. * tree-parloops.c (create_phi_for_local_result): Likewise. (transform_to_exit_first_loop): Likewise. (create_parallel_loop): Likewise. * ipa-split.c (split_function): Likewise. * tree-vect-loop.c (get_initial_def_for_induction): Likewise. (vect_create_epilog_for_reduction): Likewise. * tree-vect-data-refs.c (vect_setup_realignment): Likewise. * graphite-scop-detection.c (canonicalize_loop_closed_ssa): Likewise. * tree-ssa-phiopt.c (cond_store_replacement): Likewise. (cond_if_else_store_replacement_1): Likewise. * tree-cfgcleanup.c (remove_forwarder_block): Likewise. (remove_forwarder_block_with_phi): Likewise. * tree-ssa-pre.c (insert_into_preds_of_block): Likewise. * tree-predcom.c (initialize_root_vars): Likewise. (initialize_root_vars_lm): Likewise. * sese.c (sese_add_exit_phis_edge): Likewise. * tree-ssa-dce.c (forward_edge_to_pdom): Likewise. * tree-ssa.c (flush_pending_stmts): Likewise. (redirect_edge_var_map_add): Likewise. (ssa_redirect_edge): Likewise. * gimple-streamer-in.c (input_phi): Likewise. * tree-vect-stmts.c (vectorizable_load): Likewise. * tree-inline.c (copy_phis_for_bb): Likewise. * tree-ssa-phiprop.c (phiprop_insert_phi): Likewise. * tree-switch-conversion.c (fix_phi_nodes): Likewise. * tree-cfg.c (reinstall_phi_args): Likewise. (gimple_make_forwarder_block): Likewise. (add_phi_args_after_copy_edge): Likewise. (gimple_duplicate_sese_tail): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@189402 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-vect-loop-manip.c')
-rw-r--r--gcc/tree-vect-loop-manip.c45
1 files changed, 30 insertions, 15 deletions
diff --git a/gcc/tree-vect-loop-manip.c b/gcc/tree-vect-loop-manip.c
index 9ac0d9a04eb..87afb6e15b1 100644
--- a/gcc/tree-vect-loop-manip.c
+++ b/gcc/tree-vect-loop-manip.c
@@ -294,13 +294,15 @@ slpeel_update_phis_for_duplicate_loop (struct loop *orig_loop,
gsi_next (&gsi_new), gsi_next (&gsi_orig))
{
source_location locus;
+ tree block;
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);
locus = gimple_phi_arg_location_from_edge (phi_orig, entry_arg_e);
- add_phi_arg (phi_new, def, new_loop_entry_e, locus);
+ block = gimple_phi_arg_block_from_edge (phi_orig, entry_arg_e);
+ add_phi_arg (phi_new, def, new_loop_entry_e, locus, block);
/* step 2. */
def = PHI_ARG_DEF_FROM_EDGE (phi_orig, orig_loop_latch);
@@ -317,7 +319,8 @@ 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), locus);
+ add_phi_arg (phi_new, new_ssa_name, loop_latch_edge (new_loop), locus,
+ block);
/* Drop any debug references outside the loop, if they would
become ill-formed SSA. */
@@ -512,6 +515,7 @@ slpeel_update_phi_nodes_for_guard1 (edge guard_edge, struct loop *loop,
gsi_next (&gsi_orig), gsi_next (&gsi_update))
{
source_location loop_locus, guard_locus;
+ tree loop_block, guard_block;
orig_phi = gsi_stmt (gsi_orig);
update_phi = gsi_stmt (gsi_update);
@@ -527,13 +531,19 @@ slpeel_update_phi_nodes_for_guard1 (edge guard_edge, struct loop *loop,
loop_locus = gimple_phi_arg_location_from_edge (orig_phi,
EDGE_SUCC (loop->latch,
0));
+ loop_block = gimple_phi_arg_block_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));
+ guard_block = gimple_phi_arg_block_from_edge (orig_phi,
+ loop_preheader_edge (loop));
- add_phi_arg (new_phi, loop_arg, new_exit_e, loop_locus);
- add_phi_arg (new_phi, guard_arg, guard_edge, guard_locus);
+ add_phi_arg (new_phi, loop_arg, new_exit_e, loop_locus, loop_block);
+ add_phi_arg (new_phi, guard_arg, guard_edge, guard_locus, guard_block);
/* 1.3. Update phi in successor block. */
gcc_assert (PHI_ARG_DEF_FROM_EDGE (update_phi, e) == loop_arg
@@ -552,7 +562,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), loop_locus);
+ add_phi_arg (new_phi, loop_arg, single_exit (loop), loop_locus, loop_block);
/* 2.3. Update phi in successor of NEW_EXIT_BB: */
gcc_assert (PHI_ARG_DEF_FROM_EDGE (update_phi2, new_exit_e) == loop_arg);
@@ -680,8 +690,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, UNKNOWN_LOCATION);
- add_phi_arg (new_phi, guard_arg, guard_edge, UNKNOWN_LOCATION);
+ add_phi_arg (new_phi, loop_arg, new_exit_e, UNKNOWN_LOCATION, NULL);
+ add_phi_arg (new_phi, guard_arg, guard_edge, UNKNOWN_LOCATION, NULL);
/* 1.3. Update phi in successor block. */
gcc_assert (PHI_ARG_DEF_FROM_EDGE (update_phi, e) == orig_def);
@@ -696,7 +706,8 @@ 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), UNKNOWN_LOCATION);
+ add_phi_arg (new_phi, loop_arg, single_exit (loop), UNKNOWN_LOCATION,
+ NULL);
/* 2.3. Update phi in successor of NEW_EXIT_BB: */
gcc_assert (PHI_ARG_DEF_FROM_EDGE (update_phi2, new_exit_e) == loop_arg);
@@ -733,7 +744,7 @@ 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),
- UNKNOWN_LOCATION);
+ UNKNOWN_LOCATION, NULL);
/* 3.4. Update phi in successor of GUARD_BB: */
gcc_assert (PHI_ARG_DEF_FROM_EDGE (update_phi2, guard_edge)
@@ -859,14 +870,16 @@ slpeel_tree_duplicate_loop_to_edge_cfg (struct loop *loop, edge e)
{
edge new_loop_exit_edge;
source_location locus;
+ tree block;
locus = gimple_phi_arg_location_from_edge (phi, single_exit (loop));
+ block = gimple_phi_arg_block_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, locus);
+ add_phi_arg (phi, phi_arg, new_loop_exit_edge, locus, block);
}
}
@@ -905,7 +918,8 @@ slpeel_tree_duplicate_loop_to_edge_cfg (struct loop *loop, edge e)
phi_arg = PHI_ARG_DEF_FROM_EDGE (phi, entry_e);
if (phi_arg)
add_phi_arg (phi, phi_arg, new_exit_e,
- gimple_phi_arg_location_from_edge (phi, entry_e));
+ gimple_phi_arg_location_from_edge (phi, entry_e),
+ gimple_phi_arg_block_from_edge (phi, entry_e));
}
redirect_edge_and_branch_force (entry_e, new_loop->header);
@@ -1089,8 +1103,8 @@ set_prologue_iterations (basic_block bb_before_first_loop,
newphi = create_phi_node (var, bb_before_first_loop);
add_phi_arg (newphi, prologue_after_cost_adjust_name, e_fallthru,
- UNKNOWN_LOCATION);
- add_phi_arg (newphi, *first_niters, e_false, UNKNOWN_LOCATION);
+ UNKNOWN_LOCATION, NULL);
+ add_phi_arg (newphi, *first_niters, e_false, UNKNOWN_LOCATION, NULL);
*first_niters = PHI_RESULT (newphi);
}
@@ -1193,7 +1207,7 @@ slpeel_tree_peel_loop_to_edge (struct loop *loop,
new_phi);
use_operand_p use_p;
- add_phi_arg (new_phi, vop, exit_e, UNKNOWN_LOCATION);
+ add_phi_arg (new_phi, vop, exit_e, UNKNOWN_LOCATION, NULL);
gimple_phi_set_result (new_phi, new_vop);
FOR_EACH_IMM_USE_STMT (stmt, imm_iter, vop)
if (stmt != new_phi && gimple_bb (stmt) != loop->header)
@@ -2551,7 +2565,8 @@ vect_loop_versioning (loop_vec_info loop_vinfo,
new_exit_bb);
arg = PHI_ARG_DEF_FROM_EDGE (orig_phi, e);
add_phi_arg (new_phi, arg, new_exit_e,
- gimple_phi_arg_location_from_edge (orig_phi, e));
+ gimple_phi_arg_location_from_edge (orig_phi, e),
+ gimple_phi_arg_block_from_edge (orig_phi, e));
adjust_phi_and_debug_stmts (orig_phi, e, PHI_RESULT (new_phi));
}