diff options
author | Zdenek Dvorak <dvorakz@suse.cz> | 2006-11-22 00:54:16 +0100 |
---|---|---|
committer | Zdenek Dvorak <rakdver@gcc.gnu.org> | 2006-11-21 23:54:16 +0000 |
commit | ac8f6c69032b9a07b3036a2514bd59353b2a32c3 (patch) | |
tree | bf6b0974fc31405c052970da079d8c6c75d72a63 /gcc/tree-vectorizer.c | |
parent | bf8dbe38637ce885c1b7af763f7728955083195e (diff) | |
download | gcc-ac8f6c69032b9a07b3036a2514bd59353b2a32c3.zip gcc-ac8f6c69032b9a07b3036a2514bd59353b2a32c3.tar.gz gcc-ac8f6c69032b9a07b3036a2514bd59353b2a32c3.tar.bz2 |
tree-loop-linear.c (linear_transform_loops): Use single_exit accessor functions.
* tree-loop-linear.c (linear_transform_loops): Use single_exit accessor
functions.
* tree-ssa-loop-niter.c (loop_only_exit_p): Ditto.
* cfgloopmanip.c (update_single_exits_after_duplication,
update_single_exit_for_duplicated_loop, loop_version): Ditto.
* tree-scalar-evolution.c (get_loop_exit_condition,
get_exit_conditions_rec, loop_closed_phi_def,
number_of_iterations_in_loop, scev_const_prop): Ditto.
* tree-ssa-loop-ivopts.c (single_dom_exit): Ditto.
* modulo-sched.c (generate_prolog_epilog, loop_canon_p, sms_schedule):
Ditto.
* tree-ssa-loop-ivcanon.c (canonicalize_loop_induction_variables):
Ditto.
* tree-vectorizer.c (slpeel_update_phis_for_duplicate_loop,
slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2,
slpeel_make_loop_iterate_ntimes,
slpeel_tree_duplicate_loop_to_edge_cfg, slpeel_can_duplicate_loop_p,
slpeel_verify_cfg_after_peeling, slpeel_tree_peel_loop_to_edge):
Ditto.
* tree-if-conv.c (if_convertible_loop_p): Ditto.
* tree-vect-analyze.c (vect_analyze_operations, vect_stmt_relevant_p,
vect_analyze_loop_form): Ditto.
* lambda-code.c (lambda_loopnest_to_gcc_loopnest, exit_phi_for_loop_p,
can_convert_to_perfect_nest, perfect_nestify): Ditto.
* tree-vect-transform.c (vect_create_epilog_for_reduction,
vect_update_ivs_after_vectorizer, vect_do_peeling_for_loop_bound,
vect_transform_loop): Ditto.
* cfgloop.c (mark_single_exit_loops, verify_loop_structure): Ditto.
(single_exit, set_single_exit): New functions.
* cfgloop.h (struct loop): Rename single_exit field to single_exit_.
(single_exit, set_single_exit): Declare.
* doc/loop.texi: Undocument single_exit field. Document single_exit
accessor function.
From-SVN: r119075
Diffstat (limited to 'gcc/tree-vectorizer.c')
-rw-r--r-- | gcc/tree-vectorizer.c | 37 |
1 files changed, 20 insertions, 17 deletions
diff --git a/gcc/tree-vectorizer.c b/gcc/tree-vectorizer.c index 8bc6885..7fa5d66 100644 --- a/gcc/tree-vectorizer.c +++ b/gcc/tree-vectorizer.c @@ -279,7 +279,7 @@ slpeel_update_phis_for_duplicate_loop (struct loop *orig_loop, tree def; edge orig_loop_latch = loop_latch_edge (orig_loop); edge orig_entry_e = loop_preheader_edge (orig_loop); - edge new_loop_exit_e = new_loop->single_exit; + edge new_loop_exit_e = single_exit (new_loop); edge new_loop_entry_e = loop_preheader_edge (new_loop); edge entry_arg_e = (after ? orig_loop_latch : orig_entry_e); @@ -519,7 +519,7 @@ slpeel_update_phi_nodes_for_guard1 (edge guard_edge, struct loop *loop, tree name; /* Create new bb between loop and new_merge_bb. */ - *new_exit_bb = split_edge (loop->single_exit); + *new_exit_bb = split_edge (single_exit (loop)); new_exit_e = EDGE_SUCC (*new_exit_bb, 0); @@ -564,7 +564,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, loop->single_exit); + add_phi_arg (new_phi, loop_arg, single_exit (loop)); /* 2.3. Update phi in successor of NEW_EXIT_BB: */ gcc_assert (PHI_ARG_DEF_FROM_EDGE (update_phi2, new_exit_e) == loop_arg); @@ -644,7 +644,7 @@ slpeel_update_phi_nodes_for_guard2 (edge guard_edge, struct loop *loop, tree arg; /* Create new bb between loop and new_merge_bb. */ - *new_exit_bb = split_edge (loop->single_exit); + *new_exit_bb = split_edge (single_exit (loop)); new_exit_e = EDGE_SUCC (*new_exit_bb, 0); @@ -709,7 +709,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, loop->single_exit); + add_phi_arg (new_phi, loop_arg, single_exit (loop)); /* 2.3. Update phi in successor of NEW_EXIT_BB: */ gcc_assert (PHI_ARG_DEF_FROM_EDGE (update_phi2, new_exit_e) == loop_arg); @@ -766,12 +766,12 @@ slpeel_make_loop_iterate_ntimes (struct loop *loop, tree niters) { tree indx_before_incr, indx_after_incr, cond_stmt, cond; tree orig_cond; - edge exit_edge = loop->single_exit; + edge exit_edge = single_exit (loop); block_stmt_iterator loop_cond_bsi; block_stmt_iterator incr_bsi; bool insert_after; tree begin_label = tree_block_label (loop->latch); - tree exit_label = tree_block_label (loop->single_exit->dest); + tree exit_label = tree_block_label (single_exit (loop)->dest); tree init = build_int_cst (TREE_TYPE (niters), 0); tree step = build_int_cst (TREE_TYPE (niters), 1); tree then_label; @@ -832,8 +832,9 @@ slpeel_tree_duplicate_loop_to_edge_cfg (struct loop *loop, struct loops *loops, bool was_imm_dom; basic_block exit_dest; tree phi, phi_arg; + edge exit, new_exit; - at_exit = (e == loop->single_exit); + at_exit = (e == single_exit (loop)); if (!at_exit && e != loop_preheader_edge (loop)) return NULL; @@ -854,22 +855,24 @@ slpeel_tree_duplicate_loop_to_edge_cfg (struct loop *loop, struct loops *loops, return NULL; } - exit_dest = loop->single_exit->dest; + exit_dest = single_exit (loop)->dest; was_imm_dom = (get_immediate_dominator (CDI_DOMINATORS, exit_dest) == loop->header ? true : false); new_bbs = XNEWVEC (basic_block, loop->num_nodes); + exit = single_exit (loop); copy_bbs (bbs, loop->num_nodes, new_bbs, - &loop->single_exit, 1, &new_loop->single_exit, NULL, + &exit, 1, &new_exit, NULL, e->src); + set_single_exit (new_loop, new_exit); /* Duplicating phi args at exit bbs as coming also from exit of duplicated loop. */ for (phi = phi_nodes (exit_dest); phi; phi = PHI_CHAIN (phi)) { - phi_arg = PHI_ARG_DEF_FROM_EDGE (phi, loop->single_exit); + phi_arg = PHI_ARG_DEF_FROM_EDGE (phi, single_exit (loop)); if (phi_arg) { edge new_loop_exit_edge; @@ -969,7 +972,7 @@ slpeel_add_loop_guard (basic_block guard_bb, tree cond, basic_block exit_bb, bool slpeel_can_duplicate_loop_p (struct loop *loop, edge e) { - edge exit_e = loop->single_exit; + edge exit_e = single_exit (loop); edge entry_e = loop_preheader_edge (loop); tree orig_cond = get_loop_exit_condition (loop); block_stmt_iterator loop_exit_bsi = bsi_last (exit_e->src); @@ -983,7 +986,7 @@ slpeel_can_duplicate_loop_p (struct loop *loop, edge e) || !loop->outer || loop->num_nodes != 2 || !empty_block_p (loop->latch) - || !loop->single_exit + || !single_exit (loop) /* Verify that new loop exit condition can be trivially modified. */ || (!orig_cond || orig_cond != bsi_stmt (loop_exit_bsi)) || (e != exit_e && e != entry_e)) @@ -997,7 +1000,7 @@ void slpeel_verify_cfg_after_peeling (struct loop *first_loop, struct loop *second_loop) { - basic_block loop1_exit_bb = first_loop->single_exit->dest; + basic_block loop1_exit_bb = single_exit (first_loop)->dest; basic_block loop2_entry_bb = loop_preheader_edge (second_loop)->src; basic_block loop1_entry_bb = loop_preheader_edge (first_loop)->src; @@ -1076,7 +1079,7 @@ slpeel_tree_peel_loop_to_edge (struct loop *loop, struct loops *loops, basic_block bb_before_first_loop; basic_block bb_between_loops; basic_block new_exit_bb; - edge exit_e = loop->single_exit; + edge exit_e = single_exit (loop); LOC loop_loc; if (!slpeel_can_duplicate_loop_p (loop, e)) @@ -1155,7 +1158,7 @@ slpeel_tree_peel_loop_to_edge (struct loop *loop, struct loops *loops, */ bb_before_first_loop = split_edge (loop_preheader_edge (first_loop)); - bb_before_second_loop = split_edge (first_loop->single_exit); + bb_before_second_loop = split_edge (single_exit (first_loop)); pre_condition = fold_build2 (LE_EXPR, boolean_type_node, first_niters, @@ -1194,7 +1197,7 @@ slpeel_tree_peel_loop_to_edge (struct loop *loop, struct loops *loops, */ bb_between_loops = new_exit_bb; - bb_after_second_loop = split_edge (second_loop->single_exit); + bb_after_second_loop = split_edge (single_exit (second_loop)); pre_condition = fold_build2 (EQ_EXPR, boolean_type_node, first_niters, niters); |