LLVM 22.0.0git
LTOBackend.cpp File Reference

Go to the source code of this file.

Namespaces

namespace  llvm
 This is an optimization pass for GlobalISel generic memory operations.

Macros

#define DEBUG_TYPE   "lto-backend"
#define HANDLE_EXTENSION(Ext)
#define HANDLE_EXTENSION(Ext)

Enumerations

enum class  LTOBitcodeEmbedding { DoNotEmbed = 0 , EmbedOptimized = 1 , EmbedPostMergePreOptimized = 2 }

Functions

static void reportOpenError (StringRef Path, Twine Msg)
static void RegisterPassPlugins (ArrayRef< std::string > PassPlugins, PassBuilder &PB)
static std::unique_ptr< TargetMachinecreateTargetMachine (const Config &Conf, const Target *TheTarget, Module &M)
static void runNewPMPasses (const Config &Conf, Module &Mod, TargetMachine *TM, unsigned OptLevel, bool IsThinLTO, ModuleSummaryIndex *ExportSummary, const ModuleSummaryIndex *ImportSummary)
static bool isEmptyModule (const Module &Mod)
static void codegen (const Config &Conf, TargetMachine *TM, AddStreamFn AddStream, unsigned Task, Module &Mod, const ModuleSummaryIndex &CombinedIndex)
static void splitCodeGen (const Config &C, TargetMachine *TM, AddStreamFn AddStream, unsigned ParallelCodeGenParallelismLevel, Module &Mod, const ModuleSummaryIndex &CombinedIndex)
static Expected< const Target * > initAndLookupTarget (const Config &C, Module &Mod)
static void dropDeadSymbols (Module &Mod, const GVSummaryMapTy &DefinedGlobals, const ModuleSummaryIndex &Index)

Variables

static cl::opt< LTOBitcodeEmbeddingEmbedBitcode ("lto-embed-bitcode", cl::init(LTOBitcodeEmbedding::DoNotEmbed), cl::values(clEnumValN(LTOBitcodeEmbedding::DoNotEmbed, "none", "Do not embed"), clEnumValN(LTOBitcodeEmbedding::EmbedOptimized, "optimized", "Embed after all optimization passes"), clEnumValN(LTOBitcodeEmbedding::EmbedPostMergePreOptimized, "post-merge-pre-opt", "Embed post merge, but before optimizations")), cl::desc("Embed LLVM bitcode in object files produced by LTO"))
static cl::opt< boolThinLTOAssumeMerged ("thinlto-assume-merged", cl::init(false), cl::desc("Assume the input has already undergone ThinLTO function " "importing and the other pre-optimization pipeline changes."))
cl::opt< boolllvm::NoPGOWarnMismatch

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "lto-backend"

Definition at line 52 of file LTOBackend.cpp.

◆ HANDLE_EXTENSION [1/2]

#define HANDLE_EXTENSION ( Ext)
Value:
llvm::PassPluginLibraryInfo get##Ext##PluginInfo();
decltype(auto) get(const PointerIntPair< PointerTy, IntBits, IntType, PtrTraits, Info > &Pair)
Information about the plugin required to load its passes.
Definition PassPlugin.h:41

Definition at line 180 of file LTOBackend.cpp.

◆ HANDLE_EXTENSION [2/2]

#define HANDLE_EXTENSION ( Ext)
Value:
get##Ext##PluginInfo().RegisterPassBuilderCallbacks(PB);
PassBuilder PB(Machine, PassOpts->PTO, std::nullopt, &PIC)

Definition at line 180 of file LTOBackend.cpp.

Enumeration Type Documentation

◆ LTOBitcodeEmbedding

enum class LTOBitcodeEmbedding
strong
Enumerator
DoNotEmbed 
EmbedOptimized 
EmbedPostMergePreOptimized 

Definition at line 54 of file LTOBackend.cpp.

Function Documentation

◆ codegen()

◆ createTargetMachine()

◆ dropDeadSymbols()

void dropDeadSymbols ( Module & Mod,
const GVSummaryMapTy & DefinedGlobals,
const ModuleSummaryIndex & Index )
static

◆ initAndLookupTarget()

◆ isEmptyModule()

bool isEmptyModule ( const Module & Mod)
static

Definition at line 357 of file LTOBackend.cpp.

References Mod.

Referenced by codegen(), and llvm::lto::opt().

◆ RegisterPassPlugins()

void RegisterPassPlugins ( ArrayRef< std::string > PassPlugins,
PassBuilder & PB )
static

◆ reportOpenError()

void reportOpenError ( StringRef Path,
Twine Msg )
static

Definition at line 80 of file LTOBackend.cpp.

References llvm::errs(), and llvm::raw_ostream::flush().

Referenced by llvm::lto::Config::addSaveTemps().

◆ runNewPMPasses()

void runNewPMPasses ( const Config & Conf,
Module & Mod,
TargetMachine * TM,
unsigned OptLevel,
bool IsThinLTO,
ModuleSummaryIndex * ExportSummary,
const ModuleSummaryIndex * ImportSummary )
static

◆ splitCodeGen()

Variable Documentation

◆ EmbedBitcode

cl::opt< LTOBitcodeEmbedding > EmbedBitcode("lto-embed-bitcode", cl::init(LTOBitcodeEmbedding::DoNotEmbed), cl::values(clEnumValN(LTOBitcodeEmbedding::DoNotEmbed, "none", "Do not embed"), clEnumValN(LTOBitcodeEmbedding::EmbedOptimized, "optimized", "Embed after all optimization passes"), clEnumValN(LTOBitcodeEmbedding::EmbedPostMergePreOptimized, "post-merge-pre-opt", "Embed post merge, but before optimizations")), cl::desc("Embed LLVM bitcode in object files produced by LTO")) ( "lto-embed-bitcode" ,
cl::init(LTOBitcodeEmbedding::DoNotEmbed) ,
cl::values(clEnumValN(LTOBitcodeEmbedding::DoNotEmbed, "none", "Do not embed"), clEnumValN(LTOBitcodeEmbedding::EmbedOptimized, "optimized", "Embed after all optimization passes"), clEnumValN(LTOBitcodeEmbedding::EmbedPostMergePreOptimized, "post-merge-pre-opt", "Embed post merge, but before optimizations")) ,
cl::desc("Embed LLVM bitcode in object files produced by LTO")  )
static

◆ ThinLTOAssumeMerged

cl::opt< bool > ThinLTOAssumeMerged("thinlto-assume-merged", cl::init(false), cl::desc("Assume the input has already undergone ThinLTO function " "importing and the other pre-optimization pipeline changes.")) ( "thinlto-assume-merged" ,
cl::init(false) ,
cl::desc("Assume the input has already undergone ThinLTO function " "importing and the other pre-optimization pipeline changes.")  )
static