[3/3] No need to vectorize simple only-live stmts

2016-06-03  Alan Hayward  <alan.hayward@arm.com>

[3/3] No need to vectorize simple only-live stmts

gcc/
	* tree-vect-stmts.c (vect_stmt_relevant_p): Do not vectorize non live
	relevant stmts which are simple and invariant.
	* tree-vect-loop.c (vectorizable_live_operation): Check relevance
	instead of simple and invariant

testsuite/
	* gcc.dg/vect/vect-live-slp-5.c: Remove dg check.

From-SVN: r237065
This commit is contained in:
Alan Hayward 2016-06-03 13:04:01 +00:00 committed by Alan Hayward
parent b28ead45fe
commit 3a2edf4cb8
5 changed files with 19 additions and 7 deletions

View File

@ -1,3 +1,10 @@
2016-06-03 Alan Hayward <alan.hayward@arm.com>
* tree-vect-stmts.c (vect_stmt_relevant_p): Do not vectorize non live
relevant stmts which are simple and invariant.
* tree-vect-loop.c (vectorizable_live_operation): Check relevance
instead of simple and invariant
2016-06-03 Alan Hayward <alan.hayward@arm.com>
* tree-vect-loop.c (vect_analyze_loop_operations): Allow live stmts.

View File

@ -1,3 +1,7 @@
2016-06-03 Alan Hayward <alan.hayward@arm.com>
* gcc.dg/vect/vect-live-slp-5.c: Remove dg check.
2016-06-03 Alan Hayward <alan.hayward@arm.com>
* gcc.dg/tree-ssa/pr64183.c: Ensure test does not vectorize.

View File

@ -46,5 +46,4 @@ main (void)
}
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
/* { dg-final { scan-tree-dump-times "vec_stmt_relevant_p: stmt live but not relevant" 1 "vect" } } */
/* { dg-final { scan-tree-dump "statement is simple and uses invariant. Leaving in place" "vect" } } */
/* { dg-final { scan-tree-dump-not "vec_stmt_relevant_p: stmt live but not relevant" "vect" } } */

View File

@ -6344,11 +6344,12 @@ vectorizable_live_operation (gimple *stmt,
if (nested_in_vect_loop_p (loop, stmt))
return false;
/* If STMT is a simple assignment and its inputs are invariant, then it can
remain in place, unvectorized. The original last scalar value that it
computes will be used. */
if (is_simple_and_all_uses_invariant (stmt, loop_vinfo))
/* If STMT is not relevant and it is a simple assignment and its inputs are
invariant then it can remain in place, unvectorized. The original last
scalar value that it computes will be used. */
if (!STMT_VINFO_RELEVANT_P (stmt_info))
{
gcc_assert (is_simple_and_all_uses_invariant (stmt, loop_vinfo));
if (dump_enabled_p ())
dump_printf_loc (MSG_NOTE, vect_location,
"statement is simple and uses invariant. Leaving in "

View File

@ -335,7 +335,8 @@ vect_stmt_relevant_p (gimple *stmt, loop_vec_info loop_vinfo,
}
}
if (*live_p && *relevant == vect_unused_in_scope)
if (*live_p && *relevant == vect_unused_in_scope
&& !is_simple_and_all_uses_invariant (stmt, loop_vinfo))
{
if (dump_enabled_p ())
dump_printf_loc (MSG_NOTE, vect_location,