From 90d4c4af564a54407ed84d4d73dedd63fff382dc Mon Sep 17 00:00:00 2001 From: rguenth Date: Mon, 18 Mar 2013 13:57:33 +0000 Subject: 2013-03-18 Richard Biener * tree-vect-loop-manip.c (vect_create_cond_for_alias_checks): Remove cond_expr_stmt_list argument and do not gimplify the built expression. (vect_loop_versioning): Adjust. * tree-vect-data-refs.c (vect_create_addr_base_for_vector_ref): Cleanup to use less temporaries. (vect_create_data_ref_ptr): Cleanup. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@196782 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/tree-vect-loop-manip.c | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) (limited to 'gcc/tree-vect-loop-manip.c') diff --git a/gcc/tree-vect-loop-manip.c b/gcc/tree-vect-loop-manip.c index 559f6e9e997..ff7d53f2591 100644 --- a/gcc/tree-vect-loop-manip.c +++ b/gcc/tree-vect-loop-manip.c @@ -2271,20 +2271,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 may_alias_ddrs = LOOP_VINFO_MAY_ALIAS_DDRS (loop_vinfo); int vect_factor = LOOP_VINFO_VECT_FACTOR (loop_vinfo); @@ -2333,12 +2327,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 +2431,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); -- cgit v1.2.1 From 3767bd95180b604104c0e7942950db2c6dc73059 Mon Sep 17 00:00:00 2001 From: rguenth Date: Wed, 20 Mar 2013 09:01:52 +0000 Subject: 2013-03-20 Richard Biener * tree-vect-loop-manip.c (slpeel_can_duplicate_loop_p): Do not check whether an SSA update is needed. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@196810 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/tree-vect-loop-manip.c | 3 --- 1 file changed, 3 deletions(-) (limited to 'gcc/tree-vect-loop-manip.c') diff --git a/gcc/tree-vect-loop-manip.c b/gcc/tree-vect-loop-manip.c index ff7d53f2591..fabf52d2648 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. */ -- cgit v1.2.1 From f68f7ce897bb84af33c16836b15f73b439a79ac6 Mon Sep 17 00:00:00 2001 From: rguenth Date: Thu, 21 Mar 2013 12:32:06 +0000 Subject: 2013-03-21 Richard Biener * tree-vect-loop-manip.c (slpeel_tree_peel_loop_to_edge): Update virtual SSA form. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@196868 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/tree-vect-loop-manip.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'gcc/tree-vect-loop-manip.c') diff --git a/gcc/tree-vect-loop-manip.c b/gcc/tree-vect-loop-manip.c index fabf52d2648..b0120a9d4de 100644 --- a/gcc/tree-vect-loop-manip.c +++ b/gcc/tree-vect-loop-manip.c @@ -1057,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 -- cgit v1.2.1