re PR tree-optimization/57558 (Loop not vectorized if iteration count could be infinite)
authorBin Cheng <bin.cheng@arm.com>
Fri, 29 Jul 2016 15:48:25 +0000 (15:48 +0000)
committerBin Cheng <amker@gcc.gnu.org>
Fri, 29 Jul 2016 15:48:25 +0000 (15:48 +0000)
commit01d32b2b8b860db7cf58b88aa1880d93dc37c450
tree17c5a12a18cff4922671091f3bf2f74b62ff94d4
parent18767ebc32eaed40760aab394fe77d0815454efd
re PR tree-optimization/57558 (Loop not vectorized if iteration count could be infinite)

PR tree-optimization/57558
* tree-vect-loop-manip.c (vect_create_cond_for_niters_checks): New
function.
(vect_loop_versioning): Support versioning with niter assumptions.
* tree-vect-loop.c (tree-ssa-loop.h): Include header file.
(vect_get_loop_niters): New parameter.  Reimplement to support
assumptions in loop niter info.
(vect_analyze_loop_form_1, vect_analyze_loop_form): Ditto.
(new_loop_vec_info): Init LOOP_VINFO_NITERS_ASSUMPTIONS.
(vect_estimate_min_profitable_iters): Use LOOP_REQUIRES_VERSIONING.
Support loop versioning for niters.
* tree-vectorizer.c (tree-ssa-loop-niter.h): Include header file.
(vect_free_loop_info_assumptions): New function.
(vectorize_loops): Free loop niter info for loops with flag
LOOP_F_ASSUMPTIONS set if vectorization failed.
* tree-vectorizer.h (struct _loop_vec_info): New field
num_iters_assumptions.
(LOOP_VINFO_NITERS_ASSUMPTIONS): New macro.
(LOOP_REQUIRES_VERSIONING_FOR_NITERS): New macro.
(LOOP_REQUIRES_VERSIONING): New macro.
(vect_free_loop_info_assumptions): New decl.

gcc/testsuite
PR tree-optimization/57558
* gcc.dg/vect/pr57558-1.c: New test.
* gcc.dg/vect/pr57558-2.c: New test.

From-SVN: r238877
gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/vect/pr57558-1.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/vect/pr57558-2.c [new file with mode: 0644]
gcc/tree-vect-loop-manip.c
gcc/tree-vect-loop.c
gcc/tree-vectorizer.c
gcc/tree-vectorizer.h