[llvm-dev] Clang error to emit llvm code

Raul Garcia via llvm-dev llvm-dev at lists.llvm.org
Thu Oct 13 08:13:01 PDT 2016


Hello All,

I want to obtain the LLVM IR of a program (pixel-test.c from pixman library), I am using the following command to obtain the LLVM IR representation of this program:

 $ clang -fsyntax-only ./test/pixel-test.c  -S -emit-llvm -o pixel-test.ll 

However I get the following error:

./test/utils-prng.h:137:32: error: can't convert between vector values of different size ('uint32x4' and 'int')
    uint32x4 e = x->a - ((x->b << 27) + (x->b >> (32 - 27)));
                          ~~~~ ^  ~~
./test/utils-prng.h:137:47: error: can't convert between vector values of different size ('uint32x4' and 'int')
    uint32x4 e = x->a - ((x->b << 27) + (x->b >> (32 - 27)));
                                         ~~~~ ^  ~~~~~~~~~
./test/utils-prng.h:138:26: error: can't convert between vector values of different size ('uint32x4' and 'int')
    x->a = x->b ^ ((x->c << 17) ^ (x->c >> (32 - 17)));
                    ~~~~ ^  ~~
./test/utils-prng.h:138:41: error: can't convert between vector values of different size ('uint32x4' and 'int')
    x->a = x->b ^ ((x->c << 17) ^ (x->c >> (32 - 17)));

It looks like clang is having trouble to convert a vector data type to an integer. Is there a patch/workaround to be able to generate the LLVM IR?
 I am using clang 3.9, I am attaching the source file that causes the error.
  
-------------- next part --------------
A non-text attachment was scrubbed...
Name: utils-prng.h
Type: text/x-chdr
Size: 6063 bytes
Desc: utils-prng.h
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20161013/be549245/attachment.h>


More information about the llvm-dev mailing list