mirror of git://gcc.gnu.org/git/gcc.git
tree-vect-loop.c (vectorizable_live_operation): Support handling for live variable outside loop but not in lcssa form.
* tree-vect-loop.c (vectorizable_live_operation): Support handling for live variable outside loop but not in lcssa form. From-SVN: r241096
This commit is contained in:
parent
d96004b805
commit
37cf9f4f1c
|
|
@ -1,3 +1,8 @@
|
||||||
|
2016-10-13 Bin Cheng <bin.cheng@arm.com>
|
||||||
|
|
||||||
|
* tree-vect-loop.c (vectorizable_live_operation): Support handling
|
||||||
|
for live variable outside loop but not in lcssa form.
|
||||||
|
|
||||||
2016-10-13 Bin Cheng <bin.cheng@arm.com>
|
2016-10-13 Bin Cheng <bin.cheng@arm.com>
|
||||||
|
|
||||||
* cfg.c (reset_original_copy_tables): New func.
|
* cfg.c (reset_original_copy_tables): New func.
|
||||||
|
|
|
||||||
|
|
@ -6488,14 +6488,6 @@ vectorizable_live_operation (gimple *stmt,
|
||||||
: gimple_get_lhs (stmt);
|
: gimple_get_lhs (stmt);
|
||||||
lhs_type = TREE_TYPE (lhs);
|
lhs_type = TREE_TYPE (lhs);
|
||||||
|
|
||||||
/* Find all uses of STMT outside the loop - there should be at least one. */
|
|
||||||
auto_vec<gimple *, 4> worklist;
|
|
||||||
FOR_EACH_IMM_USE_STMT (use_stmt, imm_iter, lhs)
|
|
||||||
if (!flow_bb_inside_loop_p (loop, gimple_bb (use_stmt))
|
|
||||||
&& !is_gimple_debug (use_stmt))
|
|
||||||
worklist.safe_push (use_stmt);
|
|
||||||
gcc_assert (worklist.length () >= 1);
|
|
||||||
|
|
||||||
bitsize = TYPE_SIZE (TREE_TYPE (vectype));
|
bitsize = TYPE_SIZE (TREE_TYPE (vectype));
|
||||||
vec_bitsize = TYPE_SIZE (vectype);
|
vec_bitsize = TYPE_SIZE (vectype);
|
||||||
|
|
||||||
|
|
@ -6546,12 +6538,24 @@ vectorizable_live_operation (gimple *stmt,
|
||||||
if (stmts)
|
if (stmts)
|
||||||
gsi_insert_seq_on_edge_immediate (single_exit (loop), stmts);
|
gsi_insert_seq_on_edge_immediate (single_exit (loop), stmts);
|
||||||
|
|
||||||
/* Replace all uses of the USE_STMT in the worklist with the newly inserted
|
/* Replace use of lhs with newly computed result. If the use stmt is a
|
||||||
statement. */
|
single arg PHI, just replace all uses of PHI result. It's necessary
|
||||||
while (!worklist.is_empty ())
|
because lcssa PHI defining lhs may be before newly inserted stmt. */
|
||||||
|
use_operand_p use_p;
|
||||||
|
FOR_EACH_IMM_USE_STMT (use_stmt, imm_iter, lhs)
|
||||||
|
if (!flow_bb_inside_loop_p (loop, gimple_bb (use_stmt))
|
||||||
|
&& !is_gimple_debug (use_stmt))
|
||||||
{
|
{
|
||||||
use_stmt = worklist.pop ();
|
if (gimple_code (use_stmt) == GIMPLE_PHI
|
||||||
replace_uses_by (gimple_phi_result (use_stmt), new_tree);
|
&& gimple_phi_num_args (use_stmt) == 1)
|
||||||
|
{
|
||||||
|
replace_uses_by (gimple_phi_result (use_stmt), new_tree);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
FOR_EACH_IMM_USE_ON_STMT (use_p, imm_iter)
|
||||||
|
SET_USE (use_p, new_tree);
|
||||||
|
}
|
||||||
update_stmt (use_stmt);
|
update_stmt (use_stmt);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue