This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [RFC PATCH] Gather vectorization (PR tree-optimization/50789)
- From: Kirill Yukhin <kirill dot yukhin at gmail dot com>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: Richard Guenther <rguenther at suse dot de>, Ira Rosen <ira dot rosen at linaro dot org>, Uros Bizjak <ubizjak at gmail dot com>, Richard Henderson <rth at redhat dot com>, gcc-patches at gcc dot gnu dot org, Kirill Yukhin <kirill dot yukhin at gmail dot com>
- Date: Fri, 28 Oct 2011 14:01:36 +0400
- Subject: Re: [RFC PATCH] Gather vectorization (PR tree-optimization/50789)
- References: <20111026215604.GG1052@tyan-ft48-01.lab.bos.redhat.com>
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