[LLVMdev] Module::getOrInsertFunction determinism

Tim Northover t.p.northover at gmail.com
Thu May 29 11:36:24 PDT 2014


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.

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?

Cheers.

Tim.




More information about the llvm-dev mailing list