https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70138

--- Comment #10 from Richard Biener <rguenth at gcc dot gnu.org> ---
So I have a simple patch, still undecided whether I should include
vect_nested_cycle (and thus use VECTORIZABLE_CYCLE_DEF) or not.  It's simply
vect_double_reduction_def that is missing for this testcase (and adding that
is "obvious" - both vect_double_reduction_def and vect_reduction_def are the
"outer" reduction).

Index: tree-vect-loop-manip.c
===================================================================
--- tree-vect-loop-manip.c      (revision 234025)
+++ tree-vect-loop-manip.c      (working copy)
@@ -1692,7 +1687,7 @@ vect_update_ivs_after_vectorizer (loop_v

       /* Skip reduction phis.  */
       stmt_info = vinfo_for_stmt (phi);
-      if (STMT_VINFO_DEF_TYPE (stmt_info) == vect_reduction_def)
+      if (VECTORIZABLE_CYCLE_DEF (STMT_VINFO_DEF_TYPE (stmt_info)))
         {
          if (dump_enabled_p ())
            dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,

I guess I'll go with just adding vect_double_reduction_def for now.  Ah,
it only looks at the outer loop PHIs anyway so can never get
vect_nested_cycle.

Reply via email to