Lines Matching refs:TheModule
95 static void saveTempBitcode(const Module &TheModule, StringRef TempDir, in saveTempBitcode() argument
106 WriteBitcodeToFile(TheModule, OS, /* ShouldPreserveUseListOrder */ true); in saveTempBitcode()
162 static void promoteModule(Module &TheModule, const ModuleSummaryIndex &Index, in promoteModule() argument
164 if (renameModuleForThinLTO(TheModule, Index, ClearDSOLocalOnDeclarations)) in promoteModule()
180 static void verifyLoadedModule(Module &TheModule) { in verifyLoadedModule() argument
182 if (verifyModule(TheModule, &dbgs(), &BrokenDebugInfo)) in verifyLoadedModule()
185 TheModule.getContext().diagnose(ThinLTODiagnosticInfo( in verifyLoadedModule()
187 StripDebugInfo(TheModule); in verifyLoadedModule()
215 crossImportIntoModule(Module &TheModule, const ModuleSummaryIndex &Index, in crossImportIntoModule() argument
221 return loadModuleFromInput(Input, TheModule.getContext(), in crossImportIntoModule()
226 Expected<bool> Result = Importer.importFunctions(TheModule, ImportList); in crossImportIntoModule()
229 SMDiagnostic Err = SMDiagnostic(TheModule.getModuleIdentifier(), in crossImportIntoModule()
236 verifyLoadedModule(TheModule); in crossImportIntoModule()
239 static void optimizeModule(Module &TheModule, TargetMachine &TM, in optimizeModule() argument
249 StandardInstrumentations SI(TheModule.getContext(), DebugPassManager); in optimizeModule()
292 MPM.run(TheModule, MAM); in optimizeModule()
328 std::unique_ptr<MemoryBuffer> codegenModule(Module &TheModule, in codegenModule() argument
347 PM.run(TheModule); in codegenModule()
432 ProcessThinLTOModule(Module &TheModule, ModuleSummaryIndex &Index, in ProcessThinLTOModule() argument
450 TheModule.getPIELevel() == PIELevel::Default; in ProcessThinLTOModule()
453 promoteModule(TheModule, Index, ClearDSOLocalOnDeclarations); in ProcessThinLTOModule()
456 thinLTOFinalizeInModule(TheModule, DefinedGlobals, /*PropagateAttrs=*/true); in ProcessThinLTOModule()
459 saveTempBitcode(TheModule, SaveTempsDir, count, ".1.promoted.bc"); in ProcessThinLTOModule()
466 thinLTOInternalizeModule(TheModule, DefinedGlobals); in ProcessThinLTOModule()
470 saveTempBitcode(TheModule, SaveTempsDir, count, ".2.internalized.bc"); in ProcessThinLTOModule()
473 crossImportIntoModule(TheModule, Index, ModuleMap, ImportList, in ProcessThinLTOModule()
479 updatePublicTypeTestCalls(TheModule, in ProcessThinLTOModule()
483 saveTempBitcode(TheModule, SaveTempsDir, count, ".3.imported.bc"); in ProcessThinLTOModule()
485 optimizeModule(TheModule, TM, OptLevel, Freestanding, DebugPassManager, in ProcessThinLTOModule()
488 saveTempBitcode(TheModule, SaveTempsDir, count, ".4.opt.bc"); in ProcessThinLTOModule()
495 ProfileSummaryInfo PSI(TheModule); in ProcessThinLTOModule()
496 auto Index = buildModuleSummaryIndex(TheModule, nullptr, &PSI); in ProcessThinLTOModule()
497 WriteBitcodeToFile(TheModule, OS, true, &Index); in ProcessThinLTOModule()
503 return codegenModule(TheModule, TM); in ProcessThinLTOModule()
684 void ThinLTOCodeGenerator::promote(Module &TheModule, ModuleSummaryIndex &Index, in promote() argument
687 auto ModuleIdentifier = TheModule.getModuleIdentifier(); in promote()
695 File, PreservedSymbols, Triple(TheModule.getTargetTriple())); in promote()
719 thinLTOFinalizeInModule(TheModule, in promote()
730 promoteModule(TheModule, Index, /*ClearDSOLocalOnDeclarations=*/false); in promote()
736 void ThinLTOCodeGenerator::crossModuleImport(Module &TheModule, in crossModuleImport() argument
748 File, PreservedSymbols, Triple(TheModule.getTargetTriple())); in crossModuleImport()
765 auto &ImportList = ImportLists[TheModule.getModuleIdentifier()]; in crossModuleImport()
768 crossImportIntoModule(TheModule, Index, ModuleMap, ImportList, in crossModuleImport()
776 Module &TheModule, ModuleSummaryIndex &Index, in gatherImportedSummariesForModule() argument
780 auto ModuleIdentifier = TheModule.getModuleIdentifier(); in gatherImportedSummariesForModule()
788 File, PreservedSymbols, Triple(TheModule.getTargetTriple())); in gatherImportedSummariesForModule()
814 void ThinLTOCodeGenerator::emitImports(Module &TheModule, StringRef OutputName, in emitImports() argument
818 auto ModuleIdentifier = TheModule.getModuleIdentifier(); in emitImports()
826 File, PreservedSymbols, Triple(TheModule.getTargetTriple())); in emitImports()
860 void ThinLTOCodeGenerator::internalize(Module &TheModule, in internalize() argument
863 initTMBuilder(TMBuilder, Triple(TheModule.getTargetTriple())); in internalize()
865 auto ModuleIdentifier = TheModule.getModuleIdentifier(); in internalize()
909 promoteModule(TheModule, Index, /*ClearDSOLocalOnDeclarations=*/false); in internalize()
912 thinLTOFinalizeInModule(TheModule, in internalize()
916 thinLTOInternalizeModule(TheModule, in internalize()
923 void ThinLTOCodeGenerator::optimize(Module &TheModule) { in optimize() argument
924 initTMBuilder(TMBuilder, Triple(TheModule.getTargetTriple())); in optimize()
927 optimizeModule(TheModule, *TMBuilder.create(), OptLevel, Freestanding, in optimize()
1000 auto TheModule = loadModuleFromInput(Mod.get(), Context, false, in run() local
1004 auto OutputBuffer = codegenModule(*TheModule, *TMBuilder.create()); in run()
1185 auto TheModule = loadModuleFromInput(Mod.get(), Context, false, in run() local
1189 saveTempBitcode(*TheModule, SaveTempsDir, count, ".0.original.bc"); in run()
1194 *TheModule, *Index, ModuleMap, *TMBuilder.create(), ImportList, in run()