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

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
So w/o SLP we reject this with

  if ((double_reduc || reduction_type != TREE_CODE_REDUCTION)
      && ncopies > 1)
    {         
      if (dump_enabled_p ())
        dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
                         "multiple types in double reduction or condition "
                         "reduction or fold-left reduction.\n");
      return false;

reduction_type is EXTRACT_LAST_REDUCTION here.  For SLP we only disallow

  if ((reduction_type == COND_REDUCTION
       || reduction_type == INTEGER_INDUC_COND_REDUCTION
       || reduction_type == CONST_COND_REDUCTION)
      && slp_node
      && SLP_TREE_NUMBER_OF_VEC_STMTS (slp_node) > 1)
    {                            
      if (dump_enabled_p ())
        dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
                         "multiple types in condition reduction reduction.\n");
      return false;
    }

I've recently fixed a fold-left reduction case with multiple types
which we handle just fine.  I have a patch amending the above condition
(EXTRACT_LAST is an optimized COND_REDUCTION).

Reply via email to