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

--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
I'll note that for

void foo (long *p, long *q, long *r)
{
  long tem0 = r[0];
  long tem1 = r[1];
  tem0 = tem0 + 1;
  tem1 = tem1 + 2;
  p[0] = tem0;
  p[1] = tem1;
  long tem2 = r[2];
  long tem3 = r[3];
  tem2 = tem2 + 3;
  tem3 = tem3 + 4;
  q[0] = tem0;
  q[1] = tem1;
  q[2] = tem2;
  q[3] = tem3;
}

we'll end up with a dependence issue if the merge both subgraphs, one that
is either correctly handled by not vectorizing (but we won't split the
q[] graph, even when doing SSE vectorization), or we wreck things (SSA form
or wrong-code) when scheduling.  At the moment we are only vectorizing
the p[] store, we build the SLP subgraph for q[] but that fails dependence
checking.  If we had merged both subgraps the overall graph would fail
unless we split the graph at vector boundaries before dependence checking
and code generation.  Splitting might also affect operation analysis
though but with the goal to have operation analysis determine the vector
types used there's a catch-22 for this.

Reply via email to