diff options
Diffstat (limited to 'gcc/tree-vect-loop-manip.c')
-rw-r--r-- | gcc/tree-vect-loop-manip.c | 37 |
1 files changed, 19 insertions, 18 deletions
diff --git a/gcc/tree-vect-loop-manip.c b/gcc/tree-vect-loop-manip.c index 559f6e9e997..b0120a9d4de 100644 --- a/gcc/tree-vect-loop-manip.c +++ b/gcc/tree-vect-loop-manip.c @@ -848,9 +848,6 @@ slpeel_can_duplicate_loop_p (const struct loop *loop, const_edge e) gimple orig_cond = get_loop_exit_condition (loop); gimple_stmt_iterator loop_exit_gsi = gsi_last_bb (exit_e->src); - if (need_ssa_update_p (cfun)) - return false; - if (loop->inner /* All loops have an outer scope; the only case loop->outer is NULL is for the function itself. */ @@ -1060,6 +1057,15 @@ slpeel_tree_peel_loop_to_edge (struct loop *loop, if (!slpeel_can_duplicate_loop_p (loop, e)) return NULL; + /* We might have a queued need to update virtual SSA form. As we + delete the update SSA machinery below after doing a regular + incremental SSA update during loop copying make sure we don't + lose that fact. + ??? Needing to update virtual SSA form by renaming is unfortunate + but not all of the vectorizer code inserting new loads / stores + properly assigns virtual operands to those statements. */ + update_ssa (TODO_update_ssa_only_virtuals); + /* If the loop has a virtual PHI, but exit bb doesn't, create a virtual PHI in the exit bb and rename all the uses after the loop. This simplifies the *guard[12] routines, which assume loop closed SSA form for all PHIs @@ -2271,20 +2277,14 @@ vect_vfa_segment_size (struct data_reference *dr, tree length_factor) Output: COND_EXPR - conditional expression. - COND_EXPR_STMT_LIST - statements needed to construct the conditional - expression. - The returned value is the conditional expression to be used in the if statement that controls which version of the loop gets executed at runtime. */ static void -vect_create_cond_for_alias_checks (loop_vec_info loop_vinfo, - tree * cond_expr, - gimple_seq * cond_expr_stmt_list) +vect_create_cond_for_alias_checks (loop_vec_info loop_vinfo, tree * cond_expr) { - struct loop *loop = LOOP_VINFO_LOOP (loop_vinfo); vec<ddr_p> may_alias_ddrs = LOOP_VINFO_MAY_ALIAS_DDRS (loop_vinfo); int vect_factor = LOOP_VINFO_VECT_FACTOR (loop_vinfo); @@ -2333,12 +2333,14 @@ vect_create_cond_for_alias_checks (loop_vec_info loop_vinfo, dr_b = STMT_VINFO_DATA_REF (vinfo_for_stmt (stmt_b)); } - addr_base_a = - vect_create_addr_base_for_vector_ref (stmt_a, cond_expr_stmt_list, - NULL_TREE, loop); - addr_base_b = - vect_create_addr_base_for_vector_ref (stmt_b, cond_expr_stmt_list, - NULL_TREE, loop); + addr_base_a + = fold_build_pointer_plus (DR_BASE_ADDRESS (dr_a), + size_binop (PLUS_EXPR, DR_OFFSET (dr_a), + DR_INIT (dr_a))); + addr_base_b + = fold_build_pointer_plus (DR_BASE_ADDRESS (dr_b), + size_binop (PLUS_EXPR, DR_OFFSET (dr_b), + DR_INIT (dr_b))); if (!operand_equal_p (DR_STEP (dr_a), DR_STEP (dr_b), 0)) length_factor = scalar_loop_iters; @@ -2435,8 +2437,7 @@ vect_loop_versioning (loop_vec_info loop_vinfo, &cond_expr_stmt_list); if (LOOP_REQUIRES_VERSIONING_FOR_ALIAS (loop_vinfo)) - vect_create_cond_for_alias_checks (loop_vinfo, &cond_expr, - &cond_expr_stmt_list); + vect_create_cond_for_alias_checks (loop_vinfo, &cond_expr); cond_expr = force_gimple_operand_1 (cond_expr, &gimplify_stmt_list, is_gimple_condexpr, NULL_TREE); |