reference, declaration → definition definition → references, declarations, derived classes, virtual overrides reference to multiple definitions → definitions unreferenced |
142 if (CodeGenOpts.DisableFree) 549 if (CodeGenOpts.DisableLLVMPasses) 558 createTLII(TargetTriple, CodeGenOpts)); 560 PassManagerBuilderWrapper PMBuilder(TargetTriple, CodeGenOpts, LangOpts); 564 if (CodeGenOpts.OptimizationLevel <= 1) { 565 bool InsertLifetimeIntrinsics = (CodeGenOpts.OptimizationLevel != 0 && 566 !CodeGenOpts.DisableLifetimeMarkers); 573 CodeGenOpts.OptimizationLevel, CodeGenOpts.OptimizeSize, 573 CodeGenOpts.OptimizationLevel, CodeGenOpts.OptimizeSize, 574 (!CodeGenOpts.SampleProfileFile.empty() && 575 CodeGenOpts.PrepareForThinLTO)); 578 PMBuilder.OptLevel = CodeGenOpts.OptimizationLevel; 579 PMBuilder.SizeLevel = CodeGenOpts.OptimizeSize; 580 PMBuilder.SLPVectorize = CodeGenOpts.VectorizeSLP; 581 PMBuilder.LoopVectorize = CodeGenOpts.VectorizeLoop; 583 PMBuilder.DisableUnrollLoops = !CodeGenOpts.UnrollLoops; 586 PMBuilder.LoopsInterleaved = CodeGenOpts.UnrollLoops; 587 PMBuilder.MergeFunctions = CodeGenOpts.MergeFunctions; 588 PMBuilder.PrepareForThinLTO = CodeGenOpts.PrepareForThinLTO; 589 PMBuilder.PrepareForLTO = CodeGenOpts.PrepareForLTO; 590 PMBuilder.RerollLoops = CodeGenOpts.RerollLoops; 597 if (CodeGenOpts.DebugInfoForProfiling || 598 !CodeGenOpts.SampleProfileFile.empty()) 622 if (CodeGenOpts.SanitizeCoverageType || 623 CodeGenOpts.SanitizeCoverageIndirectCalls || 624 CodeGenOpts.SanitizeCoverageTraceCmp) { 689 if (CodeGenOpts.VerifyModule) 693 if (!CodeGenOpts.RewriteMapFiles.empty()) 694 addSymbolRewriterPass(CodeGenOpts, &MPM); 696 if (Optional<GCOVOptions> Options = getGCOVOptions(CodeGenOpts)) { 698 if (CodeGenOpts.getDebugInfo() == codegenoptions::NoDebugInfo) 703 getInstrProfOptions(CodeGenOpts, LangOpts)) 707 if (CodeGenOpts.hasProfileIRInstr()) { 711 if (CodeGenOpts.hasProfileCSIRInstr()) { 712 assert(!CodeGenOpts.hasProfileCSIRUse() && 722 if (!CodeGenOpts.InstrProfileOutput.empty()) 723 PMBuilder.PGOInstrGen = CodeGenOpts.InstrProfileOutput; 727 if (CodeGenOpts.hasProfileIRUse()) { 728 PMBuilder.PGOInstrUse = CodeGenOpts.ProfileInstrumentUsePath; 729 PMBuilder.EnablePGOCSInstrUse = CodeGenOpts.hasProfileCSIRUse(); 732 if (!CodeGenOpts.SampleProfileFile.empty()) 733 PMBuilder.PGOSampleUse = CodeGenOpts.SampleProfileFile; 766 Optional<llvm::CodeModel::Model> CM = getCodeModel(CodeGenOpts); 769 llvm::Reloc::Model RM = CodeGenOpts.RelocationModel; 770 CodeGenOpt::Level OptLevel = getCGOptLevel(CodeGenOpts); 773 initTargetOptions(Options, CodeGenOpts, TargetOpts, LangOpts, HSOpts); 785 createTLII(TargetTriple, CodeGenOpts)); 795 if (CodeGenOpts.OptimizationLevel > 0) 799 /*DisableVerify=*/!CodeGenOpts.VerifyModule)) { 811 setCommandLineOpts(CodeGenOpts); 844 if (CodeGenOpts.PrepareForThinLTO && !CodeGenOpts.DisableLLVMPasses) { 844 if (CodeGenOpts.PrepareForThinLTO && !CodeGenOpts.DisableLLVMPasses) { 845 if (!CodeGenOpts.ThinLinkBitcodeFile.empty()) { 846 ThinLinkOS = openOutputFile(CodeGenOpts.ThinLinkBitcodeFile); 851 CodeGenOpts.EnableSplitLTOUnit); 858 (CodeGenOpts.PrepareForLTO && 859 !CodeGenOpts.DisableLLVMPasses && 870 *OS, CodeGenOpts.EmitLLVMUseLists, EmitLTOSummary)); 876 createPrintModulePass(*OS, "", CodeGenOpts.EmitLLVMUseLists)); 880 if (!CodeGenOpts.SplitDwarfOutput.empty()) { 881 DwoOS = openOutputFile(CodeGenOpts.SplitDwarfOutput); 1003 setCommandLineOpts(CodeGenOpts); 1017 if (CodeGenOpts.hasProfileIRInstr()) 1019 PGOOpt = PGOOptions(CodeGenOpts.InstrProfileOutput.empty() 1021 : CodeGenOpts.InstrProfileOutput, 1023 CodeGenOpts.DebugInfoForProfiling); 1024 else if (CodeGenOpts.hasProfileIRUse()) { 1026 auto CSAction = CodeGenOpts.hasProfileCSIRUse() ? PGOOptions::CSIRUse 1028 PGOOpt = PGOOptions(CodeGenOpts.ProfileInstrumentUsePath, "", 1029 CodeGenOpts.ProfileRemappingFile, PGOOptions::IRUse, 1030 CSAction, CodeGenOpts.DebugInfoForProfiling); 1031 } else if (!CodeGenOpts.SampleProfileFile.empty()) 1034 PGOOptions(CodeGenOpts.SampleProfileFile, "", 1035 CodeGenOpts.ProfileRemappingFile, PGOOptions::SampleUse, 1036 PGOOptions::NoCSAction, CodeGenOpts.DebugInfoForProfiling); 1037 else if (CodeGenOpts.DebugInfoForProfiling) 1043 if (CodeGenOpts.hasProfileCSIRInstr()) { 1044 assert(!CodeGenOpts.hasProfileCSIRUse() && 1052 PGOOpt->CSProfileGenFile = CodeGenOpts.InstrProfileOutput.empty() 1054 : CodeGenOpts.InstrProfileOutput; 1058 CodeGenOpts.InstrProfileOutput.empty() 1060 : CodeGenOpts.InstrProfileOutput, 1062 CodeGenOpts.DebugInfoForProfiling); 1066 PTO.LoopUnrolling = CodeGenOpts.UnrollLoops; 1069 PTO.LoopInterleaving = CodeGenOpts.UnrollLoops; 1070 PTO.LoopVectorization = CodeGenOpts.VectorizeLoop; 1071 PTO.SLPVectorization = CodeGenOpts.VectorizeSLP; 1079 for (auto &PluginFN : CodeGenOpts.PassPlugins) { 1089 LoopAnalysisManager LAM(CodeGenOpts.DebugPassManager); 1090 FunctionAnalysisManager FAM(CodeGenOpts.DebugPassManager); 1091 CGSCCAnalysisManager CGAM(CodeGenOpts.DebugPassManager); 1092 ModuleAnalysisManager MAM(CodeGenOpts.DebugPassManager); 1101 createTLII(TargetTriple, CodeGenOpts)); 1111 ModulePassManager MPM(CodeGenOpts.DebugPassManager); 1113 if (!CodeGenOpts.DisableLLVMPasses) { 1114 bool IsThinLTO = CodeGenOpts.PrepareForThinLTO; 1115 bool IsLTO = CodeGenOpts.PrepareForLTO; 1117 if (CodeGenOpts.OptimizationLevel == 0) { 1118 if (Optional<GCOVOptions> Options = getGCOVOptions(CodeGenOpts)) 1121 getInstrProfOptions(CodeGenOpts, LangOpts)) 1135 MPM, CodeGenOpts.DebugPassManager, 1152 PassBuilder::OptimizationLevel Level = mapToLevel(CodeGenOpts); 1189 bool Recover = CodeGenOpts.SanitizeRecover.has(SanitizerKind::Address); 1190 bool UseAfterScope = CodeGenOpts.SanitizeAddressUseAfterScope; 1197 bool ModuleUseAfterScope = asanUseGlobalsGC(TargetTriple, CodeGenOpts); 1198 bool UseOdrIndicator = CodeGenOpts.SanitizeAddressUseOdrIndicator; 1207 if (Optional<GCOVOptions> Options = getGCOVOptions(CodeGenOpts)) 1212 getInstrProfOptions(CodeGenOpts, LangOpts)) 1219 Level, CodeGenOpts.DebugPassManager); 1224 CodeGenOpts.DebugPassManager); 1229 CodeGenOpts.DebugPassManager); 1233 if (CodeGenOpts.SanitizeCoverageType || 1234 CodeGenOpts.SanitizeCoverageIndirectCalls || 1235 CodeGenOpts.SanitizeCoverageTraceCmp) { 1236 auto SancovOpts = getSancovOptsFromCGOpts(CodeGenOpts); 1241 bool Recover = CodeGenOpts.SanitizeRecover.has(SanitizerKind::HWAddress); 1250 if (CodeGenOpts.OptimizationLevel == 0) { 1251 addSanitizersAtO0(MPM, TargetTriple, LangOpts, CodeGenOpts); 1267 if (CodeGenOpts.PrepareForThinLTO && !CodeGenOpts.DisableLLVMPasses) { 1267 if (CodeGenOpts.PrepareForThinLTO && !CodeGenOpts.DisableLLVMPasses) { 1268 if (!CodeGenOpts.ThinLinkBitcodeFile.empty()) { 1269 ThinLinkOS = openOutputFile(CodeGenOpts.ThinLinkBitcodeFile); 1274 CodeGenOpts.EnableSplitLTOUnit); 1281 (CodeGenOpts.PrepareForLTO && 1282 !CodeGenOpts.DisableLLVMPasses && 1292 BitcodeWriterPass(*OS, CodeGenOpts.EmitLLVMUseLists, EmitLTOSummary)); 1297 MPM.addPass(PrintModulePass(*OS, "", CodeGenOpts.EmitLLVMUseLists)); 1306 if (!CodeGenOpts.SplitDwarfOutput.empty()) { 1307 DwoOS = openOutputFile(CodeGenOpts.SplitDwarfOutput);