<div dir="ltr">Hi Nadav, Arnold, (now copying LLVM-dev, not commits),<br><div class="gmail_quote"><div dir="ltr"><div><br></div><div>I'm working on an example of a code that current GCC trunk can vectorize but LLVM cannot, and after analysing the intermediate IR just before the loop vectorization and by stepping through the process, I can see that the vectorizer only recognizes integer and float reduction variables, not pointers.</div>
<div><br></div><div>My code looks like this:</div><div><br></div><div>for (i: 0 -> MAX) {<br></div><div> a = *read;</div><div> b = *read;</div><div> c = *read;</div><div><br></div><div> // do the same stuff to a, b, c</div>
<div><br></div><div> *write++ = a;</div><div> *write++ = b;</div><div> *write++ = c;</div><div>}</div><div><br></div><div>Vectorizing this is very simple and it's a sequence of VLD3 + VOPS + VST3, which GCC does it nicely, but we don't.<br>
</div><div><br></div><div>What would be the steps in adding a pointer increment reduction kind (RK_PointerInc)? I believe the logic would be similar to RK_IntegerAdd, but with a stride of type size, right?</div><div><br>
</div>
<div>Or maybe we'd have to translate the loop into something like:</div><div><br></div><div>for (i: 0 -> MAX, +=3) {</div><div> write[i] = (op) read[i];</div><div> write[i+1] = (op) read[i+1];</div><div> write[i+2] = (op) read[i+2];</div>
<div>}</div><div><br></div><div>So that the reduction variable gets recognized?</div><div><br></div><div>cheers,</div><div>--renato</div></div>
</div><br></div>