This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC PATCH] Gather vectorization (PR tree-optimization/50789)


Hi Jacob,
this looks really cool. I have a liitle question, since I do not
understand vectorizer as good.

Say, we have a snippet:
int *p;
int idx[N];
int arr[M];
for (...)
{
  p[i%4] += arr[idx[I]];
}
As far as I understand, we cannot do gather we, since p may point to
somewere in arr,
and, idx may took it twice.
E.g. lets take
  idx = {0, 1, 1, 2, 3, 4, 5, 6}
  arr = {0, 1, 0, 0, 0, 0, 0, 0}
  p = arr;
Correct case will have, we'll have something like arr = {0, 2, 2, 0,...}
If we'll have gather, arr may look like                    arr = {0,
2, 1, 0, ...}

So my question, does your patch catch such a cases?

Thanks, K


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]