tree-vect-stmts.c (vectorizable_assignment): Support useless boolean conversion.
authorIlya Enkovich <enkovich.gnu@gmail.com>
Thu, 10 Dec 2015 11:23:50 +0000 (11:23 +0000)
committerIlya Enkovich <ienkovich@gcc.gnu.org>
Thu, 10 Dec 2015 11:23:50 +0000 (11:23 +0000)
gcc/

* tree-vect-stmts.c (vectorizable_assignment): Support
useless boolean conversion.

From-SVN: r231503

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

index 0f2254853598a38e89ff7d31b2c646320b58b6fa..aca8e944477bff7c8f9de2e98a1eff13cb19f98d 100644 (file)
@@ -1,3 +1,8 @@
+2015-12-10  Ilya Enkovich  <enkovich.gnu@gmail.com>
+
+       * tree-vect-stmts.c (vectorizable_assignment): Support
+       useless boolean conversion.
+
 2015-12-10  Alan Lawrence  <alan.lawrence@arm.com>
 
        * doc/install.texi: Add note against GNAT 4.8 on ARM targets.
index 56aa2c8cce583c42120d90f3073bec068d098b2a..5377d1553c647529525afcb8395818e508a4fafe 100644 (file)
@@ -4310,7 +4310,12 @@ vectorizable_assignment (gimple *stmt, gimple_stmt_iterator *gsi,
       /* But a conversion that does not change the bit-pattern is ok.  */
       && !((TYPE_PRECISION (TREE_TYPE (scalar_dest))
            > TYPE_PRECISION (TREE_TYPE (op)))
-          && TYPE_UNSIGNED (TREE_TYPE (op))))
+          && TYPE_UNSIGNED (TREE_TYPE (op)))
+      /* Conversion between boolean types of different sizes is
+        a simple assignment in case their vectypes are same
+        boolean vectors.  */
+      && (!VECTOR_BOOLEAN_TYPE_P (vectype)
+         || !VECTOR_BOOLEAN_TYPE_P (vectype_in)))
     {
       if (dump_enabled_p ())
         dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,