PR82228: Move ncopies calculation in vectorizable_live_operation
authorRichard Sandiford <richard.sandiford@linaro.org>
Sat, 16 Sep 2017 20:39:01 +0000 (20:39 +0000)
committerRichard Sandiford <rsandifo@gcc.gnu.org>
Sat, 16 Sep 2017 20:39:01 +0000 (20:39 +0000)
This should have been after the early exit for non-vectorised statements.

2017-09-16  Richard Sandiford  <richard.sandiford@linaro.org>

gcc/
PR tree-optimization/82228
* tree-vect-loop.c (vectorizable_live_operation): Move initialization
of ncopies.

From-SVN: r252888

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

index b5a39b9b0d27c2acba1e2904a5176341a2125391..e213db6e2a07b52a71aab1d1cc054a267bfd0db5 100644 (file)
@@ -1,3 +1,9 @@
+2017-09-16  Richard Sandiford  <richard.sandiford@linaro.org>
+
+       PR tree-optimization/82228
+       * tree-vect-loop.c (vectorizable_live_operation): Move initialization
+       of ncopies.
+
 2017-09-16  Chung-Ju Wu  <jasonwucj@gmail.com>
 
        * common/config/nds32/nds32-common.c
index 80eb4f1fda9734935f87cd7610a63861c1d21430..c7cc79fd76db0ed0fc878fecfa7fdd9f7bde5edd 100644 (file)
@@ -7029,11 +7029,6 @@ vectorizable_live_operation (gimple *stmt,
 
   gcc_assert (STMT_VINFO_LIVE_P (stmt_info));
 
-  if (slp_node)
-    ncopies = 1;
-  else
-    ncopies = vect_get_num_copies (loop_vinfo, vectype);
-
   if (STMT_VINFO_DEF_TYPE (stmt_info) == vect_reduction_def)
     return false;
 
@@ -7054,6 +7049,11 @@ vectorizable_live_operation (gimple *stmt,
       return true;
     }
 
+  if (slp_node)
+    ncopies = 1;
+  else
+    ncopies = vect_get_num_copies (loop_vinfo, vectype);
+
   if (!vec_stmt)
     /* No transformation required.  */
     return true;