llvm-project/llvm/lib
Duncan P. N. Exon Smith 520f8542ff Bitcode: Try to emit metadata in function blocks
Whenever metadata is only referenced by a single function, emit the
metadata just in that function block.  This should improve lazy-loading
by reducing the amount of metadata in the global block.

For now, this should catch all DILocations, and anything else that
happens to be referenced only by a single function.

It's also a first step toward a couple of possible future directions
(which this commit does *not* implement):

 1. Some debug info metadata is only referenced from compile units and
    individual functions.  If we can drop the link from the compile
    unit, this optimization will get more powerful.

 2. Any uniqued metadata that isn't referenced globally can in theory be
    emitted in every function block that references it (trading off
    bitcode size and full-parse time vs. lazy-load time).

Note: this assumes the new BitcodeReader error checking from r265223.
The metadata stored in function blocks gets purged after parsing each
function, which means unresolved forward references will get lost.
Since all the global metadata should have already been resolved by the
time we get to the function metadata blocks we just need to check for
that case.  (If for some reason we need to handle bitcode that fails the
checks in r265223, the fix is to store about-to-be-dropped unresolved
nodes in MetadataList::shrinkTo until they can be handled succesfully by
a future call to MetadataList::tryToResolveCycles.)

llvm-svn: 265226
2016-04-02 15:22:57 +00:00
..
Analysis Fix "warning: variabl 'XX’ set but not used" in release build (variable used in assertion, NFC) 2016-04-02 05:34:19 +00:00
AsmParser Rename Context::discardValueNames() to shouldDiscardValueNames() (NFC) 2016-04-02 03:46:17 +00:00
Bitcode Bitcode: Try to emit metadata in function blocks 2016-04-02 15:22:57 +00:00
CodeGen Swift Calling Convention: add swifterror attribute. 2016-04-01 21:41:15 +00:00
DebugInfo Make DIASession work if msdia*.dll isn't registered. 2016-04-01 22:21:51 +00:00
ExecutionEngine More more change need as part of r264187 where ErrorOr<> was added 2016-03-23 21:20:16 +00:00
Fuzzer [libfuzzer] adding license headers to cpp files 2016-04-01 18:38:58 +00:00
IR constify GlobalValue::getGUID() and GlobalValue::getGlobalIdentifier() (NFC) 2016-04-02 05:25:27 +00:00
IRReader Remove autoconf support 2016-01-26 21:29:08 +00:00
LTO Revert "ThinLTO: add module caching handling." 2016-04-02 05:08:18 +00:00
LibDriver Remove autoconf support 2016-01-26 21:29:08 +00:00
LineEditor Fix Clang-tidy modernize-deprecated-headers warnings in some files; other minor fixes. 2016-03-28 17:40:08 +00:00
Linker [ThinLTO] Remove post-pass metadata linking support 2016-03-29 18:24:19 +00:00
MC Handle section vs global name conflict. 2016-03-28 20:36:28 +00:00
Object Object: Correctly read thin archives containing absolute paths. 2016-03-31 22:08:31 +00:00
ObjectYAML [lanai] Add Lanai backend. 2016-03-28 13:09:54 +00:00
Option Annotate dump() methods with LLVM_DUMP_METHOD, addressing Richard Smith r259192 post commit comment. 2016-01-29 20:50:44 +00:00
Passes [PM] Rename the CRTP mixin base classes for the new pass manager to 2016-03-11 10:33:22 +00:00
ProfileData Fix buildbot lldb-amd64-ninja-netbsd7 failure 2016-04-01 20:15:04 +00:00
Support Add Cache Pruning support 2016-04-02 03:28:26 +00:00
TableGen [TableGen] Fix typos in comments. NFC 2016-02-26 06:50:27 +00:00
Target AArch64: avoid clobbering SP for dead MOVimm pseudos. 2016-04-01 23:14:52 +00:00
Transforms Fix "warning: variabl 'XX’ set but not used" in release build (variable used in assertion, NFC) 2016-04-02 05:34:19 +00:00
CMakeLists.txt Move ObjectYAML code to a new library. 2016-03-01 19:15:06 +00:00
LLVMBuild.txt Add LLVMBuild for ObjectYAML. 2016-03-01 21:29:33 +00:00