Lines Matching refs:TheModule
94 static void saveTempBitcode(const Module &TheModule, StringRef TempDir, in saveTempBitcode() argument
105 WriteBitcodeToFile(TheModule, OS, /* ShouldPreserveUseListOrder */ true); in saveTempBitcode()
160 static void promoteModule(Module &TheModule, const ModuleSummaryIndex &Index, in promoteModule() argument
162 if (renameModuleForThinLTO(TheModule, Index, ClearDSOLocalOnDeclarations)) in promoteModule()
178 static void verifyLoadedModule(Module &TheModule) { in verifyLoadedModule() argument
180 if (verifyModule(TheModule, &dbgs(), &BrokenDebugInfo)) in verifyLoadedModule()
183 TheModule.getContext().diagnose(ThinLTODiagnosticInfo( in verifyLoadedModule()
185 StripDebugInfo(TheModule); in verifyLoadedModule()
213 crossImportIntoModule(Module &TheModule, const ModuleSummaryIndex &Index, in crossImportIntoModule() argument
219 return loadModuleFromInput(Input, TheModule.getContext(), in crossImportIntoModule()
224 Expected<bool> Result = Importer.importFunctions(TheModule, ImportList); in crossImportIntoModule()
227 SMDiagnostic Err = SMDiagnostic(TheModule.getModuleIdentifier(), in crossImportIntoModule()
234 verifyLoadedModule(TheModule); in crossImportIntoModule()
237 static void optimizeModule(Module &TheModule, TargetMachine &TM, in optimizeModule() argument
290 MPM.run(TheModule, MAM); in optimizeModule()
326 std::unique_ptr<MemoryBuffer> codegenModule(Module &TheModule, in codegenModule() argument
345 PM.run(TheModule); in codegenModule()
445 ProcessThinLTOModule(Module &TheModule, ModuleSummaryIndex &Index, in ProcessThinLTOModule() argument
457 updatePublicTypeTestCalls(TheModule, in ProcessThinLTOModule()
468 TheModule.getPIELevel() == PIELevel::Default; in ProcessThinLTOModule()
471 promoteModule(TheModule, Index, ClearDSOLocalOnDeclarations); in ProcessThinLTOModule()
474 thinLTOFinalizeInModule(TheModule, DefinedGlobals, /*PropagateAttrs=*/true); in ProcessThinLTOModule()
477 saveTempBitcode(TheModule, SaveTempsDir, count, ".1.promoted.bc"); in ProcessThinLTOModule()
484 thinLTOInternalizeModule(TheModule, DefinedGlobals); in ProcessThinLTOModule()
488 saveTempBitcode(TheModule, SaveTempsDir, count, ".2.internalized.bc"); in ProcessThinLTOModule()
491 crossImportIntoModule(TheModule, Index, ModuleMap, ImportList, in ProcessThinLTOModule()
495 saveTempBitcode(TheModule, SaveTempsDir, count, ".3.imported.bc"); in ProcessThinLTOModule()
498 optimizeModule(TheModule, TM, OptLevel, Freestanding, DebugPassManager, in ProcessThinLTOModule()
501 saveTempBitcode(TheModule, SaveTempsDir, count, ".4.opt.bc"); in ProcessThinLTOModule()
508 ProfileSummaryInfo PSI(TheModule); in ProcessThinLTOModule()
509 auto Index = buildModuleSummaryIndex(TheModule, nullptr, &PSI); in ProcessThinLTOModule()
510 WriteBitcodeToFile(TheModule, OS, true, &Index); in ProcessThinLTOModule()
516 return codegenModule(TheModule, TM); in ProcessThinLTOModule()
698 void ThinLTOCodeGenerator::promote(Module &TheModule, ModuleSummaryIndex &Index, in promote() argument
701 auto ModuleIdentifier = TheModule.getModuleIdentifier(); in promote()
709 File, PreservedSymbols, Triple(TheModule.getTargetTriple())); in promote()
731 thinLTOFinalizeInModule(TheModule, in promote()
742 promoteModule(TheModule, Index, /*ClearDSOLocalOnDeclarations=*/false); in promote()
748 void ThinLTOCodeGenerator::crossModuleImport(Module &TheModule, in crossModuleImport() argument
760 File, PreservedSymbols, Triple(TheModule.getTargetTriple())); in crossModuleImport()
772 auto &ImportList = ImportLists[TheModule.getModuleIdentifier()]; in crossModuleImport()
775 crossImportIntoModule(TheModule, Index, ModuleMap, ImportList, in crossModuleImport()
783 Module &TheModule, ModuleSummaryIndex &Index, in gatherImportedSummariesForModule() argument
787 auto ModuleIdentifier = TheModule.getModuleIdentifier(); in gatherImportedSummariesForModule()
795 File, PreservedSymbols, Triple(TheModule.getTargetTriple())); in gatherImportedSummariesForModule()
816 void ThinLTOCodeGenerator::emitImports(Module &TheModule, StringRef OutputName, in emitImports() argument
820 auto ModuleIdentifier = TheModule.getModuleIdentifier(); in emitImports()
828 File, PreservedSymbols, Triple(TheModule.getTargetTriple())); in emitImports()
857 void ThinLTOCodeGenerator::internalize(Module &TheModule, in internalize() argument
860 initTMBuilder(TMBuilder, Triple(TheModule.getTargetTriple())); in internalize()
862 auto ModuleIdentifier = TheModule.getModuleIdentifier(); in internalize()
904 promoteModule(TheModule, Index, /*ClearDSOLocalOnDeclarations=*/false); in internalize()
907 thinLTOFinalizeInModule(TheModule, in internalize()
911 thinLTOInternalizeModule(TheModule, in internalize()
918 void ThinLTOCodeGenerator::optimize(Module &TheModule) { in optimize() argument
919 initTMBuilder(TMBuilder, Triple(TheModule.getTargetTriple())); in optimize()
922 optimizeModule(TheModule, *TMBuilder.create(), OptLevel, Freestanding, in optimize()
995 auto TheModule = loadModuleFromInput(Mod.get(), Context, false, in run() local
999 auto OutputBuffer = codegenModule(*TheModule, *TMBuilder.create()); in run()
1175 auto TheModule = loadModuleFromInput(Mod.get(), Context, false, in run() local
1179 saveTempBitcode(*TheModule, SaveTempsDir, count, ".0.original.bc"); in run()
1184 *TheModule, *Index, ModuleMap, *TMBuilder.create(), ImportList, in run()