[LLVMdev] Module::getOrInsertFunction determinism

Kuchta, Tomasz t.kuchta12 at imperial.ac.uk
Thu May 29 11:12:46 PDT 2014


Hi Tim,

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.
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. Since
sometimes the diff is not trivial to analyse I
just wasn¹t sure if I only get these sort of differences and not
differences like actual instructions being reordered.
Do you know what might be the cause of these differences?

Thank you,

Tomek  

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

>Hi Tomek,
>
>> I¹ve got a question about Module::getOrInsertFunction().
>> I got an impression that it is not deterministic where exactly in the
>>bit
>> code module the new function will be inserted.
>
>Looking at the code (not exhaustively), it seems a new function will
>always be added to the end of a module.
>
>Documenting that probably wouldn't be a terrible idea, but it
>shouldn't affect anything except the human-readability of LLVM IR. Are
>you trying to do something where it is actually causing problems?
>
>Cheers.
>
>Tim.





More information about the llvm-dev mailing list