Lines Matching refs:CodeGenOpts
79 const CodeGenOptions &CodeGenOpts; member in __anonf19209130111::EmitAssemblyHelper
130 : Diags(_Diags), HSOpts(HeaderSearchOpts), CodeGenOpts(CGOpts), in EmitAssemblyHelper()
135 if (CodeGenOpts.DisableFree) in ~EmitAssemblyHelper()
334 const CodeGenOptions &CodeGenOpts) { in createTLII() argument
336 if (!CodeGenOpts.SimplifyLibCalls) in createTLII()
341 for (auto &FuncName : CodeGenOpts.getNoBuiltinFuncs()) in createTLII()
346 switch (CodeGenOpts.getVecLib()) { in createTLII()
370 static CodeGenOpt::Level getCGOptLevel(const CodeGenOptions &CodeGenOpts) { in getCGOptLevel() argument
371 switch (CodeGenOpts.OptimizationLevel) { in getCGOptLevel()
386 getCodeModel(const CodeGenOptions &CodeGenOpts) { in getCodeModel() argument
387 unsigned CodeModel = llvm::StringSwitch<unsigned>(CodeGenOpts.CodeModel) in getCodeModel()
413 const CodeGenOptions &CodeGenOpts, in initTargetOptions() argument
418 llvm::StringSwitch<llvm::ThreadModel::Model>(CodeGenOpts.ThreadModel) in initTargetOptions()
423 assert((CodeGenOpts.FloatABI == "soft" || CodeGenOpts.FloatABI == "softfp" || in initTargetOptions()
424 CodeGenOpts.FloatABI == "hard" || CodeGenOpts.FloatABI.empty()) && in initTargetOptions()
427 llvm::StringSwitch<llvm::FloatABI::ABIType>(CodeGenOpts.FloatABI) in initTargetOptions()
448 Options.UseInitArray = CodeGenOpts.UseInitArray; in initTargetOptions()
449 Options.DisableIntegratedAS = CodeGenOpts.DisableIntegratedAS; in initTargetOptions()
450 Options.CompressDebugSections = CodeGenOpts.getCompressDebugSections(); in initTargetOptions()
451 Options.RelaxELFRelocations = CodeGenOpts.RelaxELFRelocations; in initTargetOptions()
463 Options.NoInfsFPMath = CodeGenOpts.NoInfsFPMath; in initTargetOptions()
464 Options.NoNaNsFPMath = CodeGenOpts.NoNaNsFPMath; in initTargetOptions()
465 Options.NoZerosInBSS = CodeGenOpts.NoZeroInitializedInBSS; in initTargetOptions()
466 Options.UnsafeFPMath = CodeGenOpts.UnsafeFPMath; in initTargetOptions()
467 Options.StackAlignmentOverride = CodeGenOpts.StackAlignment; in initTargetOptions()
468 Options.FunctionSections = CodeGenOpts.FunctionSections; in initTargetOptions()
469 Options.DataSections = CodeGenOpts.DataSections; in initTargetOptions()
470 Options.UniqueSectionNames = CodeGenOpts.UniqueSectionNames; in initTargetOptions()
471 Options.EmulatedTLS = CodeGenOpts.EmulatedTLS; in initTargetOptions()
472 Options.ExplicitEmulatedTLS = CodeGenOpts.ExplicitEmulatedTLS; in initTargetOptions()
473 Options.DebuggerTuning = CodeGenOpts.getDebuggerTuning(); in initTargetOptions()
474 Options.EmitStackSizeSection = CodeGenOpts.StackSizeSection; in initTargetOptions()
475 Options.EmitAddrsig = CodeGenOpts.Addrsig; in initTargetOptions()
477 if (CodeGenOpts.getSplitDwarfMode() != CodeGenOptions::NoFission) in initTargetOptions()
478 Options.MCOptions.SplitDwarfFile = CodeGenOpts.SplitDwarfFile; in initTargetOptions()
479 Options.MCOptions.MCRelaxAll = CodeGenOpts.RelaxAll; in initTargetOptions()
480 Options.MCOptions.MCSaveTempLabels = CodeGenOpts.SaveTempLabels; in initTargetOptions()
481 Options.MCOptions.MCUseDwarfDirectory = !CodeGenOpts.NoDwarfDirectoryAsm; in initTargetOptions()
482 Options.MCOptions.MCNoExecStack = CodeGenOpts.NoExecStack; in initTargetOptions()
484 CodeGenOpts.IncrementalLinkerCompatible; in initTargetOptions()
485 Options.MCOptions.MCPIECopyRelocations = CodeGenOpts.PIECopyRelocations; in initTargetOptions()
486 Options.MCOptions.MCFatalWarnings = CodeGenOpts.FatalWarnings; in initTargetOptions()
487 Options.MCOptions.AsmVerbose = CodeGenOpts.AsmVerbose; in initTargetOptions()
488 Options.MCOptions.PreserveAsmComments = CodeGenOpts.PreserveAsmComments; in initTargetOptions()
498 static Optional<GCOVOptions> getGCOVOptions(const CodeGenOptions &CodeGenOpts) { in getGCOVOptions() argument
499 if (CodeGenOpts.DisableGCov) in getGCOVOptions()
501 if (!CodeGenOpts.EmitGcovArcs && !CodeGenOpts.EmitGcovNotes) in getGCOVOptions()
506 Options.EmitNotes = CodeGenOpts.EmitGcovNotes; in getGCOVOptions()
507 Options.EmitData = CodeGenOpts.EmitGcovArcs; in getGCOVOptions()
508 llvm::copy(CodeGenOpts.CoverageVersion, std::begin(Options.Version)); in getGCOVOptions()
509 Options.UseCfgChecksum = CodeGenOpts.CoverageExtraChecksum; in getGCOVOptions()
510 Options.NoRedZone = CodeGenOpts.DisableRedZone; in getGCOVOptions()
511 Options.FunctionNamesInData = !CodeGenOpts.CoverageNoFunctionNamesInData; in getGCOVOptions()
512 Options.Filter = CodeGenOpts.ProfileFilterFiles; in getGCOVOptions()
513 Options.Exclude = CodeGenOpts.ProfileExcludeFiles; in getGCOVOptions()
514 Options.ExitBlockBeforeBody = CodeGenOpts.CoverageExitBlockBeforeBody; in getGCOVOptions()
522 if (CodeGenOpts.DisableLLVMPasses) in CreatePasses()
531 createTLII(TargetTriple, CodeGenOpts)); in CreatePasses()
533 PassManagerBuilderWrapper PMBuilder(TargetTriple, CodeGenOpts, LangOpts); in CreatePasses()
537 if (CodeGenOpts.OptimizationLevel <= 1) { in CreatePasses()
538 bool InsertLifetimeIntrinsics = (CodeGenOpts.OptimizationLevel != 0 && in CreatePasses()
539 !CodeGenOpts.DisableLifetimeMarkers); in CreatePasses()
546 CodeGenOpts.OptimizationLevel, CodeGenOpts.OptimizeSize, in CreatePasses()
547 (!CodeGenOpts.SampleProfileFile.empty() && in CreatePasses()
548 CodeGenOpts.PrepareForThinLTO)); in CreatePasses()
551 PMBuilder.OptLevel = CodeGenOpts.OptimizationLevel; in CreatePasses()
552 PMBuilder.SizeLevel = CodeGenOpts.OptimizeSize; in CreatePasses()
553 PMBuilder.SLPVectorize = CodeGenOpts.VectorizeSLP; in CreatePasses()
554 PMBuilder.LoopVectorize = CodeGenOpts.VectorizeLoop; in CreatePasses()
556 PMBuilder.DisableUnrollLoops = !CodeGenOpts.UnrollLoops; in CreatePasses()
557 PMBuilder.MergeFunctions = CodeGenOpts.MergeFunctions; in CreatePasses()
558 PMBuilder.PrepareForThinLTO = CodeGenOpts.PrepareForThinLTO; in CreatePasses()
559 PMBuilder.PrepareForLTO = CodeGenOpts.PrepareForLTO; in CreatePasses()
560 PMBuilder.RerollLoops = CodeGenOpts.RerollLoops; in CreatePasses()
567 if (CodeGenOpts.DebugInfoForProfiling || in CreatePasses()
568 !CodeGenOpts.SampleProfileFile.empty()) in CreatePasses()
592 if (CodeGenOpts.SanitizeCoverageType || in CreatePasses()
593 CodeGenOpts.SanitizeCoverageIndirectCalls || in CreatePasses()
594 CodeGenOpts.SanitizeCoverageTraceCmp) { in CreatePasses()
666 if (CodeGenOpts.VerifyModule) in CreatePasses()
670 if (!CodeGenOpts.RewriteMapFiles.empty()) in CreatePasses()
671 addSymbolRewriterPass(CodeGenOpts, &MPM); in CreatePasses()
673 if (Optional<GCOVOptions> Options = getGCOVOptions(CodeGenOpts)) { in CreatePasses()
675 if (CodeGenOpts.getDebugInfo() == codegenoptions::NoDebugInfo) in CreatePasses()
679 if (CodeGenOpts.hasProfileClangInstr()) { in CreatePasses()
681 Options.NoRedZone = CodeGenOpts.DisableRedZone; in CreatePasses()
682 Options.InstrProfileOutput = CodeGenOpts.InstrProfileOutput; in CreatePasses()
690 if (CodeGenOpts.hasProfileIRInstr()) { in CreatePasses()
692 if (!CodeGenOpts.InstrProfileOutput.empty()) in CreatePasses()
693 PMBuilder.PGOInstrGen = CodeGenOpts.InstrProfileOutput; in CreatePasses()
697 if (CodeGenOpts.hasProfileIRUse()) in CreatePasses()
698 PMBuilder.PGOInstrUse = CodeGenOpts.ProfileInstrumentUsePath; in CreatePasses()
700 if (!CodeGenOpts.SampleProfileFile.empty()) in CreatePasses()
701 PMBuilder.PGOSampleUse = CodeGenOpts.SampleProfileFile; in CreatePasses()
707 static void setCommandLineOpts(const CodeGenOptions &CodeGenOpts) { in setCommandLineOpts() argument
710 if (!CodeGenOpts.DebugPass.empty()) { in setCommandLineOpts()
712 BackendArgs.push_back(CodeGenOpts.DebugPass.c_str()); in setCommandLineOpts()
714 if (!CodeGenOpts.LimitFloatPrecision.empty()) { in setCommandLineOpts()
716 BackendArgs.push_back(CodeGenOpts.LimitFloatPrecision.c_str()); in setCommandLineOpts()
734 Optional<llvm::CodeModel::Model> CM = getCodeModel(CodeGenOpts); in CreateTargetMachine()
737 llvm::Reloc::Model RM = CodeGenOpts.RelocationModel; in CreateTargetMachine()
738 CodeGenOpt::Level OptLevel = getCGOptLevel(CodeGenOpts); in CreateTargetMachine()
741 initTargetOptions(Options, CodeGenOpts, TargetOpts, LangOpts, HSOpts); in CreateTargetMachine()
753 createTLII(TargetTriple, CodeGenOpts)); in AddEmitPasses()
763 if (CodeGenOpts.OptimizationLevel > 0) in AddEmitPasses()
767 /*DisableVerify=*/!CodeGenOpts.VerifyModule)) { in AddEmitPasses()
779 setCommandLineOpts(CodeGenOpts); in EmitAssembly()
812 if (CodeGenOpts.PrepareForThinLTO && !CodeGenOpts.DisableLLVMPasses) { in EmitAssembly()
813 if (!CodeGenOpts.ThinLinkBitcodeFile.empty()) { in EmitAssembly()
814 ThinLinkOS = openOutputFile(CodeGenOpts.ThinLinkBitcodeFile); in EmitAssembly()
819 CodeGenOpts.EnableSplitLTOUnit); in EmitAssembly()
826 (CodeGenOpts.PrepareForLTO && in EmitAssembly()
827 !CodeGenOpts.DisableLLVMPasses && in EmitAssembly()
834 CodeGenOpts.EnableSplitLTOUnit); in EmitAssembly()
838 *OS, CodeGenOpts.EmitLLVMUseLists, EmitLTOSummary)); in EmitAssembly()
844 createPrintModulePass(*OS, "", CodeGenOpts.EmitLLVMUseLists)); in EmitAssembly()
848 if (!CodeGenOpts.SplitDwarfFile.empty() && in EmitAssembly()
849 (CodeGenOpts.getSplitDwarfMode() == CodeGenOptions::SplitFileFission)) { in EmitAssembly()
850 DwoOS = openOutputFile(CodeGenOpts.SplitDwarfFile); in EmitAssembly()
930 setCommandLineOpts(CodeGenOpts); in EmitAssemblyWithNewPassManager()
942 if (CodeGenOpts.hasProfileIRInstr()) in EmitAssemblyWithNewPassManager()
944 PGOOpt = PGOOptions(CodeGenOpts.InstrProfileOutput.empty() in EmitAssemblyWithNewPassManager()
946 : CodeGenOpts.InstrProfileOutput, in EmitAssemblyWithNewPassManager()
948 CodeGenOpts.DebugInfoForProfiling); in EmitAssemblyWithNewPassManager()
949 else if (CodeGenOpts.hasProfileIRUse()) in EmitAssemblyWithNewPassManager()
951 PGOOpt = PGOOptions("", CodeGenOpts.ProfileInstrumentUsePath, "", in EmitAssemblyWithNewPassManager()
952 CodeGenOpts.ProfileRemappingFile, false, in EmitAssemblyWithNewPassManager()
953 CodeGenOpts.DebugInfoForProfiling); in EmitAssemblyWithNewPassManager()
954 else if (!CodeGenOpts.SampleProfileFile.empty()) in EmitAssemblyWithNewPassManager()
956 PGOOpt = PGOOptions("", "", CodeGenOpts.SampleProfileFile, in EmitAssemblyWithNewPassManager()
957 CodeGenOpts.ProfileRemappingFile, false, in EmitAssemblyWithNewPassManager()
958 CodeGenOpts.DebugInfoForProfiling); in EmitAssemblyWithNewPassManager()
959 else if (CodeGenOpts.DebugInfoForProfiling) in EmitAssemblyWithNewPassManager()
965 LoopAnalysisManager LAM(CodeGenOpts.DebugPassManager); in EmitAssemblyWithNewPassManager()
966 FunctionAnalysisManager FAM(CodeGenOpts.DebugPassManager); in EmitAssemblyWithNewPassManager()
967 CGSCCAnalysisManager CGAM(CodeGenOpts.DebugPassManager); in EmitAssemblyWithNewPassManager()
968 ModuleAnalysisManager MAM(CodeGenOpts.DebugPassManager); in EmitAssemblyWithNewPassManager()
977 createTLII(TargetTriple, CodeGenOpts)); in EmitAssemblyWithNewPassManager()
988 ModulePassManager MPM(CodeGenOpts.DebugPassManager); in EmitAssemblyWithNewPassManager()
990 if (!CodeGenOpts.DisableLLVMPasses) { in EmitAssemblyWithNewPassManager()
991 bool IsThinLTO = CodeGenOpts.PrepareForThinLTO; in EmitAssemblyWithNewPassManager()
992 bool IsLTO = CodeGenOpts.PrepareForLTO; in EmitAssemblyWithNewPassManager()
994 if (CodeGenOpts.OptimizationLevel == 0) { in EmitAssemblyWithNewPassManager()
995 if (Optional<GCOVOptions> Options = getGCOVOptions(CodeGenOpts)) in EmitAssemblyWithNewPassManager()
1014 PassBuilder::OptimizationLevel Level = mapToLevel(CodeGenOpts); in EmitAssemblyWithNewPassManager()
1023 if (Optional<GCOVOptions> Options = getGCOVOptions(CodeGenOpts)) in EmitAssemblyWithNewPassManager()
1030 Level, CodeGenOpts.DebugPassManager); in EmitAssemblyWithNewPassManager()
1035 CodeGenOpts.DebugPassManager); in EmitAssemblyWithNewPassManager()
1040 CodeGenOpts.DebugPassManager); in EmitAssemblyWithNewPassManager()
1057 if (CodeGenOpts.PrepareForThinLTO && !CodeGenOpts.DisableLLVMPasses) { in EmitAssemblyWithNewPassManager()
1058 if (!CodeGenOpts.ThinLinkBitcodeFile.empty()) { in EmitAssemblyWithNewPassManager()
1059 ThinLinkOS = openOutputFile(CodeGenOpts.ThinLinkBitcodeFile); in EmitAssemblyWithNewPassManager()
1064 CodeGenOpts.EnableSplitLTOUnit); in EmitAssemblyWithNewPassManager()
1071 (CodeGenOpts.PrepareForLTO && in EmitAssemblyWithNewPassManager()
1072 !CodeGenOpts.DisableLLVMPasses && in EmitAssemblyWithNewPassManager()
1079 CodeGenOpts.EnableSplitLTOUnit); in EmitAssemblyWithNewPassManager()
1082 BitcodeWriterPass(*OS, CodeGenOpts.EmitLLVMUseLists, EmitLTOSummary)); in EmitAssemblyWithNewPassManager()
1087 MPM.addPass(PrintModulePass(*OS, "", CodeGenOpts.EmitLLVMUseLists)); in EmitAssemblyWithNewPassManager()
1096 if (!CodeGenOpts.SplitDwarfFile.empty()) { in EmitAssemblyWithNewPassManager()
1097 DwoOS = openOutputFile(CodeGenOpts.SplitDwarfFile); in EmitAssemblyWithNewPassManager()