Lines Matching refs:TheModule

96 static void saveTempBitcode(const Module &TheModule, StringRef TempDir,  in saveTempBitcode()  argument
107 WriteBitcodeToFile(TheModule, OS, /* ShouldPreserveUseListOrder */ true); in saveTempBitcode()
163 static void promoteModule(Module &TheModule, const ModuleSummaryIndex &Index, in promoteModule() argument
165 if (renameModuleForThinLTO(TheModule, Index, ClearDSOLocalOnDeclarations)) in promoteModule()
181 static void verifyLoadedModule(Module &TheModule) { in verifyLoadedModule() argument
183 if (verifyModule(TheModule, &dbgs(), &BrokenDebugInfo)) in verifyLoadedModule()
186 TheModule.getContext().diagnose(ThinLTODiagnosticInfo( in verifyLoadedModule()
188 StripDebugInfo(TheModule); in verifyLoadedModule()
216 crossImportIntoModule(Module &TheModule, const ModuleSummaryIndex &Index, in crossImportIntoModule() argument
222 return loadModuleFromInput(Input, TheModule.getContext(), in crossImportIntoModule()
227 Expected<bool> Result = Importer.importFunctions(TheModule, ImportList); in crossImportIntoModule()
230 SMDiagnostic Err = SMDiagnostic(TheModule.getModuleIdentifier(), in crossImportIntoModule()
237 verifyLoadedModule(TheModule); in crossImportIntoModule()
240 static void optimizeModule(Module &TheModule, TargetMachine &TM, in optimizeModule() argument
250 StandardInstrumentations SI(TheModule.getContext(), DebugPassManager); in optimizeModule()
293 MPM.run(TheModule, MAM); in optimizeModule()
329 std::unique_ptr<MemoryBuffer> codegenModule(Module &TheModule, in codegenModule() argument
348 PM.run(TheModule); in codegenModule()
433 ProcessThinLTOModule(Module &TheModule, ModuleSummaryIndex &Index, in ProcessThinLTOModule() argument
451 TheModule.getPIELevel() == PIELevel::Default; in ProcessThinLTOModule()
454 promoteModule(TheModule, Index, ClearDSOLocalOnDeclarations); in ProcessThinLTOModule()
457 thinLTOFinalizeInModule(TheModule, DefinedGlobals, /*PropagateAttrs=*/true); in ProcessThinLTOModule()
460 saveTempBitcode(TheModule, SaveTempsDir, count, ".1.promoted.bc"); in ProcessThinLTOModule()
467 thinLTOInternalizeModule(TheModule, DefinedGlobals); in ProcessThinLTOModule()
471 saveTempBitcode(TheModule, SaveTempsDir, count, ".2.internalized.bc"); in ProcessThinLTOModule()
474 crossImportIntoModule(TheModule, Index, ModuleMap, ImportList, in ProcessThinLTOModule()
480 updatePublicTypeTestCalls(TheModule, in ProcessThinLTOModule()
484 saveTempBitcode(TheModule, SaveTempsDir, count, ".3.imported.bc"); in ProcessThinLTOModule()
486 optimizeModule(TheModule, TM, OptLevel, Freestanding, DebugPassManager, in ProcessThinLTOModule()
489 saveTempBitcode(TheModule, SaveTempsDir, count, ".4.opt.bc"); in ProcessThinLTOModule()
496 ProfileSummaryInfo PSI(TheModule); in ProcessThinLTOModule()
497 auto Index = buildModuleSummaryIndex(TheModule, nullptr, &PSI); in ProcessThinLTOModule()
498 WriteBitcodeToFile(TheModule, OS, true, &Index); in ProcessThinLTOModule()
504 return codegenModule(TheModule, TM); in ProcessThinLTOModule()
676 void ThinLTOCodeGenerator::promote(Module &TheModule, ModuleSummaryIndex &Index, in promote() argument
679 auto ModuleIdentifier = TheModule.getModuleIdentifier(); in promote()
687 File, PreservedSymbols, Triple(TheModule.getTargetTriple())); in promote()
711 thinLTOFinalizeInModule(TheModule, in promote()
722 promoteModule(TheModule, Index, /*ClearDSOLocalOnDeclarations=*/false); in promote()
728 void ThinLTOCodeGenerator::crossModuleImport(Module &TheModule, in crossModuleImport() argument
740 File, PreservedSymbols, Triple(TheModule.getTargetTriple())); in crossModuleImport()
757 auto &ImportList = ImportLists[TheModule.getModuleIdentifier()]; in crossModuleImport()
760 crossImportIntoModule(TheModule, Index, ModuleMap, ImportList, in crossModuleImport()
768 Module &TheModule, ModuleSummaryIndex &Index, in gatherImportedSummariesForModule() argument
772 auto ModuleIdentifier = TheModule.getModuleIdentifier(); in gatherImportedSummariesForModule()
780 File, PreservedSymbols, Triple(TheModule.getTargetTriple())); in gatherImportedSummariesForModule()
806 void ThinLTOCodeGenerator::emitImports(Module &TheModule, StringRef OutputName, in emitImports() argument
810 auto ModuleIdentifier = TheModule.getModuleIdentifier(); in emitImports()
818 File, PreservedSymbols, Triple(TheModule.getTargetTriple())); in emitImports()
856 void ThinLTOCodeGenerator::internalize(Module &TheModule, in internalize() argument
859 initTMBuilder(TMBuilder, Triple(TheModule.getTargetTriple())); in internalize()
861 auto ModuleIdentifier = TheModule.getModuleIdentifier(); in internalize()
905 promoteModule(TheModule, Index, /*ClearDSOLocalOnDeclarations=*/false); in internalize()
908 thinLTOFinalizeInModule(TheModule, in internalize()
912 thinLTOInternalizeModule(TheModule, in internalize()
919 void ThinLTOCodeGenerator::optimize(Module &TheModule) { in optimize() argument
920 initTMBuilder(TMBuilder, Triple(TheModule.getTargetTriple())); in optimize()
923 optimizeModule(TheModule, *TMBuilder.create(), OptLevel, Freestanding, in optimize()
996 auto TheModule = loadModuleFromInput(Mod.get(), Context, false, in run() local
1000 auto OutputBuffer = codegenModule(*TheModule, *TMBuilder.create()); in run()
1181 auto TheModule = loadModuleFromInput(Mod.get(), Context, false, in run() local
1185 saveTempBitcode(*TheModule, SaveTempsDir, count, ".0.original.bc"); in run()
1190 *TheModule, *Index, ModuleMap, *TMBuilder.create(), ImportList, in run()