[2/3] Vectorize inductions that are live after the loop
authorAlan Hayward <alan.hayward@arm.com>
Fri, 3 Jun 2016 13:00:06 +0000 (13:00 +0000)
committerAlan Hayward <alahay01@gcc.gnu.org>
Fri, 3 Jun 2016 13:00:06 +0000 (13:00 +0000)
commitb28ead45fe630b9e018a81cb46b7e1f971e4dc17
tree8158807035672c6080932262ccede47287be36b7
parentc83a894c1e437a1653fc38b537d3bb98a91e5631
[2/3] Vectorize inductions that are live after the loop

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

[2/3] Vectorize inductions that are live after the loop

gcc/
* 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
BIT_FIELD_REF.  Remove special case for gimple assigns stmts.
* tree-vect-stmts.c (is_simple_and_all_uses_invariant): New function.
(vect_stmt_relevant_p): Check for stmts which are only used live.
(process_use): Use of a stmt does not inherit it's live value.
(vect_mark_stmts_to_be_vectorized): Simplify relevance inheritance.
(vect_analyze_stmt): Check for new relevant state.
* tree-vectorizer.h (vect_relevant): New entry for a stmt which is used
outside the loop, but not inside it.

testsuite/
* 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.
* gcc.dg/vect/vect-live-2.c: New test.
* gcc.dg/vect/vect-live-3.c: New test.
* gcc.dg/vect/vect-live-4.c: New test.
* gcc.dg/vect/vect-live-5.c: New test.
* gcc.dg/vect/vect-live-slp-1.c: New test.
* gcc.dg/vect/vect-live-slp-2.c: New test.
* gcc.dg/vect/vect-live-slp-3.c: New test.

From-SVN: r237064
15 files changed:
gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/tree-ssa/pr64183.c
gcc/testsuite/gcc.dg/vect/no-scevccp-vect-iv-2.c
gcc/testsuite/gcc.dg/vect/vect-live-1.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/vect/vect-live-2.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/vect/vect-live-3.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/vect/vect-live-4.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/vect/vect-live-5.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/vect/vect-live-slp-1.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/vect/vect-live-slp-2.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/vect/vect-live-slp-3.c [new file with mode: 0644]
gcc/tree-vect-loop.c
gcc/tree-vect-stmts.c
gcc/tree-vectorizer.h