Lines Matching +full:custom +full:- +full:temp

1 //===-LTOBackend.cpp - LLVM Link Time Optimizer Backend -------------------===//
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
14 //===----------------------------------------------------------------------===//
53 #define DEBUG_TYPE "lto-backend"
62 "lto-embed-bitcode", cl::init(LTOBitcodeEmbedding::DoNotEmbed),
68 "post-merge-pre-opt",
73 "thinlto-assume-merged", cl::init(false),
75 "importing and the other pre-optimization pipeline changes."));
115 if (M.getModuleIdentifier() == "ld-temp.o" || !UseInputModulePath) { in addSaveTemps()
117 if (Task != (unsigned)-1) in addSaveTemps()
124 // Because -save-temps is a debugging feature, we report the error in addSaveTemps()
139 // Because -save-temps is a debugging feature, we report the error in addSaveTemps()
196 PassPlugin->registerPassBuilderCallbacks(PB); in RegisterPassPlugins()
221 std::unique_ptr<TargetMachine> TM(TheTarget->createTargetMachine( in createTargetMachine()
228 TM->setLargeDataThreshold(*LargeDataThreshold); in createTargetMachine()
260 TM->setPGOOption(PGOOpt); in runNewPMPasses()
276 new TargetLibraryInfoImpl(Triple(TM->getTargetTriple()))); in runNewPMPasses()
278 TLII->disableAllFunctions(); in runNewPMPasses()
281 // Parse a custom AA pipeline if asked to. in runNewPMPasses()
323 // Parse a custom pipeline if asked to. in runNewPMPasses()
346 // FIXME: the motivation for capturing post-merge bitcode and command line in opt()
349 // assumes a clang - based invocation, case in which we have the command in opt()
352 // linker-based case, so we currently don't plumb the command line args in in opt()
356 dbgs() << "Post-(Thin)LTO merge bitcode embedding was requested, but " in opt()
390 TM->Options.MCOptions.SplitDwarfFile = std::string(DwoFile); in codegen()
392 TM->Options.MCOptions.SplitDwarfFile = Conf.SplitDwarfFile; in codegen()
407 TM->Options.ObjectFilenameForDebug = Stream->ObjectPathName; in codegen()
416 if (TM->addPassesToEmitFile(CodeGenPasses, *Stream->OS, in codegen()
417 DwoOut ? &DwoOut->os() : nullptr, in codegen()
423 DwoOut->keep(); in codegen()
433 const Target *T = &TM->getTarget(); in splitCodeGen()
437 // We want to clone the module in a new context to multi-thread the in splitCodeGen()
452 parseBitcodeFile(MemoryBufferRef(BC.str(), "ld-temp.o"), Ctx); in splitCodeGen()
468 // Try target-specific module splitting first, then fallback to the default. in splitCodeGen()
469 if (!TM->splitModule(Mod, ParallelCodeGenParallelismLevel, in splitCodeGen()
501 DiagOutputFile->keep(); in finalizeOptimizationRemarks()
502 DiagOutputFile->os().flush(); in finalizeOptimizationRemarks()
545 GV->removeDeadConstantUsers(); in dropDeadSymbols()
547 // non-prevailing IR def, but we need to keep the declaration). in dropDeadSymbols()
548 if (GV->use_empty()) in dropDeadSymbols()
549 GV->eraseFromParent(); in dropDeadSymbols()
603 // conservatively do this for -fpic. in thinBackend()
605 TM->getTargetTriple().isOSBinFormatELF() && in thinBackend()
606 TM->getRelocationModel() != Reloc::Static && in thinBackend()
628 auto I = ModuleMap->find(Identifier); in thinBackend()
629 assert(I != ModuleMap->end()); in thinBackend()
630 return I->second.getLazyModule(Mod.getContext(), in thinBackend()
650 BMOrErr->getLazyModule(Mod.getContext(), in thinBackend()
654 (*MOrErr)->setOwnedMemoryBuffer(std::move(*MBOrErr)); in thinBackend()
679 if (LTOInfo && LTOInfo->IsThinLTO) in findThinLTOModule()
716 if (Summary->modulePath() == M.getModuleIdentifier()) in initImportList()
720 // exists, set the value to 'std::min(existing-value, new-value)' to make in initImportList()
722 auto [Iter, Inserted] = ImportList[Summary->modulePath()].try_emplace( in initImportList()
723 GUID, Summary->importType()); in initImportList()
726 Iter->second = std::min(Iter->second, Summary->importType()); in initImportList()