<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On May 22, 2011, at 10:47 AM, Justin Holewinski wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div class="gmail_quote">On Sun, May 22, 2011 at 1:07 PM, Serg Anohovsky <span dir="ltr"><<a href="mailto:serg.anohovsky@gmail.com">serg.anohovsky@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hello.<div>I have compiled the simple program:</div><div><br></div><div><div>#include <stdio.h></div><div>#include <stdlib.h></div><div><br></div><div>int v1[10000];</div><div><br></div><div>int main()</div><div>
{</div><div> int i;</div><div><br></div><div> for (i = 0; i < 10000; i++) {</div><div> v1[i] = i;</div><div> }</div><div><br></div></div></blockquote><div><br></div><div>This loop is not really vectorizable, even if LLVM had an auto-vectorizer. You need the same operation (floating-point or integer) applied to contiguous elements in a vector. An example of a vectorizable loop body would be "v1[i] = v1[i] * v1[i]" Then, you could use SSE (or any other vector instruction set) to get a substantial speed improvement.</div></div></blockquote><div><br></div><div>This is vectorizable. Just start out with a vector of constants <0, 1, 2, 3> and do a store of it every time through the loop, adding <4,4,4,4> as you go.</div><div><br></div><div>-Chris</div><br><blockquote type="cite"><div class="gmail_quote">
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div><div></div><div> for (i = 0; i < 10000; i++) {</div>
<div> printf("%d ", v1[i]);</div><div> }</div><div><br></div><div> return 0;</div><div>}</div></div><div><br></div><div>Next, I disasseble the executable file and have not found any SSE instructions.</div>
<div>I know that LLVM support SSE.</div><div>So my questions:</div><div> 1. It is occur only in my computer?</div><div> 2. If it is not only my bug, then there are not SSE optimizations in LLVM? </div><div> 3. Have anyone, already worked on this problem? </div>
<div><br></div><div>--</div><div>Serg Anohovsky.</div>
<br>_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a> <a href="http://llvm.cs.uiuc.edu/" target="_blank">http://llvm.cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br><br><div>Thanks,</div><div><br></div><div>Justin Holewinski</div><br>
_______________________________________________<br>LLVM Developers mailing list<br><a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a> <a href="http://llvm.cs.uiuc.edu">http://llvm.cs.uiuc.edu</a><br><a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br></blockquote></div><br></body></html>