tree-vect-loop.c (vect_determine_vectorization_factor): Also take into account live...
authorEric Botcazou <ebotcazou@adacore.com>
Wed, 1 Jun 2016 10:35:30 +0000 (10:35 +0000)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Wed, 1 Jun 2016 10:35:30 +0000 (10:35 +0000)
* tree-vect-loop.c (vect_determine_vectorization_factor): Also take
into account live statements for mask producers.

From-SVN: r236981

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gnat.dg/opt56.adb [new file with mode: 0644]
gcc/testsuite/gnat.dg/opt56.ads [new file with mode: 0644]
gcc/tree-vect-loop.c

index 92a4ed521ffd0d1e85309638970cded0664c1010..83a96bd5dc5c5aab4f48cf17cdc3cb664638f9b1 100644 (file)
@@ -1,3 +1,8 @@
+2016-06-01  Eric Botcazou  <ebotcazou@adacore.com>
+
+       * tree-vect-loop.c (vect_determine_vectorization_factor): Also take
+       into account live statements for mask producers.
+
 2016-06-01  Richard Biener  <rguenther@suse.de>
 
        PR tree-optimization/71311
index c6e4a61cfa0e137ee4111f65200753f344256cba..fc864d35b6debd420d500a27a6dd88a458eeeae0 100644 (file)
@@ -1,3 +1,7 @@
+2016-06-01  Eric Botcazou  <ebotcazou@adacore.com>
+
+       * gnat.dg/opt56.ad[sb]: New test.
+
 2016-06-01  Paolo Carlini  <paolo.carlini@oracle.com>
 
        PR c++/66635
diff --git a/gcc/testsuite/gnat.dg/opt56.adb b/gcc/testsuite/gnat.dg/opt56.adb
new file mode 100644 (file)
index 0000000..9566f51
--- /dev/null
@@ -0,0 +1,15 @@
+-- { dg-do compile }\r
+-- { dg-options "-O3" }\r
+\r
+package body Opt56 is\r
+\r
+   function F (Values : Vector) return Boolean is\r
+      Result : Boolean := True;\r
+   begin\r
+      for I in Values'Range loop\r
+         Result := Result and Values (I) >= 0.0;\r
+     end loop;\r
+     return Result;\r
+   end;\r
+\r
+end Opt56;\r
diff --git a/gcc/testsuite/gnat.dg/opt56.ads b/gcc/testsuite/gnat.dg/opt56.ads
new file mode 100644 (file)
index 0000000..31ee195
--- /dev/null
@@ -0,0 +1,7 @@
+package Opt56 is\r
+\r
+   type Vector is array (Positive range <>) of Float;\r
+\r
+   function F (Values : Vector) return Boolean;\r
+\r
+end Opt56;\r
index 6463a819e5e0448259bb0bd808be20dd55ee3d1e..1bc132a820c94018bc108fd861c3bc1f6fd7e115 100644 (file)
@@ -441,7 +441,8 @@ vect_determine_vectorization_factor (loop_vec_info loop_vinfo)
                  && is_gimple_assign (stmt)
                  && gimple_assign_rhs_code (stmt) != COND_EXPR)
                {
-                 if (STMT_VINFO_RELEVANT_P (stmt_info))
+                 if (STMT_VINFO_RELEVANT_P (stmt_info)
+                     || STMT_VINFO_LIVE_P (stmt_info))
                    mask_producers.safe_push (stmt_info);
                  bool_result = true;