Lines Matching refs:TheModule

83 static void saveTempBitcode(const Module &TheModule, StringRef TempDir,  in saveTempBitcode()  argument
94 WriteBitcodeToFile(TheModule, OS, /* ShouldPreserveUseListOrder */ true); in saveTempBitcode()
150 static void promoteModule(Module &TheModule, const ModuleSummaryIndex &Index) { in promoteModule() argument
151 if (renameModuleForThinLTO(TheModule, Index)) in promoteModule()
167 static void verifyLoadedModule(Module &TheModule) { in verifyLoadedModule() argument
169 if (verifyModule(TheModule, &dbgs(), &BrokenDebugInfo)) in verifyLoadedModule()
172 TheModule.getContext().diagnose(ThinLTODiagnosticInfo( in verifyLoadedModule()
174 StripDebugInfo(TheModule); in verifyLoadedModule()
201 crossImportIntoModule(Module &TheModule, const ModuleSummaryIndex &Index, in crossImportIntoModule() argument
205 return loadModuleFromBuffer(ModuleMap[Identifier], TheModule.getContext(), in crossImportIntoModule()
210 Expected<bool> Result = Importer.importFunctions(TheModule, ImportList); in crossImportIntoModule()
213 SMDiagnostic Err = SMDiagnostic(TheModule.getModuleIdentifier(), in crossImportIntoModule()
220 verifyLoadedModule(TheModule); in crossImportIntoModule()
223 static void optimizeModule(Module &TheModule, TargetMachine &TM, in optimizeModule() argument
248 PM.run(TheModule); in optimizeModule()
265 std::unique_ptr<MemoryBuffer> codegenModule(Module &TheModule, in codegenModule() argument
284 PM.run(TheModule); in codegenModule()
383 ProcessThinLTOModule(Module &TheModule, ModuleSummaryIndex &Index, in ProcessThinLTOModule() argument
397 promoteModule(TheModule, Index); in ProcessThinLTOModule()
400 thinLTOResolvePrevailingInModule(TheModule, DefinedGlobals); in ProcessThinLTOModule()
403 saveTempBitcode(TheModule, SaveTempsDir, count, ".1.promoted.bc"); in ProcessThinLTOModule()
410 thinLTOInternalizeModule(TheModule, DefinedGlobals); in ProcessThinLTOModule()
414 saveTempBitcode(TheModule, SaveTempsDir, count, ".2.internalized.bc"); in ProcessThinLTOModule()
417 crossImportIntoModule(TheModule, Index, ModuleMap, ImportList); in ProcessThinLTOModule()
420 saveTempBitcode(TheModule, SaveTempsDir, count, ".3.imported.bc"); in ProcessThinLTOModule()
423 optimizeModule(TheModule, TM, OptLevel, Freestanding); in ProcessThinLTOModule()
425 saveTempBitcode(TheModule, SaveTempsDir, count, ".4.opt.bc"); in ProcessThinLTOModule()
432 ProfileSummaryInfo PSI(TheModule); in ProcessThinLTOModule()
433 auto Index = buildModuleSummaryIndex(TheModule, nullptr, &PSI); in ProcessThinLTOModule()
434 WriteBitcodeToFile(TheModule, OS, true, &Index); in ProcessThinLTOModule()
439 return codegenModule(TheModule, TM); in ProcessThinLTOModule()
596 void ThinLTOCodeGenerator::promote(Module &TheModule, in promote() argument
599 auto ModuleIdentifier = TheModule.getModuleIdentifier(); in promote()
607 PreservedSymbols, Triple(TheModule.getTargetTriple())); in promote()
623 TheModule, ModuleToDefinedGVSummaries[ModuleIdentifier]); in promote()
629 promoteModule(TheModule, Index); in promote()
635 void ThinLTOCodeGenerator::crossModuleImport(Module &TheModule, in crossModuleImport() argument
646 PreservedSymbols, Triple(TheModule.getTargetTriple())); in crossModuleImport()
656 auto &ImportList = ImportLists[TheModule.getModuleIdentifier()]; in crossModuleImport()
658 crossImportIntoModule(TheModule, Index, ModuleMap, ImportList); in crossModuleImport()
665 Module &TheModule, ModuleSummaryIndex &Index, in gatherImportedSummariesForModule() argument
668 auto ModuleIdentifier = TheModule.getModuleIdentifier(); in gatherImportedSummariesForModule()
676 PreservedSymbols, Triple(TheModule.getTargetTriple())); in gatherImportedSummariesForModule()
695 void ThinLTOCodeGenerator::emitImports(Module &TheModule, StringRef OutputName, in emitImports() argument
698 auto ModuleIdentifier = TheModule.getModuleIdentifier(); in emitImports()
706 PreservedSymbols, Triple(TheModule.getTargetTriple())); in emitImports()
732 void ThinLTOCodeGenerator::internalize(Module &TheModule, in internalize() argument
734 initTMBuilder(TMBuilder, Triple(TheModule.getTargetTriple())); in internalize()
736 auto ModuleIdentifier = TheModule.getModuleIdentifier(); in internalize()
763 thinLTOInternalizeModule(TheModule, in internalize()
770 void ThinLTOCodeGenerator::optimize(Module &TheModule) { in optimize() argument
771 initTMBuilder(TMBuilder, Triple(TheModule.getTargetTriple())); in optimize()
774 optimizeModule(TheModule, *TMBuilder.create(), OptLevel, Freestanding); in optimize()
839 auto TheModule = in run() local
844 auto OutputBuffer = codegenModule(*TheModule, *TMBuilder.create()); in run()
984 auto TheModule = in run() local
989 saveTempBitcode(*TheModule, SaveTempsDir, count, ".0.original.bc"); in run()
994 *TheModule, *Index, ModuleMap, *TMBuilder.create(), ImportList, in run()