[LLVMdev] No SSE instructions

Chris Lattner clattner at apple.com
Sun May 22 10:51:58 PDT 2011


On May 22, 2011, at 10:47 AM, Justin Holewinski wrote:

> On Sun, May 22, 2011 at 1:07 PM, Serg Anohovsky <serg.anohovsky at gmail.com> wrote:
> Hello.
> I have compiled the simple program:
> 
> #include <stdio.h>
> #include <stdlib.h>
> 
> int v1[10000];
> 
> int main()
> {
>         int i;
> 
>         for (i = 0; i < 10000; i++) {
>                 v1[i] = i;
>         }
> 
> 
> 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.

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.

-Chris

>  
>         for (i = 0; i < 10000; i++) {
>                 printf("%d ", v1[i]);
>         }
> 
>         return 0;
> }
> 
> Next, I disasseble the executable file and have not found any SSE instructions.
> I know that LLVM support SSE.
> So my questions:
>   1. It is occur only in my computer?
>   2. If it is not only my bug, then there are not SSE optimizations in LLVM? 
>   3. Have anyone, already worked on this problem? 
> 
> --
> Serg Anohovsky.
> 
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
> 
> 
> 
> 
> -- 
> 
> Thanks,
> 
> Justin Holewinski
> 
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110522/fee15322/attachment.html>


More information about the llvm-dev mailing list