aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-vect-loop.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2015-11-13 08:47:05 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2015-11-13 08:47:05 +0000
commit6faa91548255490c2dc61a25596c33e6d5fc537e (patch)
tree8a8cc788a0c902fd555da4e4b75780767388150c /gcc/tree-vect-loop.c
parentf913cc2a6f1bf17158017c7296b470ef5db181c8 (diff)
downloadgcc-6faa91548255490c2dc61a25596c33e6d5fc537e.zip
gcc-6faa91548255490c2dc61a25596c33e6d5fc537e.tar.gz
gcc-6faa91548255490c2dc61a25596c33e6d5fc537e.tar.bz2
tree-vect-loop.c (vect_analyze_loop_2): Add fatal parameter.
2015-11-13 Richard Biener <rguenther@suse.de> * tree-vect-loop.c (vect_analyze_loop_2): Add fatal parameter. Signal fatal failure if early checks fail. (vect_analyze_loop): If vect_analyze_loop_2 fails fatally do not bother testing further vector sizes. From-SVN: r230292
Diffstat (limited to 'gcc/tree-vect-loop.c')
-rw-r--r--gcc/tree-vect-loop.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/gcc/tree-vect-loop.c b/gcc/tree-vect-loop.c
index 55e5309..b2fac61 100644
--- a/gcc/tree-vect-loop.c
+++ b/gcc/tree-vect-loop.c
@@ -1709,13 +1709,16 @@ vect_analyze_loop_operations (loop_vec_info loop_vinfo)
for it. The different analyses will record information in the
loop_vec_info struct. */
static bool
-vect_analyze_loop_2 (loop_vec_info loop_vinfo)
+vect_analyze_loop_2 (loop_vec_info loop_vinfo, bool &fatal)
{
bool ok;
int max_vf = MAX_VECTORIZATION_FACTOR;
int min_vf = 2;
unsigned int n_stmts = 0;
+ /* The first group of checks is independent of the vector size. */
+ fatal = true;
+
/* Find all data references in the loop (which correspond to vdefs/vuses)
and analyze their evolution in the loop. */
@@ -1795,7 +1798,6 @@ vect_analyze_loop_2 (loop_vec_info loop_vinfo)
/* Classify all cross-iteration scalar data-flow cycles.
Cross-iteration cycles caused by virtual phis are analyzed separately. */
-
vect_analyze_scalar_cycles (loop_vinfo);
vect_pattern_recog (loop_vinfo);
@@ -1825,6 +1827,9 @@ vect_analyze_loop_2 (loop_vec_info loop_vinfo)
return false;
}
+ /* While the rest of the analysis below depends on it in some way. */
+ fatal = false;
+
/* Analyze data dependences between the data-refs in the loop
and adjust the maximum vectorization factor according to
the dependences.
@@ -2118,7 +2123,8 @@ vect_analyze_loop (struct loop *loop)
return NULL;
}
- if (vect_analyze_loop_2 (loop_vinfo))
+ bool fatal = false;
+ if (vect_analyze_loop_2 (loop_vinfo, fatal))
{
LOOP_VINFO_VECTORIZABLE_P (loop_vinfo) = 1;
@@ -2128,7 +2134,8 @@ vect_analyze_loop (struct loop *loop)
destroy_loop_vec_info (loop_vinfo, true);
vector_sizes &= ~current_vector_size;
- if (vector_sizes == 0
+ if (fatal
+ || vector_sizes == 0
|| current_vector_size == 0)
return NULL;