]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
tree-vect-stmts.c (vectorizable_shift): Give up if op1 has different vector mode...
authorJakub Jelinek <jakub@redhat.com>
Fri, 28 Oct 2011 09:25:18 +0000 (11:25 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Fri, 28 Oct 2011 09:25:18 +0000 (11:25 +0200)
* tree-vect-stmts.c (vectorizable_shift): Give up if op1 has different
vector mode from vectype's mode.

From-SVN: r180606

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

index 61320f852ab756dc66cb489ecb199eabd6819095..282cb6dfa1f3758cef130e3a8e6102ea4bf7f37c 100644 (file)
@@ -1,3 +1,8 @@
+2011-10-28  Jakub Jelinek  <jakub@redhat.com>
+
+       * tree-vect-stmts.c (vectorizable_shift): Give up if op1 has different
+       vector mode from vectype's mode.
+
 2011-10-28  Chung-Lin Tang  <cltang@codesourcery.com>
 
        PR rtl-optimization/49720
index 4cd582dad892ac403e931bf740b9b915c0fb6200..dc81acb77e6d05f46f7a698609458e37f55f5847 100644 (file)
@@ -2318,6 +2318,7 @@ vectorizable_shift (gimple stmt, gimple_stmt_iterator *gsi,
   int nunits_in;
   int nunits_out;
   tree vectype_out;
+  tree op1_vectype;
   int ncopies;
   int j, i;
   VEC (tree, heap) *vec_oprnds0 = NULL, *vec_oprnds1 = NULL;
@@ -2387,7 +2388,8 @@ vectorizable_shift (gimple stmt, gimple_stmt_iterator *gsi,
     return false;
 
   op1 = gimple_assign_rhs2 (stmt);
-  if (!vect_is_simple_use (op1, loop_vinfo, bb_vinfo, &def_stmt, &def, &dt[1]))
+  if (!vect_is_simple_use_1 (op1, loop_vinfo, bb_vinfo, &def_stmt, &def,
+                            &dt[1], &op1_vectype))
     {
       if (vect_print_dump_info (REPORT_DETAILS))
         fprintf (vect_dump, "use not simple.");
@@ -2444,6 +2446,13 @@ vectorizable_shift (gimple stmt, gimple_stmt_iterator *gsi,
       optab = optab_for_tree_code (code, vectype, optab_vector);
       if (vect_print_dump_info (REPORT_DETAILS))
         fprintf (vect_dump, "vector/vector shift/rotate found.");
+      if (TYPE_MODE (op1_vectype) != TYPE_MODE (vectype))
+       {
+         if (vect_print_dump_info (REPORT_DETAILS))
+           fprintf (vect_dump, "unusable type for last operand in"
+                               " vector/vector shift/rotate.");
+         return false;
+       }
     }
   /* See if the machine has a vector shifted by scalar insn and if not
      then see if it has a vector shifted by vector insn.  */