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

            Bug ID: 126388
           Summary: BB SLP promoted external node sources not considered
                    live
           Product: gcc
           Version: 17.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: rguenth at gcc dot gnu.org
            Blocks: 53947
  Target Milestone: ---

void foo (long *p, long *q, long *r)
{
  long tem0 = r[0];
  long tem1 = r[1];
  long tem2 = r[2];
  long tem3 = r[3];
  long tem4 = r[4];
  long tem5 = r[5];
  long tem6 = r[6];
  long tem7 = r[7];
  tem0 = tem0 + 1;
  tem1 = tem1 + 2;
  tem2 = tem2 + 3;
  tem3 = tem3 + 4;
  tem4 = tem4 + 5;
  tem5 = tem5 + 6;
  tem6 = tem6 + 7;
  tem7 = tem7 + 8;
  p[0] = tem2;
  p[1] = tem3;
  p[2] = tem4;
  p[3] = tem5;
  p[4] = tem6;
  p[5] = tem7;
  q[0] = tem0;
  q[1] = tem1;
  q[2] = tem2;
  q[3] = tem3;
  q[4] = tem4;
  q[5] = tem5;
  q[6] = tem6;
  q[7] = tem7;
}

When doing AVX512 vect and subgraph merging for the 6-lane part to AVX2 + SSE
the AVX2 permute from the AVX512 part is promoted external but the then
live lanes of the AVX512 part are not identified as such.  The two subgraphs
are costed separately (correctly so).

A testcase with uniform lanes but unvectorizable (thus promoted extern)
operation can be possibly constructed so we do not rely on the odd
subgraph merging here.


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53947
[Bug 53947] [meta-bug] vectorizer missed-optimizations

Reply via email to