Lines Matching refs:TheModule

95 static void saveTempBitcode(const Module &TheModule, StringRef TempDir,  in saveTempBitcode()  argument
106 WriteBitcodeToFile(TheModule, OS, /* ShouldPreserveUseListOrder */ true); in saveTempBitcode()
161 static void promoteModule(Module &TheModule, const ModuleSummaryIndex &Index, in promoteModule() argument
163 if (renameModuleForThinLTO(TheModule, Index, ClearDSOLocalOnDeclarations)) in promoteModule()
179 static void verifyLoadedModule(Module &TheModule) { in verifyLoadedModule() argument
181 if (verifyModule(TheModule, &dbgs(), &BrokenDebugInfo)) in verifyLoadedModule()
184 TheModule.getContext().diagnose(ThinLTODiagnosticInfo( in verifyLoadedModule()
186 StripDebugInfo(TheModule); in verifyLoadedModule()
214 crossImportIntoModule(Module &TheModule, const ModuleSummaryIndex &Index, in crossImportIntoModule() argument
220 return loadModuleFromInput(Input, TheModule.getContext(), in crossImportIntoModule()
225 Expected<bool> Result = Importer.importFunctions(TheModule, ImportList); in crossImportIntoModule()
228 SMDiagnostic Err = SMDiagnostic(TheModule.getModuleIdentifier(), in crossImportIntoModule()
235 verifyLoadedModule(TheModule); in crossImportIntoModule()
238 static void optimizeModule(Module &TheModule, TargetMachine &TM, in optimizeModule() argument
265 PM.run(TheModule); in optimizeModule()
268 static void optimizeModuleNewPM(Module &TheModule, TargetMachine &TM, in optimizeModuleNewPM() argument
327 MPM.run(TheModule, MAM); in optimizeModuleNewPM()
363 std::unique_ptr<MemoryBuffer> codegenModule(Module &TheModule, in codegenModule() argument
382 PM.run(TheModule); in codegenModule()
481 ProcessThinLTOModule(Module &TheModule, ModuleSummaryIndex &Index, in ProcessThinLTOModule() argument
500 TheModule.getPIELevel() == PIELevel::Default; in ProcessThinLTOModule()
503 promoteModule(TheModule, Index, ClearDSOLocalOnDeclarations); in ProcessThinLTOModule()
506 thinLTOResolvePrevailingInModule(TheModule, DefinedGlobals); in ProcessThinLTOModule()
509 saveTempBitcode(TheModule, SaveTempsDir, count, ".1.promoted.bc"); in ProcessThinLTOModule()
516 thinLTOInternalizeModule(TheModule, DefinedGlobals); in ProcessThinLTOModule()
520 saveTempBitcode(TheModule, SaveTempsDir, count, ".2.internalized.bc"); in ProcessThinLTOModule()
523 crossImportIntoModule(TheModule, Index, ModuleMap, ImportList, in ProcessThinLTOModule()
527 saveTempBitcode(TheModule, SaveTempsDir, count, ".3.imported.bc"); in ProcessThinLTOModule()
531 optimizeModuleNewPM(TheModule, TM, OptLevel, Freestanding, DebugPassManager, in ProcessThinLTOModule()
534 optimizeModule(TheModule, TM, OptLevel, Freestanding, &Index); in ProcessThinLTOModule()
536 saveTempBitcode(TheModule, SaveTempsDir, count, ".4.opt.bc"); in ProcessThinLTOModule()
543 ProfileSummaryInfo PSI(TheModule); in ProcessThinLTOModule()
544 auto Index = buildModuleSummaryIndex(TheModule, nullptr, &PSI); in ProcessThinLTOModule()
545 WriteBitcodeToFile(TheModule, OS, true, &Index); in ProcessThinLTOModule()
550 return codegenModule(TheModule, TM); in ProcessThinLTOModule()
732 void ThinLTOCodeGenerator::promote(Module &TheModule, ModuleSummaryIndex &Index, in promote() argument
735 auto ModuleIdentifier = TheModule.getModuleIdentifier(); in promote()
743 File, PreservedSymbols, Triple(TheModule.getTargetTriple())); in promote()
766 TheModule, ModuleToDefinedGVSummaries[ModuleIdentifier]); in promote()
775 promoteModule(TheModule, Index, /*ClearDSOLocalOnDeclarations=*/false); in promote()
781 void ThinLTOCodeGenerator::crossModuleImport(Module &TheModule, in crossModuleImport() argument
793 File, PreservedSymbols, Triple(TheModule.getTargetTriple())); in crossModuleImport()
805 auto &ImportList = ImportLists[TheModule.getModuleIdentifier()]; in crossModuleImport()
808 crossImportIntoModule(TheModule, Index, ModuleMap, ImportList, in crossModuleImport()
816 Module &TheModule, ModuleSummaryIndex &Index, in gatherImportedSummariesForModule() argument
820 auto ModuleIdentifier = TheModule.getModuleIdentifier(); in gatherImportedSummariesForModule()
828 File, PreservedSymbols, Triple(TheModule.getTargetTriple())); in gatherImportedSummariesForModule()
849 void ThinLTOCodeGenerator::emitImports(Module &TheModule, StringRef OutputName, in emitImports() argument
853 auto ModuleIdentifier = TheModule.getModuleIdentifier(); in emitImports()
861 File, PreservedSymbols, Triple(TheModule.getTargetTriple())); in emitImports()
890 void ThinLTOCodeGenerator::internalize(Module &TheModule, in internalize() argument
893 initTMBuilder(TMBuilder, Triple(TheModule.getTargetTriple())); in internalize()
895 auto ModuleIdentifier = TheModule.getModuleIdentifier(); in internalize()
937 promoteModule(TheModule, Index, /*ClearDSOLocalOnDeclarations=*/false); in internalize()
941 TheModule, ModuleToDefinedGVSummaries[ModuleIdentifier]); in internalize()
943 thinLTOInternalizeModule(TheModule, in internalize()
950 void ThinLTOCodeGenerator::optimize(Module &TheModule) { in optimize() argument
951 initTMBuilder(TMBuilder, Triple(TheModule.getTargetTriple())); in optimize()
954 optimizeModule(TheModule, *TMBuilder.create(), OptLevel, Freestanding, in optimize()
1022 auto TheModule = loadModuleFromInput(Mod.get(), Context, false, in run() local
1026 auto OutputBuffer = codegenModule(*TheModule, *TMBuilder.create()); in run()
1193 auto TheModule = loadModuleFromInput(Mod.get(), Context, false, in run() local
1197 saveTempBitcode(*TheModule, SaveTempsDir, count, ".0.original.bc"); in run()
1202 *TheModule, *Index, ModuleMap, *TMBuilder.create(), ImportList, in run()