[LLVMdev] Disjoint types after reading several modules
hammacher at cs.uni-saarland.de
Thu Feb 2 05:25:26 PST 2012
On 2/2/12 1:51 PM, Duncan Sands wrote:
> On 02/02/12 13:30, Clemens Hammacher wrote:
>> On 2/2/12 1:15 AM, Chris Lattner wrote:
>>> I have to ask: why are you writing these modules out as separate bc files?
>> I knew that someone would ask that ;)
>> We need to have separate modules during runtime. One of them contains the code
>> that is actually JIT compiled and executed, and simultaneously different
>> optimizations are concurrently (in individual threads) building up or
>> restructuring new code in their individual "working modules". Eventually some
>> code will get copied over to the main module to be executed, and that's why they
>> need to use the same types.
> what do you mean by "copied over to the main module"? If you want to add
> additional IR to the main module then you should link it in using the linker.
I think that the linker would indeed be able to remap the types
correctly, but the main obstacle here is that we only copy individual
functions. Maybe it would be possible to first copy the function into a
new module, and then link this into the main module, but then again the
question is how to correctly copy the function to the temporary module ;)
Another thing is that for the transformations, it would be much nicer if
the types in all working modules are the same as in the main module.
This copying of individual functions between modules works very well
*if* the used types are the same. All that had to be changed is the
remapping, because we have to remap the global values as well. We are
basically using a slightly extended version of the MapValue function.
So let's concentrate on how to get the types unique ;)
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 6392 bytes
Desc: S/MIME Cryptographic Signature
More information about the llvm-dev