1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-22 12:33:33 +02:00
llvm-mirror/lib/Transforms/IPO
Mehdi Amini b282e7bd00 The current importing scheme is processing one function at a time,
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
2015-12-09 08:17:35 +00:00
..
ArgumentPromotion.cpp DI: Reverse direction of subprogram -> function edge. 2015-11-05 22:03:56 +00:00
BarrierNoopPass.cpp Revert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC) 2015-06-23 09:49:53 +00:00
CMakeLists.txt Add a FunctionImporter helper to perform summary-based cross-module function importing 2015-11-24 06:07:49 +00:00
ConstantMerge.cpp IPO: Remove implicit ilist iterator conversions, NFC 2015-10-13 17:51:03 +00:00
DeadArgumentElimination.cpp DI: Reverse direction of subprogram -> function edge. 2015-11-05 22:03:56 +00:00
ElimAvailExtern.cpp Disallow aliases to available_externally. 2015-11-26 19:22:59 +00:00
ExtractGV.cpp IPO: Remove implicit ilist iterator conversions, NFC 2015-10-13 17:51:03 +00:00
FunctionAttrs.cpp Revert "[FunctionAttrs] Remove redundant assignment." 2015-11-20 19:17:10 +00:00
FunctionImport.cpp The current importing scheme is processing one function at a time, 2015-12-09 08:17:35 +00:00
GlobalDCE.cpp Rangify for loops in GlobalDCE, NFC. 2015-07-18 19:57:34 +00:00
GlobalOpt.cpp [GlobalOpt] Localize some globals that have non-instruction users 2015-11-19 18:04:33 +00:00
InlineAlways.cpp [PM/AA] Rebuild LLVM's alias analysis infrastructure in a way compatible 2015-09-09 17:55:00 +00:00
Inliner.cpp Revert r252990. 2015-11-13 01:44:32 +00:00
InlineSimple.cpp [PM/AA] Rebuild LLVM's alias analysis infrastructure in a way compatible 2015-09-09 17:55:00 +00:00
Internalize.cpp IPO: Remove implicit ilist iterator conversions, NFC 2015-10-13 17:51:03 +00:00
IPConstantPropagation.cpp Revert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC) 2015-06-23 09:49:53 +00:00
IPO.cpp Add a FunctionImporter helper to perform summary-based cross-module function importing 2015-11-24 06:07:49 +00:00
LLVMBuild.txt [PGO] Revert revision r254021,r254028,r254035 2015-11-24 23:49:08 +00:00
LoopExtractor.cpp IPO: Remove implicit ilist iterator conversions, NFC 2015-10-13 17:51:03 +00:00
LowerBitSets.cpp Fix Clang-tidy modernize-use-nullptr warnings in source directories and generated files; other minor cleanups. 2015-10-06 23:24:35 +00:00
Makefile
MergeFunctions.cpp Move helper classes into anonymous namespaces. NFC. 2015-11-16 09:01:28 +00:00
PartialInlining.cpp IPO: Remove implicit ilist iterator conversions, NFC 2015-10-13 17:51:03 +00:00
PassManagerBuilder.cpp [ThinLTO] Support for specifying function index from pass manager 2015-12-07 19:21:11 +00:00
PruneEH.cpp [OperandBundles] Have PruneEH work correct with operand bundles. 2015-12-08 23:16:52 +00:00
SampleProfile.cpp SamplePGO - Do not use std::to_string in diagnostics. 2015-11-29 18:23:26 +00:00
StripDeadPrototypes.cpp [PM] Port StripDeadPrototypes to the new pass manager 2015-10-30 23:28:12 +00:00
StripSymbols.cpp DI: Reverse direction of subprogram -> function edge. 2015-11-05 22:03:56 +00:00