diff options
author | Richard Guenther <rguenther@suse.de> | 2012-08-23 11:17:29 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2012-08-23 11:17:29 +0000 |
commit | 54e8e2c3b083ce4a6b515da8355227b313b61656 (patch) | |
tree | c7fd63e8223e3d722d3b671216478508446c9c30 | |
parent | b6b27e9830958b624fa79ddd107e139dd5622edd (diff) | |
download | gcc-54e8e2c3b083ce4a6b515da8355227b313b61656.zip gcc-54e8e2c3b083ce4a6b515da8355227b313b61656.tar.gz gcc-54e8e2c3b083ce4a6b515da8355227b313b61656.tar.bz2 |
tree-vect-stmts.c (vect_finish_stmt_generation): Update virtual SSA form.
2012-08-23 Richard Guenther <rguenther@suse.de>
* tree-vect-stmts.c (vect_finish_stmt_generation): Update
virtual SSA form.
From-SVN: r190620
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/tree-vect-stmts.c | 26 |
2 files changed, 31 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 3fb5883..bec8b9e 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2012-08-23 Richard Guenther <rguenther@suse.de> + + * tree-vect-stmts.c (vect_finish_stmt_generation): Update + virtual SSA form. + 2012-08-23 Jakub Jelinek <jakub@redhat.com> * tree.c (copy_node_stat): Clear DECL_STRUCT_FUNCTION. diff --git a/gcc/tree-vect-stmts.c b/gcc/tree-vect-stmts.c index 706b0bc..ab4a26c 100644 --- a/gcc/tree-vect-stmts.c +++ b/gcc/tree-vect-stmts.c @@ -1600,6 +1600,32 @@ vect_finish_stmt_generation (gimple stmt, gimple vec_stmt, gcc_assert (gimple_code (stmt) != GIMPLE_LABEL); + if (!gsi_end_p (*gsi) + && gimple_has_mem_ops (vec_stmt)) + { + gimple at_stmt = gsi_stmt (*gsi); + tree vuse = gimple_vuse (at_stmt); + if (vuse && TREE_CODE (vuse) == SSA_NAME) + { + tree vdef = gimple_vdef (at_stmt); + gimple_set_vuse (vec_stmt, gimple_vuse (at_stmt)); + /* If we have an SSA vuse and insert a store, update virtual + SSA form to avoid triggering the renamer. Do so only + if we can easily see all uses - which is what almost always + happens with the way vectorized stmts are inserted. */ + if ((vdef && TREE_CODE (vdef) == SSA_NAME) + && ((is_gimple_assign (vec_stmt) + && !is_gimple_reg (gimple_assign_lhs (vec_stmt))) + || (is_gimple_call (vec_stmt) + && !(gimple_call_flags (vec_stmt) + & (ECF_CONST|ECF_PURE|ECF_NOVOPS))))) + { + tree new_vdef = copy_ssa_name (vuse, vec_stmt); + gimple_set_vdef (vec_stmt, new_vdef); + SET_USE (gimple_vuse_op (at_stmt), new_vdef); + } + } + } gsi_insert_before (gsi, vec_stmt, GSI_SAME_STMT); set_vinfo_for_stmt (vec_stmt, new_stmt_vec_info (vec_stmt, loop_vinfo, |