llvm-mirror/tools
Duncan P. N. Exon Smith 7c5c7fb60f libLTO: Allow linker to choose context of modules and codegen
Add API for specifying which `LLVMContext` each `lto_module_t` and
`lto_code_gen_t` is in.

In particular, this enables the following flow:

    for (auto &File : Files) {
      lto_module_t M = lto_module_create_in_local_context(File...);
      querySymbols(M);
      lto_module_dispose(M);
    }

    lto_code_gen_t CG = lto_codegen_create_in_local_context();
    for (auto &File : FilesToLink) {
      lto_module_t M = lto_module_create_in_codegen_context(File..., CG);
      lto_codegen_add_module(CG, M);
      lto_module_dispose(M);
    }
    lto_codegen_compile(CG);
    lto_codegen_write_merged_modules(CG, ...);
    lto_codegen_dispose(CG);

This flow has a few benefits.

  - Only one module (two if you count the combined module in the code
    generator) is in memory at a time.

  - Metadata (and constants) from files that are parsed to query symbols
    but not linked into the code generator don't pollute the global
    context.

  - The first for loop can be parallelized, since each module is in its
    own context.

  - When the code generator is disposed, the memory from LTO gets freed.

rdar://problem/18767512

llvm-svn: 221733
2014-11-11 23:19:23 +00:00
..
bugpoint Fix style. 2014-11-07 21:30:36 +00:00
bugpoint-passes
gold Fix the build of the gold plugin. 2014-11-01 23:49:44 +00:00
llc Add doInitialization/doFinalization to DataLayoutPass. 2014-09-10 21:27:43 +00:00
lli [MCJIT] Remove a few more references to JITMemoryManager that survived r218316. 2014-09-23 17:10:24 +00:00
llvm-ar Remove unused variable. 2014-11-07 21:33:09 +00:00
llvm-as Modernize raw_fd_ostream's constructor a bit. 2014-08-25 18:16:47 +00:00
llvm-bcanalyzer Teach llvm-bcanalyzer to use one stream's BLOCKINFO to read another stream. 2014-08-30 17:07:55 +00:00
llvm-c-test [CMake] llvm-c-test: Use libLLVM.so if it is available. 2014-11-10 15:04:26 +00:00
llvm-config Enabling LLVM & Clang to be cross-compiled using CMake from a single configuration command line 2014-09-03 23:21:18 +00:00
llvm-cov [Object] Modify OwningBinary's interface to separate inspection from ownership. 2014-10-31 21:37:49 +00:00
llvm-diff Return a std::unique_ptr from the IRReader.h functions. NFC. 2014-08-26 17:29:46 +00:00
llvm-dis Modernize raw_fd_ostream's constructor a bit. 2014-08-25 18:16:47 +00:00
llvm-dwarfdump Fix some cases where StringRef was being passed by const reference. Remove const from some other StringRefs since its implicitly const already. 2014-08-30 16:48:02 +00:00
llvm-extract Remove redundant calls to isMaterializable. 2014-11-01 16:46:18 +00:00
llvm-go Add llvm-go tool. 2014-10-23 02:33:23 +00:00
llvm-jitlistener Fix build with CMake if LLVM_USE_INTEL_JITEVENTS option is enabled 2014-10-29 09:18:49 +00:00
llvm-link Make it easier to pass a custom diagnostic handler to the IR linker. 2014-10-27 23:02:10 +00:00
llvm-lto Add an option to the LTO code generator to disable vectorization during LTO 2014-10-26 21:50:58 +00:00
llvm-mc [llvm-mc] Fixing case where if a file ended with non-newline whitespace or a comma it would access invalid memory. 2014-11-11 21:03:09 +00:00
llvm-mcmarkup Explicitly pass ownership of the MemoryBuffer to AddNewSourceBuffer using std::unique_ptr 2014-08-21 20:44:56 +00:00
llvm-nm Object, COFF: Cleanup symbol type code, improve binutils compatibility 2014-10-31 05:07:00 +00:00
llvm-objdump Fix a warning about ‘r_type’ may be used uninitialized. 2014-11-11 19:16:45 +00:00
llvm-profdata Use ErrorOr for the ::create factory on instrumented and sample profilers. 2014-11-03 00:51:45 +00:00
llvm-readobj llvm-readobj: Add support for dumping the DOS header in PE files 2014-11-05 06:24:35 +00:00
llvm-rtdyld [MCJIT] Add command-line argument to llvm-rtdyld to specify target addresses for 2014-09-04 04:19:54 +00:00
llvm-shlib [CMake] llvm-shlib: Prune redundant components, AsmPrinter, MC, and SelectionDAG. 2014-11-11 07:57:25 +00:00
llvm-size Remove bogus std::error_code returns form SectionRef. 2014-10-08 15:28:58 +00:00
llvm-stress Modernize raw_fd_ostream's constructor a bit. 2014-08-25 18:16:47 +00:00
llvm-symbolizer llvm-symbolizer: teach it about PowerPC64 ELF function descriptors 2014-11-07 09:08:39 +00:00
llvm-vtabledump llvm-vtabledump: Handle Itanium VTables 2014-11-03 07:23:25 +00:00
lto libLTO: Allow linker to choose context of modules and codegen 2014-11-11 23:19:23 +00:00
macho-dump Adds the next bit of support for llvm-objdump’s -private-headers for executable Mach-O files. 2014-09-04 16:54:47 +00:00
msbuild MSBuild integration: fix the loop in install.bat 2014-09-30 22:30:06 +00:00
obj2yaml [ELF][yaml2obj] Handle additional MIPS specific st_other field flags 2014-11-06 22:46:24 +00:00
opt Revert "IR: MDNode => Value" 2014-11-11 21:30:22 +00:00
verify-uselistorder Pass a MemoryBufferRef when we can avoid taking ownership. 2014-08-26 21:49:01 +00:00
yaml2obj [ELF][yaml2obj] Handle additional MIPS specific st_other field flags 2014-11-06 22:46:24 +00:00
CMakeLists.txt [CMake] Move llvm-shlib in prior to other tools. 2014-11-10 15:03:02 +00:00
LLVMBuild.txt
Makefile Add llvm-go tool. 2014-10-23 02:33:23 +00:00