[PATCH] D28845: Prototype of modules codegen

David Blaikie via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 18 09:44:17 PST 2017


On Wed, Jan 18, 2017 at 4:12 AM Hal Finkel via Phabricator <
reviews at reviews.llvm.org> wrote:

> hfinkel added a comment.
>
> Can you provide a high-level description of what you're trying to
> accomplish and the usage model?
>

Oh, for sure - sorry for the assumption/missing info. Stuff that's been
idly discussed (mostly offline) for a while, so I had more context in my
head than was conveyed in this email.

Starting with the assumption/restriction of this requiring explicit modules
and changes to the build system, here's the idea:

* In the original/normal object files: Demote linkonce_odr function
definitions derived from code in imported modules to available_externally
(Or removed entirely at -O0).
* Build new object files from every imported pcm across all object files
linked into a given binary.
  * In these new object files, emit weak_odr definitions of any inline
function defined in the module.

In this way, less code is generated, possibly saving compile time and
reducing the size of inputs to the link step. Also reducing the size of
debug info (DWARF debug info describes the inline function in every object
file where an out of line definition remains - and these definitions are
not deduplicated by the linker).

Once in place, this functionality can also be used to reduce DWARF debug
info further by omitting/emitting type descriptions in the same way. (if
the type is defined in a modular header - only emit the description of the
type's definition in the modular object file - rather than emitting it in
every object that uses that type)

Does that make sense? Happy to go into more detail, provide examples, etc.

- Dave


>
>
> https://reviews.llvm.org/D28845
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20170118/75303502/attachment.html>


More information about the cfe-commits mailing list