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>
Hi Raul, On 13 October 2016 at 08:13, Raul Garcia via llvm-dev <llvm-dev at lists.llvm.org> wrote:> ./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)));This looks like a bug in Clang 3.9. It seems to have been fixed in r281669 (https://github.com/llvm-mirror/clang/commit/38edf4). It might be worth trying to get it into 3.9.1 when that process starts. Cheers. Tim.
> On Oct 13, 2016, at 9:24 AM, Tim Northover via llvm-dev <llvm-dev at lists.llvm.org> wrote: > > Hi Raul, > > On 13 October 2016 at 08:13, Raul Garcia via llvm-dev > <llvm-dev at lists.llvm.org> wrote: >> ./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))); > > This looks like a bug in Clang 3.9. It seems to have been fixed in > r281669 (https://github.com/llvm-mirror/clang/commit/38edf4). It might > be worth trying to get it into 3.9.1 when that process starts.That process started the day we released 3.9 AFAIK. I think Tom (+CC) would like a bugzilla entry for every cherry-pick request. — Mehdi