Lines Matching defs:TheModule

94 static void saveTempBitcode(const Module &TheModule, StringRef TempDir,
105 WriteBitcodeToFile(TheModule, OS, /* ShouldPreserveUseListOrder */ true);
161 static void promoteModule(Module &TheModule, const ModuleSummaryIndex &Index,
163 renameModuleForThinLTO(TheModule, Index, ClearDSOLocalOnDeclarations);
178 static void verifyLoadedModule(Module &TheModule) {
180 if (verifyModule(TheModule, &dbgs(), &BrokenDebugInfo))
183 TheModule.getContext().diagnose(ThinLTODiagnosticInfo(
185 StripDebugInfo(TheModule);
213 crossImportIntoModule(Module &TheModule, const ModuleSummaryIndex &Index,
219 return loadModuleFromInput(Input, TheModule.getContext(),
224 Expected<bool> Result = Importer.importFunctions(TheModule, ImportList);
227 SMDiagnostic Err = SMDiagnostic(TheModule.getModuleIdentifier(),
234 verifyLoadedModule(TheModule);
237 static void optimizeModule(Module &TheModule, TargetMachine &TM,
247 StandardInstrumentations SI(TheModule.getContext(), DebugPassManager);
290 MPM.run(TheModule, MAM);
326 static std::unique_ptr<MemoryBuffer> codegenModule(Module &TheModule,
341 PM.run(TheModule);
428 ProcessThinLTOModule(Module &TheModule, ModuleSummaryIndex &Index,
446 TheModule.getPIELevel() == PIELevel::Default;
449 promoteModule(TheModule, Index, ClearDSOLocalOnDeclarations);
452 thinLTOFinalizeInModule(TheModule, DefinedGlobals, /*PropagateAttrs=*/true);
455 saveTempBitcode(TheModule, SaveTempsDir, count, ".1.promoted.bc");
462 thinLTOInternalizeModule(TheModule, DefinedGlobals);
466 saveTempBitcode(TheModule, SaveTempsDir, count, ".2.internalized.bc");
469 crossImportIntoModule(TheModule, Index, ModuleMap, ImportList,
475 updatePublicTypeTestCalls(TheModule,
479 saveTempBitcode(TheModule, SaveTempsDir, count, ".3.imported.bc");
481 optimizeModule(TheModule, TM, OptLevel, Freestanding, DebugPassManager,
484 saveTempBitcode(TheModule, SaveTempsDir, count, ".4.opt.bc");
491 ProfileSummaryInfo PSI(TheModule);
492 auto Index = buildModuleSummaryIndex(TheModule, nullptr, &PSI);
493 WriteBitcodeToFile(TheModule, OS, true, &Index);
499 return codegenModule(TheModule, TM);
669 void ThinLTOCodeGenerator::promote(Module &TheModule, ModuleSummaryIndex &Index,
672 auto ModuleIdentifier = TheModule.getModuleIdentifier();
680 File, PreservedSymbols, Triple(TheModule.getTargetTriple()));
704 thinLTOFinalizeInModule(TheModule,
715 promoteModule(TheModule, Index, /*ClearDSOLocalOnDeclarations=*/false);
721 void ThinLTOCodeGenerator::crossModuleImport(Module &TheModule,
733 File, PreservedSymbols, Triple(TheModule.getTargetTriple()));
750 auto &ImportList = ImportLists[TheModule.getModuleIdentifier()];
753 crossImportIntoModule(TheModule, Index, ModuleMap, ImportList,
761 Module &TheModule, ModuleSummaryIndex &Index,
765 auto ModuleIdentifier = TheModule.getModuleIdentifier();
773 File, PreservedSymbols, Triple(TheModule.getTargetTriple()));
799 void ThinLTOCodeGenerator::emitImports(Module &TheModule, StringRef OutputName,
803 auto ModuleIdentifier = TheModule.getModuleIdentifier();
811 File, PreservedSymbols, Triple(TheModule.getTargetTriple()));
848 void ThinLTOCodeGenerator::internalize(Module &TheModule,
851 initTMBuilder(TMBuilder, Triple(TheModule.getTargetTriple()));
853 auto ModuleIdentifier = TheModule.getModuleIdentifier();
897 promoteModule(TheModule, Index, /*ClearDSOLocalOnDeclarations=*/false);
900 thinLTOFinalizeInModule(TheModule,
904 thinLTOInternalizeModule(TheModule,
911 void ThinLTOCodeGenerator::optimize(Module &TheModule) {
912 initTMBuilder(TMBuilder, Triple(TheModule.getTargetTriple()));
915 optimizeModule(TheModule, *TMBuilder.create(), OptLevel, Freestanding,
988 auto TheModule = loadModuleFromInput(Mod.get(), Context, false,
992 auto OutputBuffer = codegenModule(*TheModule, *TMBuilder.create());
1170 auto TheModule = loadModuleFromInput(Mod.get(), Context, false,
1174 saveTempBitcode(*TheModule, SaveTempsDir, count, ".0.original.bc");
1179 *TheModule, *Index, ModuleMap, *TMBuilder.create(), ImportList,