LLVM  4.0.0
Macros | Functions | Variables
FunctionImport.cpp File Reference
#include "llvm/Transforms/IPO/FunctionImport.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/ADT/StringSet.h"
#include "llvm/ADT/Triple.h"
#include "llvm/IR/AutoUpgrade.h"
#include "llvm/IR/DiagnosticPrinter.h"
#include "llvm/IR/IntrinsicInst.h"
#include "llvm/IR/Module.h"
#include "llvm/IR/Verifier.h"
#include "llvm/IRReader/IRReader.h"
#include "llvm/Linker/Linker.h"
#include "llvm/Object/IRObjectFile.h"
#include "llvm/Object/ModuleSummaryIndexObjectFile.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/SourceMgr.h"
#include "llvm/Transforms/IPO/Internalize.h"
#include "llvm/Transforms/Utils/FunctionImportUtils.h"
Include dependency graph for FunctionImport.cpp:

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "function-import"
 

Functions

 STATISTIC (NumImportedFunctions,"Number of functions imported")
 
 STATISTIC (NumImportedModules,"Number of modules imported from")
 
 STATISTIC (NumDeadSymbols,"Number of dead stripped symbols in index")
 
 STATISTIC (NumLiveSymbols,"Number of live symbols in index")
 
static std::unique_ptr< ModuleloadFile (const std::string &FileName, LLVMContext &Context)
 
static bool doImportingForModule (Module &M)
 
 INITIALIZE_PASS (FunctionImportLegacyPass,"function-import","Summary Based Function Import", false, false) namespace llvm
 

Variables

static cl::opt< unsignedImportInstrLimit ("import-instr-limit", cl::init(100), cl::Hidden, cl::value_desc("N"), cl::desc("Only import functions with less than N instructions"))
 Limit on instruction count of imported functions. More...
 
static cl::opt< float > ImportInstrFactor ("import-instr-evolution-factor", cl::init(0.7), cl::Hidden, cl::value_desc("x"), cl::desc("As we import functions, multiply the ""`import-instr-limit` threshold by this factor ""before processing newly imported functions"))
 
static cl::opt< float > ImportHotInstrFactor ("import-hot-evolution-factor", cl::init(1.0), cl::Hidden, cl::value_desc("x"), cl::desc("As we import functions called from hot callsite, multiply the ""`import-instr-limit` threshold by this factor ""before processing newly imported functions"))
 
static cl::opt< float > ImportHotMultiplier ("import-hot-multiplier", cl::init(3.0), cl::Hidden, cl::value_desc("x"), cl::desc("Multiply the `import-instr-limit` threshold for hot callsites"))
 
static cl::opt< float > ImportColdMultiplier ("import-cold-multiplier", cl::init(0), cl::Hidden, cl::value_desc("N"), cl::desc("Multiply the `import-instr-limit` threshold for cold callsites"))
 
static cl::opt< boolPrintImports ("print-imports", cl::init(false), cl::Hidden, cl::desc("Print imported functions"))
 
static cl::opt< boolComputeDead ("compute-dead", cl::init(true), cl::Hidden, cl::desc("Compute dead symbols"))
 
static cl::opt< boolDontForceImportReferencedDiscardableSymbols ("disable-force-link-odr", cl::init(false), cl::Hidden)
 
static cl::opt< boolEnableImportMetadata ("enable-import-metadata", cl::init(true), cl::Hidden, cl::desc("Enable import metadata like 'thinlto_src_module'"))
 
static cl::opt< std::string > SummaryFile ("summary-file", cl::desc("The summary file to use for function importing."))
 Summary file to use for function importing when using -function-import from the command line. More...
 

Macro Definition Documentation

#define DEBUG_TYPE   "function-import"

Definition at line 35 of file FunctionImport.cpp.

Function Documentation

static bool doImportingForModule ( Module M)
static
INITIALIZE_PASS ( FunctionImportLegacyPass  ,
"function-import"  ,
"Summary Based Function Import"  ,
false  ,
false   
)

Definition at line 842 of file FunctionImport.cpp.

References llvm::createFunctionImportPass().

static std::unique_ptr<Module> loadFile ( const std::string &  FileName,
LLVMContext Context 
)
static
STATISTIC ( NumImportedFunctions  ,
"Number of functions imported"   
)
STATISTIC ( NumImportedModules  ,
"Number of modules imported from"   
)
STATISTIC ( NumDeadSymbols  ,
"Number of dead stripped symbols in index"   
)
STATISTIC ( NumLiveSymbols  ,
"Number of live symbols in index"   
)

Variable Documentation

cl::opt<bool> ComputeDead("compute-dead", cl::init(true), cl::Hidden, cl::desc("Compute dead symbols"))
static
cl::opt<bool> DontForceImportReferencedDiscardableSymbols("disable-force-link-odr", cl::init(false), cl::Hidden)
static

Referenced by doImportingForModule().

cl::opt<bool> EnableImportMetadata("enable-import-metadata", cl::init(true), cl::Hidden, cl::desc("Enable import metadata like 'thinlto_src_module'"))
static
cl::opt<float> ImportColdMultiplier("import-cold-multiplier", cl::init(0), cl::Hidden, cl::value_desc("N"), cl::desc("Multiply the `import-instr-limit` threshold for cold callsites"))
static
cl::opt<float> ImportHotInstrFactor("import-hot-evolution-factor", cl::init(1.0), cl::Hidden, cl::value_desc("x"), cl::desc("As we import functions called from hot callsite, multiply the ""`import-instr-limit` threshold by this factor ""before processing newly imported functions"))
static
cl::opt<float> ImportHotMultiplier("import-hot-multiplier", cl::init(3.0), cl::Hidden, cl::value_desc("x"), cl::desc("Multiply the `import-instr-limit` threshold for hot callsites"))
static
cl::opt<float> ImportInstrFactor("import-instr-evolution-factor", cl::init(0.7), cl::Hidden, cl::value_desc("x"), cl::desc("As we import functions, multiply the ""`import-instr-limit` threshold by this factor ""before processing newly imported functions"))
static
cl::opt<unsigned> ImportInstrLimit("import-instr-limit", cl::init(100), cl::Hidden, cl::value_desc("N"), cl::desc("Only import functions with less than N instructions"))
static

Limit on instruction count of imported functions.

cl::opt<bool> PrintImports("print-imports", cl::init(false), cl::Hidden, cl::desc("Print imported functions"))
static
cl::opt<std::string> SummaryFile("summary-file", cl::desc("The summary file to use for function importing."))
static

Summary file to use for function importing when using -function-import from the command line.

Referenced by llvm::FunctionImporter::importFunctions().