Commit 9ca86fc3 by Richard Guenther Committed by Richard Biener

tree-loop-distribution.c (stmt_has_scalar_dependences_outside_loop): Handle PHIs.

2012-06-01  Richard Guenther  <rguenther@suse.de>

	* tree-loop-distribution.c (stmt_has_scalar_dependences_outside_loop):
	Handle PHIs.
	(classify_partition): Likewise.

From-SVN: r188106
parent 30d55936
2012-06-01 Richard Guenther <rguenther@suse.de> 2012-06-01 Richard Guenther <rguenther@suse.de>
* tree-loop-distribution.c (stmt_has_scalar_dependences_outside_loop):
Handle PHIs.
(classify_partition): Likewise.
2012-06-01 Richard Guenther <rguenther@suse.de>
* tree-loop-distribution.c (enum partition_kind): New enum. * tree-loop-distribution.c (enum partition_kind): New enum.
(struct partition_s): Add kind and main_stmt members. (struct partition_s): Add kind and main_stmt members.
(partition_alloc): Initialize kind to PKIND_NORMAL. (partition_alloc): Initialize kind to PKIND_NORMAL.
......
...@@ -129,6 +129,9 @@ stmt_has_scalar_dependences_outside_loop (loop_p loop, gimple stmt) ...@@ -129,6 +129,9 @@ stmt_has_scalar_dependences_outside_loop (loop_p loop, gimple stmt)
def_operand_p def_p; def_operand_p def_p;
ssa_op_iter op_iter; ssa_op_iter op_iter;
if (gimple_code (stmt) == GIMPLE_PHI)
return ssa_name_has_uses_outside_loop_p (gimple_phi_result (stmt), loop);
FOR_EACH_SSA_DEF_OPERAND (def_p, stmt, op_iter, SSA_OP_DEF) FOR_EACH_SSA_DEF_OPERAND (def_p, stmt, op_iter, SSA_OP_DEF)
if (ssa_name_has_uses_outside_loop_p (DEF_FROM_PTR (def_p), loop)) if (ssa_name_has_uses_outside_loop_p (DEF_FROM_PTR (def_p), loop))
return true; return true;
...@@ -813,8 +816,7 @@ classify_partition (loop_p loop, struct graph *rdg, partition_t partition) ...@@ -813,8 +816,7 @@ classify_partition (loop_p loop, struct graph *rdg, partition_t partition)
/* If the stmt has uses outside of the loop fail. /* If the stmt has uses outside of the loop fail.
??? If the stmt is generated in another partition that ??? If the stmt is generated in another partition that
is not created as builtin we can ignore this. */ is not created as builtin we can ignore this. */
if (gimple_code (stmt) != GIMPLE_PHI if (stmt_has_scalar_dependences_outside_loop (loop, stmt))
&& stmt_has_scalar_dependences_outside_loop (loop, stmt))
{ {
if (dump_file && (dump_flags & TDF_DETAILS)) if (dump_file && (dump_flags & TDF_DETAILS))
fprintf (dump_file, "not generating builtin, partition has " fprintf (dump_file, "not generating builtin, partition has "
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment