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

            Bug ID: 117556
           Summary: gcc.dg/vect/vect-live-slp-3.c fails to SLP with
                    variable-length vectors
           Product: gcc
           Version: 15.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: rguenth at gcc dot gnu.org
  Target Milestone: ---

gcc.dg/vect/vect-live-slp-3.c:31:1: missed:   Cannot determine which vector
holds the final result.
gcc.dg/vect/vect-live-slp-3.c:31:1: missed:   not vectorized: live stmt not
supported: n0_29 = *_4;
gcc.dg/vect/vect-live-slp-3.c:31:1: note:   unsupported SLP instance starting
from: *_14 = _15;

on aarch64 with SVE we fall back to AdvSIMD, with RISC-V we fall back to
fixed length modes.

With --param vect-force-slp=0 we can use VLA vectors.

The above is

bool                              
vectorizable_live_operation (vec_info *vinfo, stmt_vec_info stmt_info,
                             slp_tree slp_node, slp_instance slp_node_instance,
                             int slp_index, bool vec_stmt_p,  
                             stmt_vector_for_cost *cost_vec)
{       
...
      /* Calculate which vector contains the result, and which lane of
         that vector we need.  */
      if (!can_div_trunc_p (pos, nunits, &vec_entry, &vec_index))
        {
          if (dump_enabled_p ())
            dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
                             "Cannot determine which vector holds the"
                             " final result.\n");
          return false;
        }

I suppose for single-lane SLP this can possibly be relaxed.

Reply via email to