aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Hayward <alan.hayward@arm.com>2016-06-03 13:04:01 +0000
committerAlan Hayward <alahay01@gcc.gnu.org>2016-06-03 13:04:01 +0000
commit3a2edf4cb86827b6aa2509baa6262fe49e11da93 (patch)
tree99fd49e5d691798fb795a84f777458870da59667
parentb28ead45fe630b9e018a81cb46b7e1f971e4dc17 (diff)
downloadgcc-3a2edf4cb86827b6aa2509baa6262fe49e11da93.zip
gcc-3a2edf4cb86827b6aa2509baa6262fe49e11da93.tar.gz
gcc-3a2edf4cb86827b6aa2509baa6262fe49e11da93.tar.bz2
[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
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/testsuite/ChangeLog4
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-live-5.c3
-rw-r--r--gcc/tree-vect-loop.c9
-rw-r--r--gcc/tree-vect-stmts.c3
5 files changed, 19 insertions, 7 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index a7476c6..ff69cf5 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,12 @@
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.
(vectorizable_reduction): Check for new relevant state.
(vectorizable_live_operation): vectorize live stmts using
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 0c976b6..1334193 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,5 +1,9 @@
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.
* testsuite/gcc.dg/vect/no-scevccp-vect-iv-2.c: Remove xfail.
* gcc.dg/vect/vect-live-1.c: New test.
diff --git a/gcc/testsuite/gcc.dg/vect/vect-live-5.c b/gcc/testsuite/gcc.dg/vect/vect-live-5.c
index f475ca8..188e4fa 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-live-5.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-live-5.c
@@ -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" } } */
diff --git a/gcc/tree-vect-loop.c b/gcc/tree-vect-loop.c
index 3cf1c79..bc1257c 100644
--- a/gcc/tree-vect-loop.c
+++ b/gcc/tree-vect-loop.c
@@ -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 "
diff --git a/gcc/tree-vect-stmts.c b/gcc/tree-vect-stmts.c
index 5554fe8..373ecd7 100644
--- a/gcc/tree-vect-stmts.c
+++ b/gcc/tree-vect-stmts.c
@@ -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,