tree-vect-patterns.c (vect_recog_vector_vector_shift_pattern): Properly set vector...
authorRichard Biener <rguenther@suse.de>
Wed, 13 Jun 2018 15:03:50 +0000 (15:03 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Wed, 13 Jun 2018 15:03:50 +0000 (15:03 +0000)
2018-06-13  Richard Biener  <rguenther@suse.de>

* tree-vect-patterns.c (vect_recog_vector_vector_shift_pattern):
Properly set vector type of the intermediate stmt.
* tree-vect-stmts.c (vectorizable_operation): The destination
var always has vectype_out type.

From-SVN: r261553

gcc/ChangeLog
gcc/tree-vect-patterns.c
gcc/tree-vect-stmts.c

index e74509fa3f93a04dd57919e9514e48d6985636db..8531f11d2af12d88444ff8b6ba35809ede840c9e 100644 (file)
@@ -1,3 +1,10 @@
+2018-06-13  Richard Biener  <rguenther@suse.de>
+
+       * tree-vect-patterns.c (vect_recog_vector_vector_shift_pattern):
+       Properly set vector type of the intermediate stmt.
+       * tree-vect-stmts.c (vectorizable_operation): The destination
+       var always has vectype_out type.
+
 2018-06-13  Jeff Law  <law@redhat.com>
 
        * config/rl78/rl78.c (move_elim_pass): Use TDF_NONE rather than
index f99484f1da5c84455889c00ad4b64b65a2bf3b30..74f08cf852862b53a41a624c73dec44d1cc939a3 100644 (file)
@@ -2185,6 +2185,11 @@ vect_recog_vector_vector_shift_pattern (vec<gimple *> *stmts,
                                       TYPE_PRECISION (TREE_TYPE (oprnd1)));
              def = vect_recog_temp_ssa_var (TREE_TYPE (rhs1), NULL);
              def_stmt = gimple_build_assign (def, BIT_AND_EXPR, rhs1, mask);
+             stmt_vec_info new_stmt_info
+               = new_stmt_vec_info (def_stmt, vinfo);
+             set_vinfo_for_stmt (def_stmt, new_stmt_info);
+             STMT_VINFO_VECTYPE (new_stmt_info)
+               = get_vectype_for_scalar_type (TREE_TYPE (rhs1));
              new_pattern_def_seq (stmt_vinfo, def_stmt);
            }
        }
index da4cb0737edb1f7e576cc75165362424e1401d94..9f365e31e4954cfef25c814220fb0fda1c7e3d11 100644 (file)
@@ -5981,16 +5981,19 @@ vectorizable_operation (gimple *stmt, gimple_stmt_iterator *gsi,
     dump_printf_loc (MSG_NOTE, vect_location,
                      "transform binary/unary operation.\n");
 
-  /* Handle def.  */
-  vec_dest = vect_create_destination_var (scalar_dest, vectype);
-
   /* POINTER_DIFF_EXPR has pointer arguments which are vectorized as
      vectors with unsigned elements, but the result is signed.  So, we
      need to compute the MINUS_EXPR into vectype temporary and
      VIEW_CONVERT_EXPR it into the final vectype_out result.  */
   tree vec_cvt_dest = NULL_TREE;
   if (orig_code == POINTER_DIFF_EXPR)
-    vec_cvt_dest = vect_create_destination_var (scalar_dest, vectype_out);
+    {
+      vec_dest = vect_create_destination_var (scalar_dest, vectype);
+      vec_cvt_dest = vect_create_destination_var (scalar_dest, vectype_out);
+    }
+  /* Handle def.  */
+  else
+    vec_dest = vect_create_destination_var (scalar_dest, vectype_out);
 
   /* In case the vectorization factor (VF) is bigger than the number
      of elements that we can fit in a vectype (nunits), we have to generate