LLVM 20.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/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/VirtualFileSystem.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Target/TargetMachine.h"
#include "llvm/TargetParser/SubtargetFeature.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 | |
namespace | 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 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< 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 53 of file LTOBackend.cpp.
#define HANDLE_EXTENSION | ( | Ext | ) | llvm::PassPluginLibraryInfo get##Ext##PluginInfo(); |
Definition at line 181 of file LTOBackend.cpp.
#define HANDLE_EXTENSION | ( | Ext | ) | get##Ext##PluginInfo().RegisterPassBuilderCallbacks(PB); |
Definition at line 181 of file LTOBackend.cpp.
|
strong |
Enumerator | |
---|---|
DoNotEmbed | |
EmbedOptimized | |
EmbedPostMergePreOptimized |
Definition at line 55 of file LTOBackend.cpp.
|
static |
Definition at line 378 of file LTOBackend.cpp.
References llvm::legacy::PassManager::add(), llvm::sys::path::append(), llvm::lto::Config::CGFileType, codegen(), llvm::sys::fs::create_directories(), llvm::createImmutableModuleSummaryIndexWrapperPass(), llvm::lto::Config::DwoDir, EmbedBitcode, llvm::embedBitcodeInModule(), llvm::SmallVectorBase< Size_T >::empty(), llvm::Mod, llvm::sys::fs::OF_None, llvm::lto::Config::PreCodeGenModuleHook, llvm::lto::Config::PreCodeGenPassesHook, llvm::report_fatal_error(), llvm::legacy::PassManager::run(), llvm::lto::Config::SplitDwarfFile, llvm::lto::Config::SplitDwarfOutput, llvm::Expected< T >::takeError(), and TM.
Referenced by llvm::lto::backend(), codegen(), splitCodeGen(), and llvm::lto::thinBackend().
|
static |
Definition at line 201 of file LTOBackend.cpp.
References A, 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(), llvm::lto::Config::MAttrs, llvm::PICLevel::NotPIC, llvm::lto::Config::Options, llvm::Reloc::PIC_, llvm::lto::Config::RelocModel, llvm::Reloc::Static, and TM.
|
static |
Definition at line 542 of file LTOBackend.cpp.
References llvm::convertToDeclaration(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::lookup(), and llvm::Mod.
Referenced by llvm::lto::thinBackend().
Definition at line 491 of file LTOBackend.cpp.
References llvm::CallingConv::C, llvm::inconvertibleErrorCode(), llvm::TargetRegistry::lookupTarget(), and llvm::Mod.
Referenced by llvm::lto::backend(), and llvm::lto::thinBackend().
|
static |
Definition at line 185 of file LTOBackend.cpp.
References llvm::PassPlugin::Load(), PB(), llvm::PassPlugin::registerPassBuilderCallbacks(), and llvm::report_fatal_error().
Referenced by runNewPMPasses().
Definition at line 81 of file LTOBackend.cpp.
References llvm::errs(), and llvm::raw_ostream::flush().
Referenced by llvm::lto::Config::addSaveTemps().
|
static |
Definition at line 233 of file LTOBackend.cpp.
References llvm::lto::Config::AAPipeline, llvm::lto::Config::AddFSDiscriminator, llvm::PassManager< IRUnitT, AnalysisManagerT, ExtraArgTs >::addPass(), llvm::PassBuilder::buildLTODefaultPipeline(), llvm::PassBuilder::buildThinLTODefaultPipeline(), CGAM, llvm::PassBuilder::crossRegisterProxies(), llvm::PGOOptions::CSIRInstr, llvm::lto::Config::CSIRProfile, llvm::PGOOptions::CSIRUse, llvm::lto::Config::DebugPassManager, llvm::PGOOptions::Default, llvm::lto::Config::DisableVerify, FAM, llvm::lto::Config::Freestanding, llvm::PassInstrumentationCallbacks::getPassNameForClassName(), llvm::vfs::getRealFileSystem(), llvm::PGOOptions::IRUse, LAM, llvm_unreachable, MAM, llvm::Mod, MPM, llvm::PGOOptions::NoAction, llvm::PGOOptions::NoCSAction, llvm::NoPGOWarnMismatch, llvm::OptimizationLevel::O0, llvm::OptimizationLevel::O1, llvm::OptimizationLevel::O2, llvm::OptimizationLevel::O3, llvm::lto::Config::OptPipeline, OS, llvm::outs(), llvm::PassBuilder::parseAAPipeline(), llvm::PassBuilder::parsePassPipeline(), PassName, llvm::lto::Config::PassPlugins, PB(), llvm::lto::Config::PGOWarnMismatch, PIC, llvm::PassManager< IRUnitT, AnalysisManagerT, ExtraArgTs >::printPipeline(), llvm::PrintPipelinePasses, llvm::lto::Config::ProfileRemapping, llvm::lto::Config::PTO, llvm::PassBuilder::registerCGSCCAnalyses(), llvm::PassBuilder::registerFunctionAnalyses(), llvm::PassBuilder::registerLoopAnalyses(), llvm::PassBuilder::registerModuleAnalyses(), llvm::AnalysisManager< IRUnitT, ExtraArgTs >::registerPass(), RegisterPassPlugins(), llvm::report_fatal_error(), llvm::PassManager< IRUnitT, AnalysisManagerT, ExtraArgTs >::run(), llvm::lto::Config::RunCSIRInstr, llvm::lto::Config::SampleProfile, llvm::PGOOptions::SampleUse, TM, llvm::dwarf::toString(), and llvm::lto::Config::VerifyEach.
Referenced by llvm::lto::opt().
|
static |
Definition at line 436 of file LTOBackend.cpp.
References llvm::ThreadPoolInterface::async(), llvm::CallingConv::C, codegen(), createTargetMachine(), llvm::Expected< T >::get(), llvm::heavyweight_hardware_concurrency(), llvm::Mod, llvm::parseBitcodeFile(), llvm::report_fatal_error(), llvm::SplitModule(), llvm::SmallString< InternalLen >::str(), TM, llvm::SingleThreadExecutor::wait(), and llvm::WriteBitcodeToFile().
Referenced by llvm::lto::backend().
|
static |
Referenced by codegen(), llvm::embedBitcodeInModule(), and llvm::lto::opt().
|
static |
Referenced by llvm::lto::findThinLTOModule(), llvm::lto::initImportList(), and llvm::lto::thinBackend().