Lines Matching defs:LTO
1 //===-LTO.cpp - LLVM Link Time Optimizer ----------------------------------===//
9 // This file implements functions and classes used to support LTO.
13 #include "llvm/LTO/LTO.h"
36 #include "llvm/LTO/LTOBackend.h"
79 /// Enable global value internalization in LTO.
82 cl::desc("Enable global value internalization in LTO"));
86 cl::desc("Keep copies of symbols in LTO indexing"));
119 // Include the parts of the LTO configuration that affect code generation.
504 // Additionally, at least for the new LTO API, case 2 will only happen if
507 // Likely, users of the legacy LTO API are similar, however, currently there
508 // are llvm-lto based tests of the legacy LTO API that do not mark
571 // Skip symbols that are irrelevant to LTO. Note that this condition needs
572 // to match the one in Skip() in LTO::addRegularLTO().
592 LTO::RegularLTOState::RegularLTOState(unsigned ParallelCodeGenParallelismLevel,
600 LTO::ThinLTOState::ThinLTOState(ThinBackend BackendParam)
607 LTO::LTO(Config Conf, ThinBackend Backend,
622 LTO::~LTO() = default;
626 void LTO::addModuleToGlobalRes(ArrayRef<InputFile::Symbol> Syms,
638 // Keep copies of symbols if the client of LTO says so.
696 void LTO::releaseGlobalResolutionsMemory() {
728 Error LTO::add(std::unique_ptr<InputFile> Input,
750 Error LTO::addModule(InputFile &Input, unsigned ModI,
771 "unified LTO compilation must use "
797 // Regular LTO module summaries are added to a dummy module that represents
798 // the combined regular LTO module.
810 // regular LTO modules, in case we are in a mixed-LTO mode (both regular
811 // and thin LTO modules) compilation. Since the regular LTO module will be
814 // in the regular LTO module without this cleanup.
835 // Add a regular LTO object to the link.
836 // The resulting module needs to be linked into the combined LTO module with
838 Expected<LTO::RegularLTOState::AddedModule>
839 LTO::addRegularLTO(BitcodeModule BM, ArrayRef<InputFile::Symbol> Syms,
854 // If cfi.functions is present and we are in regular LTO mode, LowerTypeTests
880 // InputFile::create we omit some symbols that are irrelevant to LTO. The
993 Error LTO::linkRegularLTO(RegularLTOState::AddedModule Mod,
1031 Error LTO::addThinLTO(BitcodeModule BM, ArrayRef<InputFile::Symbol> Syms,
1110 unsigned LTO::getMaxTasks() const {
1119 Error LTO::checkPartiallySplit() {
1132 // merged regular LTO module IR.
1138 "inconsistent LTO Unit splitting (recompile with -fsplit-lto-unit)",
1154 "inconsistent LTO Unit splitting (recompile with -fsplit-lto-unit)",
1161 Error LTO::run(AddStreamFn AddStream, FileCache Cache) {
1226 // unconditionally. If supports-hot-cold-new was not enabled in the LTO
1250 Error LTO::runRegularLTO(AddStreamFn AddStream) {
1256 LLVM_DEBUG(dbgs() << "Running regular LTO\n");
1261 // Finalize linking of regular LTO modules containing summaries now that
1268 // Ensure we don't have inconsistently split LTO units with type tests.
1269 // FIXME: this checks both LTO and ThinLTO. It happens to work as we take
1351 // These linkages are seen in Unified regular LTO, because the process
1352 // of creating split LTO units introduces symbols with that linkage into
1354 // compile this module, but Unified Regular LTO processes both
1355 // modules created by the splitting process as regular LTO modules.
1382 SmallVector<const char *> LTO::getRuntimeLibcallSymbols(const Triple &TT) {
1842 Error LTO::runThinLTO(AddStreamFn AddStream, FileCache Cache,
1925 // performing IR-based WPD in hybrid regular/thin LTO mode).
1940 // we must apply DCE consistently with the full LTO module in order to avoid
1965 // Any functions referenced by the jump table in the regular LTO object must