Lines Matching refs:Mod
230 static void runNewPMPasses(const Config &Conf, Module &Mod, TargetMachine *TM, in runNewPMPasses() argument
330 MPM.run(Mod, MAM); in runNewPMPasses()
333 bool lto::opt(const Config &Conf, TargetMachine *TM, unsigned Task, Module &Mod, in opt() argument
350 llvm::embedBitcodeInModule(Mod, llvm::MemoryBufferRef(), in opt()
355 runNewPMPasses(Conf, Mod, TM, Conf.OptLevel, IsThinLTO, ExportSummary, in opt()
357 return !Conf.PostOptModuleHook || Conf.PostOptModuleHook(Task, Mod); in opt()
361 AddStreamFn AddStream, unsigned Task, Module &Mod, in codegen() argument
363 if (Conf.PreCodeGenModuleHook && !Conf.PreCodeGenModuleHook(Task, Mod)) in codegen()
367 llvm::embedBitcodeInModule(Mod, llvm::MemoryBufferRef(), in codegen()
401 TargetLibraryInfoImpl TLII(Triple(Mod.getTargetTriple())); in codegen()
411 CodeGenPasses.run(Mod); in codegen()
419 unsigned ParallelCodeGenParallelismLevel, Module &Mod, in splitCodeGen() argument
427 Mod, ParallelCodeGenParallelismLevel, in splitCodeGen()
469 Module &Mod) { in initAndLookupTarget() argument
471 Mod.setTargetTriple(C.OverrideTriple); in initAndLookupTarget()
472 else if (Mod.getTargetTriple().empty()) in initAndLookupTarget()
473 Mod.setTargetTriple(C.DefaultTriple); in initAndLookupTarget()
476 const Target *T = TargetRegistry::lookupTarget(Mod.getTargetTriple(), Msg); in initAndLookupTarget()
494 unsigned ParallelCodeGenParallelismLevel, Module &Mod, in backend() argument
496 Expected<const Target *> TOrErr = initAndLookupTarget(C, Mod); in backend()
500 std::unique_ptr<TargetMachine> TM = createTargetMachine(C, *TOrErr, Mod); in backend()
503 if (!opt(C, TM.get(), 0, Mod, /*IsThinLTO=*/false, in backend()
510 codegen(C, TM.get(), AddStream, 0, Mod, CombinedIndex); in backend()
512 splitCodeGen(C, TM.get(), AddStream, ParallelCodeGenParallelismLevel, Mod, in backend()
518 static void dropDeadSymbols(Module &Mod, const GVSummaryMapTy &DefinedGlobals, in dropDeadSymbols() argument
521 for (auto &GV : Mod.global_values()) in dropDeadSymbols()
540 Module &Mod, const ModuleSummaryIndex &CombinedIndex, in thinBackend() argument
545 Expected<const Target *> TOrErr = initAndLookupTarget(Conf, Mod); in thinBackend()
549 std::unique_ptr<TargetMachine> TM = createTargetMachine(Conf, *TOrErr, Mod); in thinBackend()
553 Mod.getContext(), Conf.RemarksFilename, Conf.RemarksPasses, in thinBackend()
562 Mod.setPartialSampleProfileRatio(CombinedIndex); in thinBackend()
564 updatePublicTypeTestCalls(Mod, CombinedIndex.withWholeProgramVisibility()); in thinBackend()
567 codegen(Conf, TM.get(), AddStream, Task, Mod, CombinedIndex); in thinBackend()
571 if (Conf.PreOptModuleHook && !Conf.PreOptModuleHook(Task, Mod)) in thinBackend()
575 [&](Module &Mod, TargetMachine *TM, in thinBackend()
577 if (!opt(Conf, TM, Task, Mod, /*IsThinLTO=*/true, in thinBackend()
582 codegen(Conf, TM, AddStream, Task, Mod, CombinedIndex); in thinBackend()
587 return OptimizeAndCodegen(Mod, TM.get(), std::move(DiagnosticOutputFile)); in thinBackend()
594 Mod.getPIELevel() == PIELevel::Default; in thinBackend()
595 renameModuleForThinLTO(Mod, CombinedIndex, ClearDSOLocalOnDeclarations); in thinBackend()
597 dropDeadSymbols(Mod, DefinedGlobals, CombinedIndex); in thinBackend()
599 thinLTOFinalizeInModule(Mod, DefinedGlobals, /*PropagateAttrs=*/true); in thinBackend()
601 if (Conf.PostPromoteModuleHook && !Conf.PostPromoteModuleHook(Task, Mod)) in thinBackend()
605 thinLTOInternalizeModule(Mod, DefinedGlobals); in thinBackend()
608 !Conf.PostInternalizeModuleHook(Task, Mod)) in thinBackend()
612 assert(Mod.getContext().isODRUniquingDebugTypes() && in thinBackend()
617 return I->second.getLazyModule(Mod.getContext(), in thinBackend()
637 BMOrErr->getLazyModule(Mod.getContext(), in thinBackend()
647 if (Error Err = Importer.importFunctions(Mod, ImportList).takeError()) in thinBackend()
650 if (Conf.PostImportModuleHook && !Conf.PostImportModuleHook(Task, Mod)) in thinBackend()
653 return OptimizeAndCodegen(Mod, TM.get(), std::move(DiagnosticOutputFile)); in thinBackend()