tree-vect-loop.c (vect_transform_loop): Fix epilogue iterations for epilogue vectoriz...
authorRichard Biener <rguenther@suse.de>
Tue, 4 Dec 2018 13:23:13 +0000 (13:23 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Tue, 4 Dec 2018 13:23:13 +0000 (13:23 +0000)
2018-12-04  Richard Biener  <rguenther@suse.de>

* tree-vect-loop.c (vect_transform_loop): Fix epilogue iterations
for epilogue vectorization.

From-SVN: r266777

gcc/ChangeLog
gcc/tree-vect-loop.c

index 4bb7187ceb2a30492583b20a73efcebecfd2a45c..a4d0c7c82556e4ec8ebed7af2069f71e922731ef 100644 (file)
@@ -1,3 +1,8 @@
+2018-12-04  Richard Biener  <rguenther@suse.de>
+
+       * tree-vect-loop.c (vect_transform_loop): Fix epilogue iterations
+       for epilogue vectorization.
+
 2018-12-04  Richard Biener  <rguenther@suse.de>
 
        PR tree-optimization/88301
index fa926f4ebb5b4307b1b4e614056e5ba9bf2f4c9a..8934d0e4dd0a118250d5a6d80303eac2e6165522 100644 (file)
@@ -8501,13 +8501,13 @@ vect_transform_loop (loop_vec_info loop_vinfo)
       targetm.vectorize.autovectorize_vector_sizes (&vector_sizes);
       unsigned int next_size = 0;
 
+      /* Note LOOP_VINFO_NITERS_KNOWN_P and LOOP_VINFO_INT_NITERS work
+         on niters already ajusted for the iterations of the prologue.  */
       if (LOOP_VINFO_NITERS_KNOWN_P (loop_vinfo)
-         && LOOP_VINFO_PEELING_FOR_ALIGNMENT (loop_vinfo) >= 0
          && known_eq (vf, lowest_vf))
        {
-         unsigned int eiters
+         unsigned HOST_WIDE_INT eiters
            = (LOOP_VINFO_INT_NITERS (loop_vinfo)
-              - LOOP_VINFO_PEELING_FOR_ALIGNMENT (loop_vinfo)
               - LOOP_VINFO_PEELING_FOR_GAPS (loop_vinfo));
          eiters
            = eiters % lowest_vf + LOOP_VINFO_PEELING_FOR_GAPS (loop_vinfo);