Lines Matching refs:TheModule
92 static void saveTempBitcode(const Module &TheModule, StringRef TempDir, in saveTempBitcode() argument
103 WriteBitcodeToFile(TheModule, OS, /* ShouldPreserveUseListOrder */ true); in saveTempBitcode()
158 static void promoteModule(Module &TheModule, const ModuleSummaryIndex &Index, in promoteModule() argument
160 if (renameModuleForThinLTO(TheModule, Index, ClearDSOLocalOnDeclarations)) in promoteModule()
176 static void verifyLoadedModule(Module &TheModule) { in verifyLoadedModule() argument
178 if (verifyModule(TheModule, &dbgs(), &BrokenDebugInfo)) in verifyLoadedModule()
181 TheModule.getContext().diagnose(ThinLTODiagnosticInfo( in verifyLoadedModule()
183 StripDebugInfo(TheModule); in verifyLoadedModule()
211 crossImportIntoModule(Module &TheModule, const ModuleSummaryIndex &Index, in crossImportIntoModule() argument
217 return loadModuleFromInput(Input, TheModule.getContext(), in crossImportIntoModule()
222 Expected<bool> Result = Importer.importFunctions(TheModule, ImportList); in crossImportIntoModule()
225 SMDiagnostic Err = SMDiagnostic(TheModule.getModuleIdentifier(), in crossImportIntoModule()
232 verifyLoadedModule(TheModule); in crossImportIntoModule()
235 static void optimizeModule(Module &TheModule, TargetMachine &TM, in optimizeModule() argument
262 PM.run(TheModule); in optimizeModule()
298 std::unique_ptr<MemoryBuffer> codegenModule(Module &TheModule, in codegenModule() argument
317 PM.run(TheModule); in codegenModule()
416 ProcessThinLTOModule(Module &TheModule, ModuleSummaryIndex &Index, in ProcessThinLTOModule() argument
434 TheModule.getPIELevel() == PIELevel::Default; in ProcessThinLTOModule()
437 promoteModule(TheModule, Index, ClearDSOLocalOnDeclarations); in ProcessThinLTOModule()
440 thinLTOResolvePrevailingInModule(TheModule, DefinedGlobals); in ProcessThinLTOModule()
443 saveTempBitcode(TheModule, SaveTempsDir, count, ".1.promoted.bc"); in ProcessThinLTOModule()
450 thinLTOInternalizeModule(TheModule, DefinedGlobals); in ProcessThinLTOModule()
454 saveTempBitcode(TheModule, SaveTempsDir, count, ".2.internalized.bc"); in ProcessThinLTOModule()
457 crossImportIntoModule(TheModule, Index, ModuleMap, ImportList, in ProcessThinLTOModule()
461 saveTempBitcode(TheModule, SaveTempsDir, count, ".3.imported.bc"); in ProcessThinLTOModule()
464 optimizeModule(TheModule, TM, OptLevel, Freestanding, &Index); in ProcessThinLTOModule()
466 saveTempBitcode(TheModule, SaveTempsDir, count, ".4.opt.bc"); in ProcessThinLTOModule()
473 ProfileSummaryInfo PSI(TheModule); in ProcessThinLTOModule()
474 auto Index = buildModuleSummaryIndex(TheModule, nullptr, &PSI); in ProcessThinLTOModule()
475 WriteBitcodeToFile(TheModule, OS, true, &Index); in ProcessThinLTOModule()
480 return codegenModule(TheModule, TM); in ProcessThinLTOModule()
660 void ThinLTOCodeGenerator::promote(Module &TheModule, ModuleSummaryIndex &Index, in promote() argument
663 auto ModuleIdentifier = TheModule.getModuleIdentifier(); in promote()
671 File, PreservedSymbols, Triple(TheModule.getTargetTriple())); in promote()
694 TheModule, ModuleToDefinedGVSummaries[ModuleIdentifier]); in promote()
703 promoteModule(TheModule, Index, /*ClearDSOLocalOnDeclarations=*/false); in promote()
709 void ThinLTOCodeGenerator::crossModuleImport(Module &TheModule, in crossModuleImport() argument
721 File, PreservedSymbols, Triple(TheModule.getTargetTriple())); in crossModuleImport()
733 auto &ImportList = ImportLists[TheModule.getModuleIdentifier()]; in crossModuleImport()
736 crossImportIntoModule(TheModule, Index, ModuleMap, ImportList, in crossModuleImport()
744 Module &TheModule, ModuleSummaryIndex &Index, in gatherImportedSummariesForModule() argument
748 auto ModuleIdentifier = TheModule.getModuleIdentifier(); in gatherImportedSummariesForModule()
756 File, PreservedSymbols, Triple(TheModule.getTargetTriple())); in gatherImportedSummariesForModule()
777 void ThinLTOCodeGenerator::emitImports(Module &TheModule, StringRef OutputName, in emitImports() argument
781 auto ModuleIdentifier = TheModule.getModuleIdentifier(); in emitImports()
789 File, PreservedSymbols, Triple(TheModule.getTargetTriple())); in emitImports()
818 void ThinLTOCodeGenerator::internalize(Module &TheModule, in internalize() argument
821 initTMBuilder(TMBuilder, Triple(TheModule.getTargetTriple())); in internalize()
823 auto ModuleIdentifier = TheModule.getModuleIdentifier(); in internalize()
865 promoteModule(TheModule, Index, /*ClearDSOLocalOnDeclarations=*/false); in internalize()
869 TheModule, ModuleToDefinedGVSummaries[ModuleIdentifier]); in internalize()
871 thinLTOInternalizeModule(TheModule, in internalize()
878 void ThinLTOCodeGenerator::optimize(Module &TheModule) { in optimize() argument
879 initTMBuilder(TMBuilder, Triple(TheModule.getTargetTriple())); in optimize()
882 optimizeModule(TheModule, *TMBuilder.create(), OptLevel, Freestanding, in optimize()
950 auto TheModule = loadModuleFromInput(Mod.get(), Context, false, in run() local
954 auto OutputBuffer = codegenModule(*TheModule, *TMBuilder.create()); in run()
1118 auto TheModule = loadModuleFromInput(Mod.get(), Context, false, in run() local
1122 saveTempBitcode(*TheModule, SaveTempsDir, count, ".0.original.bc"); in run()
1127 *TheModule, *Index, ModuleMap, *TMBuilder.create(), ImportList, in run()