Commit Graph

8 Commits

Author SHA1 Message Date
David Blaikie 1524e67feb Modular Codegen: Don't home always_inline functions
Since they'll likely (not always - if the address is taken, etc) be
inlined away, even at -O0, separately provided weak definitions are
likely to be unused so skip all of that.

llvm-svn: 317279
2017-11-02 22:28:50 +00:00
David Blaikie e60aa5182f Modular Codegen: Include testing for inline asm as well as some commentary on the implementaiton choice.
llvm-svn: 300106
2017-04-12 21:14:04 +00:00
David Blaikie f63556d8b4 Modular Codegen: Separate flags for function and debug info support
This allows using and testing these two features separately. (noteably,
debug info is, so far as I know, always a win (basically). But function
modular codegen is currently a loss for highly optimized code - where
most of the linkonce_odr definitions are optimized away, so providing
weak_odr definitions is only overhead)

llvm-svn: 300104
2017-04-12 20:58:33 +00:00
David Blaikie 1ac9c98e6c Modular Codegen: Support homing debug info for types in modular objects
Matching the function-homing support for modular codegen. Any type
implicitly (implicit template specializations) or explicitly defined in
a module is attached to that module's object file and omitted elsewhere
(only a declaration used if necessary for references).

llvm-svn: 299987
2017-04-11 21:13:37 +00:00
David Blaikie e6b7c28d17 Modular Codegen: Add/use a bit in serialized function definitions to track whether they are the subject of modular codegen
Some decls are created not where they are written, but in other module
files/users (implicit special members and function template implicit
specializations). To correctly identify them, use a bit next to the definition
to track the modular codegen property.

Discussed whether the module file bit could be omitted in favor of
reconstituting from the modular codegen decls list - best guess today is that
the efficiency improvement of not having to deserialize the whole list whenever
any function is queried by a module user is worth it for the small size
increase of this redundant (list + bit-on-def) representation.

Reviewers: rsmith

Differential Revision: https://reviews.llvm.org/D29901

llvm-svn: 299982
2017-04-11 20:46:34 +00:00
David Blaikie ee12322372 Initialize builtins during modular codegen
llvm-svn: 294512
2017-02-08 20:51:11 +00:00
David Blaikie 8abd2febfe Tidy up codegen modules test & make it x86 specific since it relies on Itanium name manglings
llvm-svn: 293457
2017-01-30 05:33:51 +00:00
David Blaikie 9ffe5a3525 Prototype of modules codegen
First pass at generating weak definitions of inline functions from module files
(& skipping (-O0) or emitting available_externally (optimizations)
definitions where those modules are used).

External functions defined in modules are emitted into the modular
object file as well (this may turn an existing ODR violation (if that
module were imported into multiple translations) into valid/linkable
code).

Internal symbols (static functions, for example) are not correctly
supported yet. The symbol will be produced, internal, in the modular
object - unreferenceable from the users.

Reviewers: rsmith

Differential Revision: https://reviews.llvm.org/D28845

llvm-svn: 293456
2017-01-30 05:00:26 +00:00