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

--- Comment #5 from Richard Biener <rguenth at gcc dot gnu.org> ---
supportable_widening_operation fails at transform time - that's likely because
vectorizable_reduction "puns" defs to internal_def so the check should
probably instead look like

diff --git a/gcc/tree-vect-stmts.cc b/gcc/tree-vect-stmts.cc
index 3b22f4e4a73..485463b5f14 100644
--- a/gcc/tree-vect-stmts.cc
+++ b/gcc/tree-vect-stmts.cc
@@ -14195,8 +14195,7 @@ supportable_widening_operation (vec_info *vinfo,
              by STMT is only directly used in the reduction statement.  */
          tree lhs = gimple_assign_lhs (vect_orig_stmt (stmt_info)->stmt);
          stmt_vec_info use_stmt_info = loop_info->lookup_single_use (lhs);
-         if (use_stmt_info
-             && STMT_VINFO_DEF_TYPE (use_stmt_info) == vect_reduction_def)
+         if (use_stmt_info && STMT_VINFO_REDUC_DEF (use_stmt_info))
            return true;
         }
       c1 = VEC_WIDEN_MULT_LO_EXPR;

that fixes the reduced testcase on x86_64, using widen_{odd,even} mults.

Xi Ruoyao - can you pick up from here?

Reply via email to