Lines Matching refs:TheModule
76 static void saveTempBitcode(const Module &TheModule, StringRef TempDir, in saveTempBitcode() argument
87 WriteBitcodeToFile(&TheModule, OS, /* ShouldPreserveUseListOrder */ true); in saveTempBitcode()
142 static void promoteModule(Module &TheModule, const ModuleSummaryIndex &Index) { in promoteModule() argument
143 if (renameModuleForThinLTO(TheModule, Index)) in promoteModule()
148 crossImportIntoModule(Module &TheModule, const ModuleSummaryIndex &Index, in crossImportIntoModule() argument
151 ModuleLoader Loader(TheModule.getContext(), ModuleMap); in crossImportIntoModule()
153 Importer.importFunctions(TheModule, ImportList); in crossImportIntoModule()
156 static void optimizeModule(Module &TheModule, TargetMachine &TM) { in optimizeModule() argument
177 PM.run(TheModule); in optimizeModule()
194 std::unique_ptr<MemoryBuffer> codegenModule(Module &TheModule, in codegenModule() argument
213 PM.run(TheModule); in codegenModule()
331 ProcessThinLTOModule(Module &TheModule, ModuleSummaryIndex &Index, in ProcessThinLTOModule() argument
345 promoteModule(TheModule, Index); in ProcessThinLTOModule()
348 thinLTOResolveWeakForLinkerModule(TheModule, DefinedGlobals); in ProcessThinLTOModule()
351 saveTempBitcode(TheModule, SaveTempsDir, count, ".1.promoted.bc"); in ProcessThinLTOModule()
358 thinLTOInternalizeModule(TheModule, DefinedGlobals); in ProcessThinLTOModule()
362 saveTempBitcode(TheModule, SaveTempsDir, count, ".2.internalized.bc"); in ProcessThinLTOModule()
365 crossImportIntoModule(TheModule, Index, ModuleMap, ImportList); in ProcessThinLTOModule()
368 saveTempBitcode(TheModule, SaveTempsDir, count, ".3.imported.bc"); in ProcessThinLTOModule()
371 optimizeModule(TheModule, TM); in ProcessThinLTOModule()
373 saveTempBitcode(TheModule, SaveTempsDir, count, ".4.opt.bc"); in ProcessThinLTOModule()
380 ModuleSummaryIndexBuilder IndexBuilder(&TheModule); in ProcessThinLTOModule()
381 WriteBitcodeToFile(&TheModule, OS, true, &IndexBuilder.getIndex()); in ProcessThinLTOModule()
386 return codegenModule(TheModule, TM); in ProcessThinLTOModule()
516 void ThinLTOCodeGenerator::promote(Module &TheModule, in promote() argument
519 auto ModuleIdentifier = TheModule.getModuleIdentifier(); in promote()
535 TheModule, ModuleToDefinedGVSummaries[ModuleIdentifier]); in promote()
537 promoteModule(TheModule, Index); in promote()
543 void ThinLTOCodeGenerator::crossModuleImport(Module &TheModule, in crossModuleImport() argument
557 auto &ImportList = ImportLists[TheModule.getModuleIdentifier()]; in crossModuleImport()
559 crossImportIntoModule(TheModule, Index, ModuleMap, ImportList); in crossModuleImport()
612 void ThinLTOCodeGenerator::internalize(Module &TheModule, in internalize() argument
614 initTMBuilder(TMBuilder, Triple(TheModule.getTargetTriple())); in internalize()
616 auto ModuleIdentifier = TheModule.getModuleIdentifier(); in internalize()
646 thinLTOInternalizeModule(TheModule, in internalize()
653 void ThinLTOCodeGenerator::optimize(Module &TheModule) { in optimize() argument
654 initTMBuilder(TMBuilder, Triple(TheModule.getTargetTriple())); in optimize()
657 optimizeModule(TheModule, *TMBuilder.create()); in optimize()
663 std::unique_ptr<MemoryBuffer> ThinLTOCodeGenerator::codegen(Module &TheModule) { in codegen() argument
664 initTMBuilder(TMBuilder, Triple(TheModule.getTargetTriple())); in codegen()
665 return codegenModule(TheModule, *TMBuilder.create()); in codegen()
682 auto TheModule = loadModuleFromBuffer(ModuleBuffer, Context, false); in run() local
685 ProducedBinaries[count] = codegen(*TheModule); in run()
807 auto TheModule = loadModuleFromBuffer(ModuleBuffer, Context, false); in run() local
810 saveTempBitcode(*TheModule, SaveTempsDir, count, ".0.original.bc"); in run()
815 *TheModule, *Index, ModuleMap, *TMBuilder.create(), ImportList, in run()