Lines Matching refs:Mod

233 static void runNewPMPasses(const Config &Conf, Module &Mod, TargetMachine *TM,  in runNewPMPasses()  argument
268 StandardInstrumentations SI(Mod.getContext(), Conf.DebugPassManager, in runNewPMPasses()
338 MPM.run(Mod, MAM); in runNewPMPasses()
341 bool lto::opt(const Config &Conf, TargetMachine *TM, unsigned Task, Module &Mod, in opt() argument
358 llvm::embedBitcodeInModule(Mod, llvm::MemoryBufferRef(), in opt()
363 runNewPMPasses(Conf, Mod, TM, Conf.OptLevel, IsThinLTO, ExportSummary, in opt()
365 return !Conf.PostOptModuleHook || Conf.PostOptModuleHook(Task, Mod); in opt()
369 AddStreamFn AddStream, unsigned Task, Module &Mod, in codegen() argument
371 if (Conf.PreCodeGenModuleHook && !Conf.PreCodeGenModuleHook(Task, Mod)) in codegen()
375 llvm::embedBitcodeInModule(Mod, llvm::MemoryBufferRef(), in codegen()
403 AddStream(Task, Mod.getModuleIdentifier()); in codegen()
410 TargetLibraryInfoImpl TLII(Triple(Mod.getTargetTriple())); in codegen()
420 CodeGenPasses.run(Mod); in codegen()
428 unsigned ParallelCodeGenParallelismLevel, Module &Mod, in splitCodeGen() argument
469 if (!TM->splitModule(Mod, ParallelCodeGenParallelismLevel, in splitCodeGen()
471 SplitModule(Mod, ParallelCodeGenParallelismLevel, HandleModulePartition, in splitCodeGen()
482 Module &Mod) { in initAndLookupTarget() argument
484 Mod.setTargetTriple(C.OverrideTriple); in initAndLookupTarget()
485 else if (Mod.getTargetTriple().empty()) in initAndLookupTarget()
486 Mod.setTargetTriple(C.DefaultTriple); in initAndLookupTarget()
489 const Target *T = TargetRegistry::lookupTarget(Mod.getTargetTriple(), Msg); in initAndLookupTarget()
507 unsigned ParallelCodeGenParallelismLevel, Module &Mod, in backend() argument
509 Expected<const Target *> TOrErr = initAndLookupTarget(C, Mod); in backend()
513 std::unique_ptr<TargetMachine> TM = createTargetMachine(C, *TOrErr, Mod); in backend()
517 if (!opt(C, TM.get(), 0, Mod, /*IsThinLTO=*/false, in backend()
524 codegen(C, TM.get(), AddStream, 0, Mod, CombinedIndex); in backend()
526 splitCodeGen(C, TM.get(), AddStream, ParallelCodeGenParallelismLevel, Mod, in backend()
532 static void dropDeadSymbols(Module &Mod, const GVSummaryMapTy &DefinedGlobals, in dropDeadSymbols() argument
535 for (auto &GV : Mod.global_values()) in dropDeadSymbols()
554 Module &Mod, const ModuleSummaryIndex &CombinedIndex, in thinBackend() argument
559 Expected<const Target *> TOrErr = initAndLookupTarget(Conf, Mod); in thinBackend()
563 std::unique_ptr<TargetMachine> TM = createTargetMachine(Conf, *TOrErr, Mod); in thinBackend()
567 Mod.getContext(), Conf.RemarksFilename, Conf.RemarksPasses, in thinBackend()
576 Mod.setPartialSampleProfileRatio(CombinedIndex); in thinBackend()
580 codegen(Conf, TM.get(), AddStream, Task, Mod, CombinedIndex); in thinBackend()
584 if (Conf.PreOptModuleHook && !Conf.PreOptModuleHook(Task, Mod)) in thinBackend()
588 [&](Module &Mod, TargetMachine *TM, in thinBackend()
590 if (!opt(Conf, TM, Task, Mod, /*IsThinLTO=*/true, in thinBackend()
595 codegen(Conf, TM, AddStream, Task, Mod, CombinedIndex); in thinBackend()
600 return OptimizeAndCodegen(Mod, TM.get(), std::move(DiagnosticOutputFile)); in thinBackend()
607 Mod.getPIELevel() == PIELevel::Default; in thinBackend()
608 renameModuleForThinLTO(Mod, CombinedIndex, ClearDSOLocalOnDeclarations); in thinBackend()
610 dropDeadSymbols(Mod, DefinedGlobals, CombinedIndex); in thinBackend()
612 thinLTOFinalizeInModule(Mod, DefinedGlobals, /*PropagateAttrs=*/true); in thinBackend()
614 if (Conf.PostPromoteModuleHook && !Conf.PostPromoteModuleHook(Task, Mod)) in thinBackend()
618 thinLTOInternalizeModule(Mod, DefinedGlobals); in thinBackend()
621 !Conf.PostInternalizeModuleHook(Task, Mod)) in thinBackend()
625 assert(Mod.getContext().isODRUniquingDebugTypes() && in thinBackend()
630 return I->second.getLazyModule(Mod.getContext(), in thinBackend()
650 BMOrErr->getLazyModule(Mod.getContext(), in thinBackend()
660 if (Error Err = Importer.importFunctions(Mod, ImportList).takeError()) in thinBackend()
664 updateMemProfAttributes(Mod, CombinedIndex); in thinBackend()
665 updatePublicTypeTestCalls(Mod, CombinedIndex.withWholeProgramVisibility()); in thinBackend()
667 if (Conf.PostImportModuleHook && !Conf.PostImportModuleHook(Task, Mod)) in thinBackend()
670 return OptimizeAndCodegen(Mod, TM.get(), std::move(DiagnosticOutputFile)); in thinBackend()