forked from OSchip/llvm-project
7e88d0da38
loading the source Module, linking the function in the destination module, and destroying the source Module before repeating with the next function to import (potentially from the same Module). Ideally we would keep the source Module alive and import the next Function needed from this Module. Unfortunately this is not possible because the linker does not leave it in a usable state. However we can do better by first computing the list of all candidates per Module, and only then load the source Module and import all the function we need for it. The trick to process callees is to materialize function in the source module when building the list of function to import, and inspect them in their source module, collecting the list of callees for each callee. When we move the the actual import, we will import from each source module exactly once. Each source module is loaded exactly once. The only drawback it that it requires to have all the lazy-loaded source Module in memory at the same time. Currently this patch already improves considerably the link time, a multithreaded link of llvm-dis on my laptop was: real 1m12.175s user 6m32.430s sys 0m10.529s and is now: real 0m40.697s user 2m10.237s sys 0m4.375s Note: this is the full link time (linker+Import+Optimizer+CodeGen) Differential Revision: http://reviews.llvm.org/D15178 From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 255100 |
||
---|---|---|
.. | ||
ArgumentPromotion.cpp | ||
BarrierNoopPass.cpp | ||
CMakeLists.txt | ||
ConstantMerge.cpp | ||
DeadArgumentElimination.cpp | ||
ElimAvailExtern.cpp | ||
ExtractGV.cpp | ||
FunctionAttrs.cpp | ||
FunctionImport.cpp | ||
GlobalDCE.cpp | ||
GlobalOpt.cpp | ||
IPConstantPropagation.cpp | ||
IPO.cpp | ||
InlineAlways.cpp | ||
InlineSimple.cpp | ||
Inliner.cpp | ||
Internalize.cpp | ||
LLVMBuild.txt | ||
LoopExtractor.cpp | ||
LowerBitSets.cpp | ||
Makefile | ||
MergeFunctions.cpp | ||
PartialInlining.cpp | ||
PassManagerBuilder.cpp | ||
PruneEH.cpp | ||
SampleProfile.cpp | ||
StripDeadPrototypes.cpp | ||
StripSymbols.cpp |