[LLVMdev] Proposal: release MDNodes for source modules (LTO+debug info)

Eric Christopher echristo at gmail.com
Thu Nov 14 10:11:15 PST 2013


On Thu, Nov 14, 2013 at 5:19 AM, Rafael EspĂ­ndola
<rafael.espindola at gmail.com> wrote:
>> Letting the module own MDNodes may not be a win for gold since it is going
>> to create multiple copies of MDNodes that could be shared with Context
>> owning MDNodes.
>>
>> For example, with debug info type uniquing, the type nodes can be shared
>> across modules, but with module owning MDNodes, each module will create its
>> own copy of the type nodes. The advantage is that the MDNodes can be deleted
>> easily by deleting the module. It is not clearly a win to me.
>
> But gold has at most 2 objects loaded at any time.
>

Agreed. Dave and I were chatting about this some and from my
perspective the only disadvantage to this is the time to copy metadata
from one place to the other. Peak memory usage will still go down
since you could then free up each module as you added. The "uniquing"
works basically the same way as adding the same node 400 times to the
folding set - it just returns the same one each time.

I guess I'm confused at where this 40% overhead of MDNodes is coming
from though? Do we know what they are?

-eric




More information about the llvm-dev mailing list