Lines Matching refs:Mod

237 static void runNewPMPasses(const Config &Conf, Module &Mod, TargetMachine *TM,  in runNewPMPasses()  argument
268 StandardInstrumentations SI(Mod.getContext(), Conf.DebugPassManager, in runNewPMPasses()
340 MPM.run(Mod, MAM); in runNewPMPasses()
343 bool lto::opt(const Config &Conf, TargetMachine *TM, unsigned Task, Module &Mod, in opt() argument
360 llvm::embedBitcodeInModule(Mod, llvm::MemoryBufferRef(), in opt()
365 runNewPMPasses(Conf, Mod, TM, Conf.OptLevel, IsThinLTO, ExportSummary, in opt()
367 return !Conf.PostOptModuleHook || Conf.PostOptModuleHook(Task, Mod); in opt()
371 AddStreamFn AddStream, unsigned Task, Module &Mod, in codegen() argument
373 if (Conf.PreCodeGenModuleHook && !Conf.PreCodeGenModuleHook(Task, Mod)) in codegen()
377 llvm::embedBitcodeInModule(Mod, llvm::MemoryBufferRef(), in codegen()
405 AddStream(Task, Mod.getModuleIdentifier()); in codegen()
412 TargetLibraryInfoImpl TLII(Triple(Mod.getTargetTriple())); in codegen()
422 CodeGenPasses.run(Mod); in codegen()
430 unsigned ParallelCodeGenParallelismLevel, Module &Mod, in splitCodeGen() argument
438 Mod, ParallelCodeGenParallelismLevel, in splitCodeGen()
480 Module &Mod) { in initAndLookupTarget() argument
482 Mod.setTargetTriple(C.OverrideTriple); in initAndLookupTarget()
483 else if (Mod.getTargetTriple().empty()) in initAndLookupTarget()
484 Mod.setTargetTriple(C.DefaultTriple); in initAndLookupTarget()
487 const Target *T = TargetRegistry::lookupTarget(Mod.getTargetTriple(), Msg); in initAndLookupTarget()
505 unsigned ParallelCodeGenParallelismLevel, Module &Mod, in backend() argument
507 Expected<const Target *> TOrErr = initAndLookupTarget(C, Mod); in backend()
511 std::unique_ptr<TargetMachine> TM = createTargetMachine(C, *TOrErr, Mod); in backend()
515 if (!opt(C, TM.get(), 0, Mod, /*IsThinLTO=*/false, in backend()
522 codegen(C, TM.get(), AddStream, 0, Mod, CombinedIndex); in backend()
524 splitCodeGen(C, TM.get(), AddStream, ParallelCodeGenParallelismLevel, Mod, in backend()
530 static void dropDeadSymbols(Module &Mod, const GVSummaryMapTy &DefinedGlobals, in dropDeadSymbols() argument
533 for (auto &GV : Mod.global_values()) in dropDeadSymbols()
552 Module &Mod, const ModuleSummaryIndex &CombinedIndex, in thinBackend() argument
557 Expected<const Target *> TOrErr = initAndLookupTarget(Conf, Mod); in thinBackend()
561 std::unique_ptr<TargetMachine> TM = createTargetMachine(Conf, *TOrErr, Mod); in thinBackend()
565 Mod.getContext(), Conf.RemarksFilename, Conf.RemarksPasses, in thinBackend()
574 Mod.setPartialSampleProfileRatio(CombinedIndex); in thinBackend()
578 codegen(Conf, TM.get(), AddStream, Task, Mod, CombinedIndex); in thinBackend()
582 if (Conf.PreOptModuleHook && !Conf.PreOptModuleHook(Task, Mod)) in thinBackend()
586 [&](Module &Mod, TargetMachine *TM, in thinBackend()
588 if (!opt(Conf, TM, Task, Mod, /*IsThinLTO=*/true, in thinBackend()
593 codegen(Conf, TM, AddStream, Task, Mod, CombinedIndex); in thinBackend()
598 return OptimizeAndCodegen(Mod, TM.get(), std::move(DiagnosticOutputFile)); in thinBackend()
605 Mod.getPIELevel() == PIELevel::Default; in thinBackend()
606 renameModuleForThinLTO(Mod, CombinedIndex, ClearDSOLocalOnDeclarations); in thinBackend()
608 dropDeadSymbols(Mod, DefinedGlobals, CombinedIndex); in thinBackend()
610 thinLTOFinalizeInModule(Mod, DefinedGlobals, /*PropagateAttrs=*/true); in thinBackend()
612 if (Conf.PostPromoteModuleHook && !Conf.PostPromoteModuleHook(Task, Mod)) in thinBackend()
616 thinLTOInternalizeModule(Mod, DefinedGlobals); in thinBackend()
619 !Conf.PostInternalizeModuleHook(Task, Mod)) in thinBackend()
623 assert(Mod.getContext().isODRUniquingDebugTypes() && in thinBackend()
628 return I->second.getLazyModule(Mod.getContext(), in thinBackend()
648 BMOrErr->getLazyModule(Mod.getContext(), in thinBackend()
658 if (Error Err = Importer.importFunctions(Mod, ImportList).takeError()) in thinBackend()
662 updateMemProfAttributes(Mod, CombinedIndex); in thinBackend()
663 updatePublicTypeTestCalls(Mod, CombinedIndex.withWholeProgramVisibility()); in thinBackend()
665 if (Conf.PostImportModuleHook && !Conf.PostImportModuleHook(Task, Mod)) in thinBackend()
668 return OptimizeAndCodegen(Mod, TM.get(), std::move(DiagnosticOutputFile)); in thinBackend()