From: Eric Botcazou Date: Wed, 1 Jun 2016 10:35:30 +0000 (+0000) Subject: tree-vect-loop.c (vect_determine_vectorization_factor): Also take into account live... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a0dfeef505c7d5a619cc91d37acbfb9ea2c7f729;p=gcc.git tree-vect-loop.c (vect_determine_vectorization_factor): Also take into account live statements for mask producers. * tree-vect-loop.c (vect_determine_vectorization_factor): Also take into account live statements for mask producers. From-SVN: r236981 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 92a4ed521ff..83a96bd5dc5 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2016-06-01 Eric Botcazou + + * tree-vect-loop.c (vect_determine_vectorization_factor): Also take + into account live statements for mask producers. + 2016-06-01 Richard Biener PR tree-optimization/71311 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index c6e4a61cfa0..fc864d35b6d 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2016-06-01 Eric Botcazou + + * gnat.dg/opt56.ad[sb]: New test. + 2016-06-01 Paolo Carlini PR c++/66635 diff --git a/gcc/testsuite/gnat.dg/opt56.adb b/gcc/testsuite/gnat.dg/opt56.adb new file mode 100644 index 00000000000..9566f51c86b --- /dev/null +++ b/gcc/testsuite/gnat.dg/opt56.adb @@ -0,0 +1,15 @@ +-- { dg-do compile } +-- { dg-options "-O3" } + +package body Opt56 is + + function F (Values : Vector) return Boolean is + Result : Boolean := True; + begin + for I in Values'Range loop + Result := Result and Values (I) >= 0.0; + end loop; + return Result; + end; + +end Opt56; diff --git a/gcc/testsuite/gnat.dg/opt56.ads b/gcc/testsuite/gnat.dg/opt56.ads new file mode 100644 index 00000000000..31ee1953254 --- /dev/null +++ b/gcc/testsuite/gnat.dg/opt56.ads @@ -0,0 +1,7 @@ +package Opt56 is + + type Vector is array (Positive range <>) of Float; + + function F (Values : Vector) return Boolean; + +end Opt56; diff --git a/gcc/tree-vect-loop.c b/gcc/tree-vect-loop.c index 6463a819e5e..1bc132a820c 100644 --- a/gcc/tree-vect-loop.c +++ b/gcc/tree-vect-loop.c @@ -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;