|
LLVM 24.0.0git
|
#include "llvm/LTO/legacy/ThinLTOCodeGenerator.h"#include "llvm/Support/CommandLine.h"#include "llvm/ADT/ScopeExit.h"#include "llvm/ADT/Statistic.h"#include "llvm/ADT/StringExtras.h"#include "llvm/Analysis/ModuleSummaryAnalysis.h"#include "llvm/Analysis/ProfileSummaryInfo.h"#include "llvm/Analysis/TargetLibraryInfo.h"#include "llvm/Bitcode/BitcodeReader.h"#include "llvm/Bitcode/BitcodeWriter.h"#include "llvm/Bitcode/BitcodeWriterPass.h"#include "llvm/CodeGen/CommandFlags.h"#include "llvm/Config/llvm-config.h"#include "llvm/IR/DebugInfo.h"#include "llvm/IR/DiagnosticPrinter.h"#include "llvm/IR/LLVMContext.h"#include "llvm/IR/LLVMRemarkStreamer.h"#include "llvm/IR/LegacyPassManager.h"#include "llvm/IR/Mangler.h"#include "llvm/IR/PassTimingInfo.h"#include "llvm/IR/Verifier.h"#include "llvm/IRReader/IRReader.h"#include "llvm/LTO/LTO.h"#include "llvm/MC/TargetRegistry.h"#include "llvm/Object/IRObjectFile.h"#include "llvm/Passes/PassBuilder.h"#include "llvm/Passes/StandardInstrumentations.h"#include "llvm/Remarks/HotnessThresholdParser.h"#include "llvm/Support/CachePruning.h"#include "llvm/Support/Debug.h"#include "llvm/Support/Error.h"#include "llvm/Support/FileSystem.h"#include "llvm/Support/FormatVariadic.h"#include "llvm/Support/LibraryOptionsContext.h"#include "llvm/Support/Path.h"#include "llvm/Support/SHA1.h"#include "llvm/Support/SmallVectorMemoryBuffer.h"#include "llvm/Support/ThreadPool.h"#include "llvm/Support/Threading.h"#include "llvm/Support/ToolOutputFile.h"#include "llvm/Support/raw_ostream.h"#include "llvm/Target/TargetMachine.h"#include "llvm/TargetParser/SubtargetFeature.h"#include "llvm/Transforms/IPO/FunctionAttrs.h"#include "llvm/Transforms/IPO/FunctionImport.h"#include "llvm/Transforms/IPO/Internalize.h"#include "llvm/Transforms/IPO/WholeProgramDevirt.h"#include "llvm/Transforms/Utils/FunctionImportUtils.h"#include <unistd.h>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 "thinlto" |
Variables | |
| static cl::opt< int > | ThreadCount ("threads", cl::init(0)) |
| #define DEBUG_TYPE "thinlto" |
Definition at line 73 of file ThinLTOCodeGenerator.cpp.
|
static |
Definition at line 310 of file ThinLTOCodeGenerator.cpp.
References llvm::GlobalValue::getGUIDAssumingExternalLinkage(), and llvm::detail::DenseSetImpl< ValueT, MapTy >::insert().
Referenced by llvm::ThinLTOCodeGenerator::crossModuleImport(), llvm::ThinLTOCodeGenerator::emitImports(), llvm::ThinLTOCodeGenerator::gatherImportedSummariesForModule(), llvm::ThinLTOCodeGenerator::internalize(), llvm::ThinLTOCodeGenerator::promote(), and llvm::ThinLTOCodeGenerator::run().
|
static |
Definition at line 347 of file ThinLTOCodeGenerator.cpp.
References llvm::TargetMachine::addPassesToEmitFile(), llvm::ObjectFile, llvm::report_fatal_error(), and llvm::legacy::PassManager::run().
Referenced by ProcessThinLTOModule(), and llvm::ThinLTOCodeGenerator::run().
|
static |
Definition at line 678 of file ThinLTOCodeGenerator.cpp.
References llvm::computeDeadSymbolsWithConstProp(), G, and llvm::Unknown.
Referenced by llvm::ThinLTOCodeGenerator::crossModuleImport(), llvm::ThinLTOCodeGenerator::emitImports(), llvm::ThinLTOCodeGenerator::gatherImportedSummariesForModule(), llvm::ThinLTOCodeGenerator::internalize(), llvm::ThinLTOCodeGenerator::promote(), and llvm::ThinLTOCodeGenerator::run().
|
static |
Definition at line 338 of file ThinLTOCodeGenerator.cpp.
References computeGUIDPreservedSymbols(), and llvm::StringMapImpl::size().
|
static |
Definition at line 323 of file ThinLTOCodeGenerator.cpp.
References llvm::StringMap< ValueTy, AllocatorTy >::count(), llvm::GlobalValue::ExternalLinkage, llvm::GlobalValue::getGlobalIdentifier(), llvm::GlobalValue::getGUIDAssumingExternalLinkage(), and llvm::detail::DenseSetImpl< ValueT, MapTy >::insert().
Referenced by computeGUIDPreservedSymbols(), llvm::ThinLTOCodeGenerator::crossModuleImport(), llvm::ThinLTOCodeGenerator::emitImports(), llvm::ThinLTOCodeGenerator::gatherImportedSummariesForModule(), llvm::ThinLTOCodeGenerator::internalize(), llvm::ThinLTOCodeGenerator::promote(), and llvm::ThinLTOCodeGenerator::run().
|
static |
Definition at line 136 of file ThinLTOCodeGenerator.cpp.
References getFirstDefinitionForLinker(), and I.
Referenced by llvm::ThinLTOCodeGenerator::crossModuleImport(), llvm::ThinLTOCodeGenerator::emitImports(), llvm::ThinLTOCodeGenerator::gatherImportedSummariesForModule(), llvm::ThinLTOCodeGenerator::internalize(), llvm::ThinLTOCodeGenerator::promote(), and llvm::ThinLTOCodeGenerator::run().
|
static |
Definition at line 214 of file ThinLTOCodeGenerator.cpp.
References llvm::Module::getContext(), llvm::handleAllErrors(), llvm::FunctionImporter::importFunctions(), loadModuleFromInput(), llvm::report_fatal_error(), and verifyLoadedModule().
Referenced by llvm::ThinLTOCodeGenerator::crossModuleImport(), and ProcessThinLTOModule().
|
static |
Definition at line 152 of file ThinLTOCodeGenerator.cpp.
References assert(), llvm::StringMap< ValueTy, AllocatorTy >::contains(), llvm::dbgs(), and LLVM_DEBUG.
Referenced by llvm::ThinLTOCodeGenerator::crossModuleImport(), and llvm::ThinLTOCodeGenerator::run().
|
static |
Definition at line 109 of file ThinLTOCodeGenerator.cpp.
References llvm::find_if(), llvm::GlobalValue::isAvailableExternallyLinkage(), llvm::GlobalValue::isWeakForLinker(), and Linkage.
Referenced by computePrevailingCopies().
|
static |
Definition at line 559 of file ThinLTOCodeGenerator.cpp.
References llvm::TargetOptions::DataSections, llvm::codegen::getExplicitDataSections(), llvm::lto::getThinLTODefaultCPU(), llvm::ThinLTOCodeGeneratorImpl::TargetMachineBuilder::MCpu, llvm::ThinLTOCodeGeneratorImpl::TargetMachineBuilder::Options, and llvm::ThinLTOCodeGeneratorImpl::TargetMachineBuilder::TheTriple.
Referenced by llvm::ThinLTOCodeGenerator::addModule(), llvm::ThinLTOCodeGenerator::internalize(), and llvm::ThinLTOCodeGenerator::optimize().
|
static |
Definition at line 191 of file ThinLTOCodeGenerator.cpp.
References llvm::Expected< T >::get(), llvm::handleAllErrors(), Mod, llvm::report_fatal_error(), llvm::Expected< T >::takeError(), and verifyLoadedModule().
Referenced by crossImportIntoModule(), and llvm::ThinLTOCodeGenerator::run().
|
static |
Definition at line 238 of file ThinLTOCodeGenerator.cpp.
References llvm::PassManager< IRUnitT, AnalysisManagerT, ExtraArgTs >::addPass(), CGAM, llvm::PGOOptions::CSIRInstr, llvm::PGOOptions::CSIRUse, llvm::PGOOptions::Default, FAM, llvm::Module::getContext(), llvm::LLVMContext::getLibraryOptions(), llvm::TargetMachine::getTargetTriple(), llvm::PGOOptions::IRUse, LAM, llvm_unreachable, llvm::PipelineTuningOptions::LoopVectorization, llvm::LTOCSIRProfile, llvm::LTORunCSIRInstr, MAM, llvm::PGOOptions::NoCSAction, llvm::O0, llvm::O1, llvm::O2, llvm::O3, llvm::TargetMachine::Options, PB(), PIC, llvm::PassManager< IRUnitT, AnalysisManagerT, ExtraArgTs >::run(), llvm::SampleProfileFile, llvm::PGOOptions::SampleUse, llvm::PipelineTuningOptions::SLPVectorization, and llvm::TargetOptions::VecLib.
Referenced by llvm::ThinLTOCodeGenerator::optimize(), and ProcessThinLTOModule().
|
static |
Definition at line 451 of file ThinLTOCodeGenerator.cpp.
References llvm::buildModuleSummaryIndex(), codegenModule(), llvm::count(), crossImportIntoModule(), llvm::PIELevel::Default, llvm::detail::DenseSetImpl< ValueT, MapTy >::empty(), llvm::Module::getPIELevel(), llvm::TargetMachine::getRelocationModel(), llvm::Module::getTargetTriple(), llvm::Triple::isOSBinFormatELF(), optimizeModule(), promoteModule(), saveTempBitcode(), llvm::StringMapImpl::size(), llvm::Reloc::Static, llvm::thinLTOFinalizeInModule(), llvm::thinLTOInternalizeModule(), llvm::updatePublicTypeTestCalls(), and llvm::WriteBitcodeToFile().
Referenced by llvm::ThinLTOCodeGenerator::run().
|
static |
Definition at line 163 of file ThinLTOCodeGenerator.cpp.
References llvm::renameModuleForThinLTO().
Referenced by llvm::ThinLTOCodeGenerator::internalize(), ProcessThinLTOModule(), and llvm::ThinLTOCodeGenerator::promote().
|
static |
Resolve prevailing symbols.
Record resolutions in the ResolvedODR map for caching, and in the Index for application during the ThinLTO backends. This is needed for correctness for exported symbols (ensure at least one copy kept) and a compile-time optimization (to drop duplicate copies when possible).
Definition at line 530 of file ThinLTOCodeGenerator.cpp.
References llvm::DenseMapBase< StorageT, KeyT, ValueT, KeyInfoT, BucketT >::end(), llvm::DenseMapBase< StorageT, KeyT, ValueT, KeyInfoT, BucketT >::find(), and llvm::thinLTOResolvePrevailingInIndex().
Referenced by llvm::ThinLTOCodeGenerator::internalize(), llvm::ThinLTOCodeGenerator::promote(), and llvm::ThinLTOCodeGenerator::run().
|
static |
Definition at line 95 of file ThinLTOCodeGenerator.cpp.
References llvm::count(), llvm::StringRef::empty(), llvm::sys::fs::OF_None, llvm::report_fatal_error(), and llvm::WriteBitcodeToFile().
Referenced by ProcessThinLTOModule(), and llvm::ThinLTOCodeGenerator::run().
|
static |
Verify the module and strip broken debug info.
Definition at line 180 of file ThinLTOCodeGenerator.cpp.
References llvm::dbgs(), llvm::LLVMContext::diagnose(), llvm::DS_Warning, llvm::Module::getContext(), llvm::report_fatal_error(), llvm::StripDebugInfo(), and llvm::verifyModule().
Referenced by crossImportIntoModule(), and loadModuleFromInput().
|
static |