[LLVMdev] Module::getOrInsertFunction determinism

Kuchta, Tomasz t.kuchta12 at imperial.ac.uk
Thu May 29 14:25:03 PDT 2014


Hi Tim,

On 29/05/2014 19:36, "Tim Northover" <t.p.northover at gmail.com> wrote:

>Hi Tomek,
>
>On 29 May 2014 19:12, Kuchta, Tomasz <t.kuchta12 at imperial.ac.uk> wrote:
>> Thank you very much for quick response. What happens in my case is that
>> mixing calls to getOrInsertFunction with linking another bit code
>>module to
>> the current module seems to be sometimes producing different outputs.
>
>Even with exactly the same call sequence in each case? That's probably
>not intended.

Yes, that was for the same code base. However, as I mentioned in my e-mail
to Philip, this might also
be related to my outdated version of LLVM - I should check it on some
newer one to make sure.

>
>As you say, it makes looking for actual changes difficult; and for
>purely Clang-related reasons we want link-time optimized binaries to
>be comparable with "diff" to verify staging works.
>
>The usual cause of these issues is something being sorted by pointer
>or hash rather than name or some other prior order. I can't see any
>obvious data structures like that in llvm::Module though.
>
>> Difference might be with the ordering of functions in the file (I¹m
>> looking at LLVM IR representation), with numbers
>> used for constant variables, numbers used in the ³dbg² metadata.
>
>Do you mean you're not sure where the difference is there, or that
>you've seen all of those differences in practice?

I’ve seen different naming for string constants and different ordering of
functions in the LLVM IR.

>
>Cheers.
>
>Tim.

Thanks a lot,
Tomek





More information about the llvm-dev mailing list