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

--- Comment #58 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
As a different testcase showing what still needs to be done is e.g.
void
foo (int *p, int *q, int *r, int *s, int *t, int *u)
{
  #pragma omp simd
  for (int i = 0; i < 1024; i++)
    {
      int vp = p[i];
      int vq = q[i];
      int vr = r[i];
      int vs = s[i];
      int vt = t[i];
      int vu = u[i];
      int vw;
      if (vp != 0)
        {
          if (vp > 100)
            {
              if (vq < 200)
                vw = 1;
              else if (vr)
                vw = 2;
              else
                vw = 3;
            }
          else if (vs > 100)
            {
              if (vq < 180)
                vw = 4;
              else if (vr > 20)
                vw = 5;
              else
                vw = 6;
            }
          else
            {
              if (vq < -100)
                vw = 7;
              else if (vr < -20)
                vw = 8;
              else
                vw = 9;
            }
        }
      else if (vt > 10)
        {
          if (vu > 100)
            vw = 10;
          else if (vu < -100)
            vw = 11;
          else
            vw = 12;
        }
      else
        vw = 13;
      u[i] = vw;
    }
}
with -O2 -fopenmp-simd.
I think we still need 12 VEC_COND_EXPRs to merge it all together, but if we
follow what the source is doing (or rediscover it), we can certainly
avoid so many useless &s on the conditions by merging it together in the right
order.

Reply via email to