diff options
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 8bc6885906d..7fa5d668e24 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); |