LLVM
17.0.0git
|
#include "llvm/LTO/LTOBackend.h"
#include "llvm/Analysis/AliasAnalysis.h"
#include "llvm/Analysis/CGSCCPassManager.h"
#include "llvm/Analysis/ModuleSummaryAnalysis.h"
#include "llvm/Analysis/TargetLibraryInfo.h"
#include "llvm/Bitcode/BitcodeReader.h"
#include "llvm/Bitcode/BitcodeWriter.h"
#include "llvm/IR/LLVMRemarkStreamer.h"
#include "llvm/IR/LegacyPassManager.h"
#include "llvm/IR/PassManager.h"
#include "llvm/IR/Verifier.h"
#include "llvm/LTO/LTO.h"
#include "llvm/MC/SubtargetFeature.h"
#include "llvm/MC/TargetRegistry.h"
#include "llvm/Object/ModuleSymbolTable.h"
#include "llvm/Passes/PassBuilder.h"
#include "llvm/Passes/PassPlugin.h"
#include "llvm/Passes/StandardInstrumentations.h"
#include "llvm/Support/Error.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/Support/Path.h"
#include "llvm/Support/Program.h"
#include "llvm/Support/ThreadPool.h"
#include "llvm/Support/ToolOutputFile.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Target/TargetMachine.h"
#include "llvm/Transforms/IPO/WholeProgramDevirt.h"
#include "llvm/Transforms/Scalar/LoopPassManager.h"
#include "llvm/Transforms/Utils/FunctionImportUtils.h"
#include "llvm/Transforms/Utils/SplitModule.h"
#include <optional>
#include "llvm/Support/Extension.def"
Go to the source code of this file.
Namespaces | |
llvm | |
This is an optimization pass for GlobalISel generic memory operations. | |
Macros | |
#define | DEBUG_TYPE "lto-backend" |
#define | HANDLE_EXTENSION(Ext) llvm::PassPluginLibraryInfo get##Ext##PluginInfo(); |
#define | HANDLE_EXTENSION(Ext) get##Ext##PluginInfo().RegisterPassBuilderCallbacks(PB); |
Enumerations | |
enum | LTOBitcodeEmbedding { LTOBitcodeEmbedding::DoNotEmbed = 0, LTOBitcodeEmbedding::EmbedOptimized = 1, LTOBitcodeEmbedding::EmbedPostMergePreOptimized = 2 } |
Functions | |
static void | reportOpenError (StringRef Path, Twine Msg) |
static void | RegisterPassPlugins (ArrayRef< std::string > PassPlugins, PassBuilder &PB) |
static std::unique_ptr< TargetMachine > | createTargetMachine (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 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< 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")) |
static 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.")) |
cl::opt< bool > | llvm::NoPGOWarnMismatch |
#define DEBUG_TYPE "lto-backend" |
Definition at line 52 of file LTOBackend.cpp.
#define HANDLE_EXTENSION | ( | Ext | ) | llvm::PassPluginLibraryInfo get##Ext##PluginInfo(); |
Definition at line 180 of file LTOBackend.cpp.
Definition at line 180 of file LTOBackend.cpp.
|
strong |
Enumerator | |
---|---|
DoNotEmbed | |
EmbedOptimized | |
EmbedPostMergePreOptimized |
Definition at line 54 of file LTOBackend.cpp.
|
static |
Definition at line 361 of file LTOBackend.cpp.
References llvm::sys::path::append(), llvm::sys::fs::create_directories(), llvm::lto::Config::DwoDir, EmbedBitcode, llvm::embedBitcodeInModule(), EmbedOptimized, llvm::Module::getModuleIdentifier(), Mod, llvm::sys::fs::OF_None, llvm::lto::Config::PreCodeGenModuleHook, llvm::report_fatal_error(), llvm::lto::Config::SplitDwarfFile, llvm::lto::Config::SplitDwarfOutput, TM, and llvm::to_string().
Referenced by llvm::lto::backend(), splitCodeGen(), and llvm::lto::thinBackend().
|
static |
Definition at line 204 of file LTOBackend.cpp.
References llvm::SubtargetFeatures::AddFeature(), assert(), llvm::lto::Config::CGOptLevel, llvm::lto::Config::CodeModel, llvm::lto::Config::CPU, llvm::Target::createTargetMachine(), llvm::SubtargetFeatures::getDefaultSubtargetFeatures(), llvm::SubtargetFeatures::getString(), M, llvm::lto::Config::MAttrs, llvm::PICLevel::NotPIC, llvm::lto::Config::Options, llvm::Reloc::PIC_, llvm::lto::Config::RelocModel, llvm::Reloc::Static, and TM.
Referenced by llvm::lto::backend(), splitCodeGen(), and llvm::lto::thinBackend().
|
static |
Definition at line 520 of file LTOBackend.cpp.
References llvm::convertToDeclaration(), llvm::Module::global_values(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::lookup(), and Mod.
Referenced by llvm::lto::thinBackend().
Definition at line 470 of file LTOBackend.cpp.
References llvm::Module::getTargetTriple(), llvm::inconvertibleErrorCode(), llvm::TargetRegistry::lookupTarget(), Mod, llvm::AMDGPU::SendMsg::Msg, and llvm::Module::setTargetTriple().
Referenced by llvm::lto::backend(), and llvm::lto::thinBackend().
|
static |
Definition at line 184 of file LTOBackend.cpp.
References llvm::errs(), llvm::PassPlugin::Load(), PB(), and llvm::PassPlugin::registerPassBuilderCallbacks().
Referenced by runNewPMPasses().
Definition at line 80 of file LTOBackend.cpp.
References llvm::errs(), exit(), llvm::raw_ostream::flush(), and llvm::AMDGPU::SendMsg::Msg.
Referenced by llvm::lto::Config::addSaveTemps().
|
static |
Definition at line 231 of file LTOBackend.cpp.
References llvm::lto::Config::AAPipeline, llvm::lto::Config::AddFSDiscriminator, CGAM, llvm::PGOOptions::CSIRInstr, llvm::lto::Config::CSIRProfile, llvm::PGOOptions::CSIRUse, llvm::lto::Config::DebugPassManager, FAM, llvm::lto::Config::Freestanding, llvm::Module::getContext(), llvm::PGOOptions::IRUse, LAM, MAM, Mod, llvm::PGOOptions::NoAction, llvm::PGOOptions::NoCSAction, llvm::NoPGOWarnMismatch, llvm::lto::Config::PassPlugins, PB(), llvm::lto::Config::PGOWarnMismatch, PIC, llvm::lto::Config::ProfileRemapping, llvm::lto::Config::PTO, llvm::AnalysisManager< IRUnitT, ExtraArgTs >::registerPass(), RegisterPassPlugins(), llvm::lto::Config::RunCSIRInstr, llvm::lto::Config::SampleProfile, llvm::PGOOptions::SampleUse, SI, and TM.
Referenced by llvm::lto::opt().
|
static |
Definition at line 419 of file LTOBackend.cpp.
References llvm::ThreadPool::async(), codegen(), createTargetMachine(), llvm::Expected< T >::get(), llvm::heavyweight_hardware_concurrency(), Mod, move, llvm::parseBitcodeFile(), llvm::report_fatal_error(), llvm::SplitModule(), TM, llvm::ThreadPool::wait(), and llvm::WriteBitcodeToFile().
|
static |
Referenced by codegen(), llvm::embedBitcodeInModule(), and llvm::lto::opt().
|
static |
Referenced by llvm::lto::findThinLTOModule(), llvm::lto::initImportList(), and llvm::lto::thinBackend().