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

--- Comment #15 from JuzheZhong <juzhe.zhong at rivai dot ai> ---
Also, I find this following case that ARM SVE failed to optimize:

https://godbolt.org/z/d6YnneETj

#define N 16

typedef int half_word;

int foo2 ()
{
  int i;
  half_word ia[N];
  half_word ic[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
  half_word ib[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};

  /* Not worthwhile, only 2 parts per int */
  for (i = 0; i < N; i++)
    {
      ia[i] = ib[i] + ic[i];
    }

  /* check results:  */
  for (i = 0; i < N; i++)
    {
      if (ia[i] != ib[i] + ic[i])
        abort ();
    }

  return 0;
}

I guess your approach can fix that for ARM SVE.  Maybe ARM SVE can also add
this case too.

Reply via email to