On 18 August 2011 12:45, Andrew Stubbs andrew.stubbs@linaro.org wrote:
On 18/08/11 06:56, Ira Rosen wrote:
How can I tell the vectoriser that a input is a multiple of something?
Unfortunately, I don't think you can.
I think you can do something like this:
void multiple(struct image * __restrict dst, struct image * __restrict src, int h) { if (h & 0xf) __gcc_unreachable ();
for (int i = 0; i < h; i++) { dst->d[i] = A*src->d[i] + B*src->d[i+1]; } }
[Just off the top of my head - you'd have to check the syntax for gcc_unreachable.]
That should allow the value range propagation to do the right thing whilst inserting no real code, but whether that's properly hooked into vectorization I have no idea?
Yes, the problem is that the vectorizer (or more precisely loop iteration analysis in tree-ssa-loop-niter.c) doesn't use this information.
Ira
Andrew