llvm-project/llvm
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
..
bindings [OCaml] Use LLVMCreateMessage with constant strings when calling llvm_raise 2016-04-01 07:56:17 +00:00
cmake [CMake] Provide the ability to skip stripping when generating dSYMs 2016-03-31 20:03:19 +00:00
docs Swift Calling Convention: add swifterror attribute. 2016-04-01 21:41:15 +00:00
examples [Kaleidoscope] Rename Error -> LogError in Chapters 2-5. 2016-03-25 17:41:26 +00:00
include constify GlobalValue::getGUID() and GlobalValue::getGlobalIdentifier() (NFC) 2016-04-02 05:25:27 +00:00
lib Bitcode: Try to emit metadata in function blocks 2016-04-02 15:22:57 +00:00
projects Remove autoconf support 2016-01-26 21:29:08 +00:00
resources
test Bitcode: Try to emit metadata in function blocks 2016-04-02 15:22:57 +00:00
tools Add a libLTO API to stop/restart ThinLTO between optimizations and CodeGen 2016-04-01 06:47:02 +00:00
unittests LowerBitSets: Move declarations to separate namespace. 2016-04-01 18:46:50 +00:00
utils lit: python3 compatibility fix 2016-03-31 23:08:55 +00:00
.arcconfig
.clang-format
.clang-tidy
.gitignore
CMakeLists.txt dos2unix CMakeLists.txt 2016-03-28 18:19:32 +00:00
CODE_OWNERS.TXT Update owners to reflect recent changes 2016-04-01 20:40:49 +00:00
CREDITS.TXT
LICENSE.TXT Update copyright year to 2016. 2016-03-30 22:41:06 +00:00
LLVMBuild.txt
README.txt
configure Remove autoconf support 2016-01-26 21:29:08 +00:00
llvm.spec.in

README.txt

Low Level Virtual Machine (LLVM)
================================

This directory and its subdirectories contain source code for LLVM,
a toolkit for the construction of highly optimized compilers,
optimizers, and runtime environments.

LLVM is open source software. You may freely distribute it under the terms of
the license agreement found in LICENSE.txt.

Please see the documentation provided in docs/ for further
assistance with LLVM, and in particular docs/GettingStarted.rst for getting
started with LLVM and docs/README.txt for an overview of LLVM's
documentation setup.

If you are writing a package for LLVM, see docs/Packaging.rst for our
suggestions.