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

            Bug ID: 117171
           Summary: FAIL: gcc.dg/vect/vect-early-break_82.c with forced
                    SLP
           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-early-break_82.c fails because we are asked to create a
vector(2) <signed-boolean:64> external.  The

 _23 = _21 & _22

with the external _22 = x$imag_6 == $t$imag_16 stmt isn't covered by
pattern detection.  For non-SLP we are doing the "obvious" here:

note:  created new init_stmt: _81 = _22 ? -1 : 0;
note:  created new init_stmt: vect_cst__82 = {_81, _81};

but with AVX512 this shows

  vector(8) <signed-boolean:1> vect_cst__82;
  _81 = _22 ? -1 : 0;
  vect_cst__82 = {_81, _81, _81, _81, _81, _81, _81, _81};

which is sub-optimal, esp. when there'll be more than one def (SLP!)
involved.  Instead we'd want to generate

  _81 = { _22, _22, ... };
  vect_cst__82 = _81 != { 0, 0, ... };

thus a vector compare we need to have support for.

This is in the end the famous vect_maybe_update_slp_op_vectype

  /* For external defs refuse to produce VECTOR_BOOLEAN_TYPE_P, those
     should be handled by patters.  Allow vect_constant_def for now.  */
  if (VECTOR_BOOLEAN_TYPE_P (vectype)
      && SLP_TREE_DEF_TYPE (op) == vect_external_def)
    return false;

we'd need to improve.  Alternatively operations on mask bools need to be
pattern-handled as well.

Reply via email to