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

Manman Ren manman.ren at gmail.com
Thu Nov 14 10:14:49 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.
>

The problem is not how many objects co-exist, the problem is how many
copies of the type nodes we create.

We will create a new copy of the type nodes each time we load in a source
module, even though the type nodes exist in the destination module.
So if we have 700 source modules, assuming a type is shared across all 700
modules, the type nodes will be created 701 times.

Cheers,
Manman


>
> Cheers,
> Rafael
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20131114/2ee78d8a/attachment.html>


More information about the llvm-dev mailing list