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

Manman Ren manman.ren at gmail.com
Wed Nov 13 22:59:41 PST 2013


On Wed, Nov 13, 2013 at 7:58 PM, Rafael EspĂ­ndola <
rafael.espindola at gmail.com> wrote:

> > It sounds like the linker could call lto_module_dispose() right after
> > lto_codegen_add_module() to help reduce the memory footprint.  That
> would be
> > a simple linker change.  A slightly larger linker change would be to
> > immediately call lto_codegen_add_module() right after
> > lto_module_create_from_memory(), then lto_module_dispose().  That is,
> never
> > have any unmerged modules laying around.
> >
> > I have no idea is these sort of changes work for the gold plugin.
>
> The gold plugin calls lto_codegen_add_module/lto_module_dispose early.
> So it looks like Chandler's idea would be a win for gold but a loss
> for ld64 right now.
>

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.

Manman


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


More information about the llvm-dev mailing list