[LLVMdev] No SSE instructions

Justin Holewinski justin.holewinski at gmail.com
Sun May 22 10:47:44 PDT 2011


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.


>         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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110522/62f69ae6/attachment.html>


More information about the llvm-dev mailing list