Path: blob/main/contrib/llvm-project/llvm/tools/opt/NewPMDriver.cpp
35231 views
//===- NewPMDriver.cpp - Driver for opt with new PM -----------------------===//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//===----------------------------------------------------------------------===//7/// \file8///9/// This file is just a split of the code that logically belongs in opt.cpp but10/// that includes the new pass manager headers.11///12//===----------------------------------------------------------------------===//1314#include "NewPMDriver.h"15#include "llvm/ADT/SmallVector.h"16#include "llvm/ADT/StringRef.h"17#include "llvm/Analysis/AliasAnalysis.h"18#include "llvm/Analysis/CGSCCPassManager.h"19#include "llvm/Analysis/TargetLibraryInfo.h"20#include "llvm/Bitcode/BitcodeWriterPass.h"21#include "llvm/Config/llvm-config.h"22#include "llvm/IR/Dominators.h"23#include "llvm/IR/LLVMContext.h"24#include "llvm/IR/Module.h"25#include "llvm/IR/PassManager.h"26#include "llvm/IR/Verifier.h"27#include "llvm/IRPrinter/IRPrintingPasses.h"28#include "llvm/Passes/PassBuilder.h"29#include "llvm/Passes/PassPlugin.h"30#include "llvm/Passes/StandardInstrumentations.h"31#include "llvm/Support/ErrorHandling.h"32#include "llvm/Support/ToolOutputFile.h"33#include "llvm/Support/VirtualFileSystem.h"34#include "llvm/Support/raw_ostream.h"35#include "llvm/Target/TargetMachine.h"36#include "llvm/Transforms/IPO/ThinLTOBitcodeWriter.h"37#include "llvm/Transforms/Instrumentation/AddressSanitizer.h"38#include "llvm/Transforms/Scalar/LoopPassManager.h"39#include "llvm/Transforms/Utils/Debugify.h"4041using namespace llvm;42using namespace opt_tool;4344namespace llvm {45cl::opt<bool> DebugifyEach(46"debugify-each",47cl::desc("Start each pass with debugify and end it with check-debugify"));4849cl::opt<std::string>50DebugifyExport("debugify-export",51cl::desc("Export per-pass debugify statistics to this file"),52cl::value_desc("filename"));5354cl::opt<bool> VerifyEachDebugInfoPreserve(55"verify-each-debuginfo-preserve",56cl::desc("Start each pass with collecting and end it with checking of "57"debug info preservation."));5859cl::opt<std::string>60VerifyDIPreserveExport("verify-di-preserve-export",61cl::desc("Export debug info preservation failures into "62"specified (JSON) file (should be abs path as we use"63" append mode to insert new JSON objects)"),64cl::value_desc("filename"), cl::init(""));6566} // namespace llvm6768enum class DebugLogging { None, Normal, Verbose, Quiet };6970static cl::opt<DebugLogging> DebugPM(71"debug-pass-manager", cl::Hidden, cl::ValueOptional,72cl::desc("Print pass management debugging information"),73cl::init(DebugLogging::None),74cl::values(75clEnumValN(DebugLogging::Normal, "", ""),76clEnumValN(DebugLogging::Quiet, "quiet",77"Skip printing info about analyses"),78clEnumValN(79DebugLogging::Verbose, "verbose",80"Print extra information about adaptors and pass managers")));8182// This flag specifies a textual description of the alias analysis pipeline to83// use when querying for aliasing information. It only works in concert with84// the "passes" flag above.85static cl::opt<std::string>86AAPipeline("aa-pipeline",87cl::desc("A textual description of the alias analysis "88"pipeline for handling managed aliasing queries"),89cl::Hidden, cl::init("default"));9091/// {{@ These options accept textual pipeline descriptions which will be92/// inserted into default pipelines at the respective extension points93static cl::opt<std::string> PeepholeEPPipeline(94"passes-ep-peephole",95cl::desc("A textual description of the function pass pipeline inserted at "96"the Peephole extension points into default pipelines"),97cl::Hidden);98static cl::opt<std::string> LateLoopOptimizationsEPPipeline(99"passes-ep-late-loop-optimizations",100cl::desc(101"A textual description of the loop pass pipeline inserted at "102"the LateLoopOptimizations extension point into default pipelines"),103cl::Hidden);104static cl::opt<std::string> LoopOptimizerEndEPPipeline(105"passes-ep-loop-optimizer-end",106cl::desc("A textual description of the loop pass pipeline inserted at "107"the LoopOptimizerEnd extension point into default pipelines"),108cl::Hidden);109static cl::opt<std::string> ScalarOptimizerLateEPPipeline(110"passes-ep-scalar-optimizer-late",111cl::desc("A textual description of the function pass pipeline inserted at "112"the ScalarOptimizerLate extension point into default pipelines"),113cl::Hidden);114static cl::opt<std::string> CGSCCOptimizerLateEPPipeline(115"passes-ep-cgscc-optimizer-late",116cl::desc("A textual description of the cgscc pass pipeline inserted at "117"the CGSCCOptimizerLate extension point into default pipelines"),118cl::Hidden);119static cl::opt<std::string> VectorizerStartEPPipeline(120"passes-ep-vectorizer-start",121cl::desc("A textual description of the function pass pipeline inserted at "122"the VectorizerStart extension point into default pipelines"),123cl::Hidden);124static cl::opt<std::string> PipelineStartEPPipeline(125"passes-ep-pipeline-start",126cl::desc("A textual description of the module pass pipeline inserted at "127"the PipelineStart extension point into default pipelines"),128cl::Hidden);129static cl::opt<std::string> PipelineEarlySimplificationEPPipeline(130"passes-ep-pipeline-early-simplification",131cl::desc("A textual description of the module pass pipeline inserted at "132"the EarlySimplification extension point into default pipelines"),133cl::Hidden);134static cl::opt<std::string> OptimizerEarlyEPPipeline(135"passes-ep-optimizer-early",136cl::desc("A textual description of the module pass pipeline inserted at "137"the OptimizerEarly extension point into default pipelines"),138cl::Hidden);139static cl::opt<std::string> OptimizerLastEPPipeline(140"passes-ep-optimizer-last",141cl::desc("A textual description of the module pass pipeline inserted at "142"the OptimizerLast extension point into default pipelines"),143cl::Hidden);144static cl::opt<std::string> FullLinkTimeOptimizationEarlyEPPipeline(145"passes-ep-full-link-time-optimization-early",146cl::desc("A textual description of the module pass pipeline inserted at "147"the FullLinkTimeOptimizationEarly extension point into default "148"pipelines"),149cl::Hidden);150static cl::opt<std::string> FullLinkTimeOptimizationLastEPPipeline(151"passes-ep-full-link-time-optimization-last",152cl::desc("A textual description of the module pass pipeline inserted at "153"the FullLinkTimeOptimizationLast extension point into default "154"pipelines"),155cl::Hidden);156/// @}}157158static cl::opt<bool> DisablePipelineVerification(159"disable-pipeline-verification",160cl::desc("Only has an effect when specified with -print-pipeline-passes. "161"Disables verifying that the textual pipeline generated by "162"-print-pipeline-passes can be used to create a pipeline."),163cl::Hidden);164165166static cl::opt<PGOKind>167PGOKindFlag("pgo-kind", cl::init(NoPGO), cl::Hidden,168cl::desc("The kind of profile guided optimization"),169cl::values(clEnumValN(NoPGO, "nopgo", "Do not use PGO."),170clEnumValN(InstrGen, "pgo-instr-gen-pipeline",171"Instrument the IR to generate profile."),172clEnumValN(InstrUse, "pgo-instr-use-pipeline",173"Use instrumented profile to guide PGO."),174clEnumValN(SampleUse, "pgo-sample-use-pipeline",175"Use sampled profile to guide PGO.")));176static cl::opt<std::string> ProfileFile("profile-file",177cl::desc("Path to the profile."), cl::Hidden);178static cl::opt<std::string>179MemoryProfileFile("memory-profile-file",180cl::desc("Path to the memory profile."), cl::Hidden);181182static cl::opt<CSPGOKind> CSPGOKindFlag(183"cspgo-kind", cl::init(NoCSPGO), cl::Hidden,184cl::desc("The kind of context sensitive profile guided optimization"),185cl::values(186clEnumValN(NoCSPGO, "nocspgo", "Do not use CSPGO."),187clEnumValN(188CSInstrGen, "cspgo-instr-gen-pipeline",189"Instrument (context sensitive) the IR to generate profile."),190clEnumValN(191CSInstrUse, "cspgo-instr-use-pipeline",192"Use instrumented (context sensitive) profile to guide PGO.")));193194static cl::opt<std::string> CSProfileGenFile(195"cs-profilegen-file",196cl::desc("Path to the instrumented context sensitive profile."),197cl::Hidden);198199static cl::opt<std::string>200ProfileRemappingFile("profile-remapping-file",201cl::desc("Path to the profile remapping file."),202cl::Hidden);203204static cl::opt<PGOOptions::ColdFuncOpt> PGOColdFuncAttr(205"pgo-cold-func-opt", cl::init(PGOOptions::ColdFuncOpt::Default), cl::Hidden,206cl::desc(207"Function attribute to apply to cold functions as determined by PGO"),208cl::values(clEnumValN(PGOOptions::ColdFuncOpt::Default, "default",209"Default (no attribute)"),210clEnumValN(PGOOptions::ColdFuncOpt::OptSize, "optsize",211"Mark cold functions with optsize."),212clEnumValN(PGOOptions::ColdFuncOpt::MinSize, "minsize",213"Mark cold functions with minsize."),214clEnumValN(PGOOptions::ColdFuncOpt::OptNone, "optnone",215"Mark cold functions with optnone.")));216217static cl::opt<bool> DebugInfoForProfiling(218"debug-info-for-profiling", cl::init(false), cl::Hidden,219cl::desc("Emit special debug info to enable PGO profile generation."));220221static cl::opt<bool> PseudoProbeForProfiling(222"pseudo-probe-for-profiling", cl::init(false), cl::Hidden,223cl::desc("Emit pseudo probes to enable PGO profile generation."));224225static cl::opt<bool> DisableLoopUnrolling(226"disable-loop-unrolling",227cl::desc("Disable loop unrolling in all relevant passes"), cl::init(false));228229namespace llvm {230extern cl::opt<bool> PrintPipelinePasses;231} // namespace llvm232233template <typename PassManagerT>234bool tryParsePipelineText(PassBuilder &PB,235const cl::opt<std::string> &PipelineOpt) {236if (PipelineOpt.empty())237return false;238239// Verify the pipeline is parseable:240PassManagerT PM;241if (auto Err = PB.parsePassPipeline(PM, PipelineOpt)) {242errs() << "Could not parse -" << PipelineOpt.ArgStr243<< " pipeline: " << toString(std::move(Err))244<< "... I'm going to ignore it.\n";245return false;246}247return true;248}249250/// If one of the EPPipeline command line options was given, register callbacks251/// for parsing and inserting the given pipeline252static void registerEPCallbacks(PassBuilder &PB) {253if (tryParsePipelineText<FunctionPassManager>(PB, PeepholeEPPipeline))254PB.registerPeepholeEPCallback(255[&PB](FunctionPassManager &PM, OptimizationLevel Level) {256ExitOnError Err("Unable to parse PeepholeEP pipeline: ");257Err(PB.parsePassPipeline(PM, PeepholeEPPipeline));258});259if (tryParsePipelineText<LoopPassManager>(PB,260LateLoopOptimizationsEPPipeline))261PB.registerLateLoopOptimizationsEPCallback(262[&PB](LoopPassManager &PM, OptimizationLevel Level) {263ExitOnError Err("Unable to parse LateLoopOptimizationsEP pipeline: ");264Err(PB.parsePassPipeline(PM, LateLoopOptimizationsEPPipeline));265});266if (tryParsePipelineText<LoopPassManager>(PB, LoopOptimizerEndEPPipeline))267PB.registerLoopOptimizerEndEPCallback(268[&PB](LoopPassManager &PM, OptimizationLevel Level) {269ExitOnError Err("Unable to parse LoopOptimizerEndEP pipeline: ");270Err(PB.parsePassPipeline(PM, LoopOptimizerEndEPPipeline));271});272if (tryParsePipelineText<FunctionPassManager>(PB,273ScalarOptimizerLateEPPipeline))274PB.registerScalarOptimizerLateEPCallback(275[&PB](FunctionPassManager &PM, OptimizationLevel Level) {276ExitOnError Err("Unable to parse ScalarOptimizerLateEP pipeline: ");277Err(PB.parsePassPipeline(PM, ScalarOptimizerLateEPPipeline));278});279if (tryParsePipelineText<CGSCCPassManager>(PB, CGSCCOptimizerLateEPPipeline))280PB.registerCGSCCOptimizerLateEPCallback(281[&PB](CGSCCPassManager &PM, OptimizationLevel Level) {282ExitOnError Err("Unable to parse CGSCCOptimizerLateEP pipeline: ");283Err(PB.parsePassPipeline(PM, CGSCCOptimizerLateEPPipeline));284});285if (tryParsePipelineText<FunctionPassManager>(PB, VectorizerStartEPPipeline))286PB.registerVectorizerStartEPCallback(287[&PB](FunctionPassManager &PM, OptimizationLevel Level) {288ExitOnError Err("Unable to parse VectorizerStartEP pipeline: ");289Err(PB.parsePassPipeline(PM, VectorizerStartEPPipeline));290});291if (tryParsePipelineText<ModulePassManager>(PB, PipelineStartEPPipeline))292PB.registerPipelineStartEPCallback(293[&PB](ModulePassManager &PM, OptimizationLevel) {294ExitOnError Err("Unable to parse PipelineStartEP pipeline: ");295Err(PB.parsePassPipeline(PM, PipelineStartEPPipeline));296});297if (tryParsePipelineText<ModulePassManager>(298PB, PipelineEarlySimplificationEPPipeline))299PB.registerPipelineEarlySimplificationEPCallback(300[&PB](ModulePassManager &PM, OptimizationLevel) {301ExitOnError Err("Unable to parse EarlySimplification pipeline: ");302Err(PB.parsePassPipeline(PM, PipelineEarlySimplificationEPPipeline));303});304if (tryParsePipelineText<ModulePassManager>(PB, OptimizerEarlyEPPipeline))305PB.registerOptimizerEarlyEPCallback(306[&PB](ModulePassManager &PM, OptimizationLevel) {307ExitOnError Err("Unable to parse OptimizerEarlyEP pipeline: ");308Err(PB.parsePassPipeline(PM, OptimizerEarlyEPPipeline));309});310if (tryParsePipelineText<ModulePassManager>(PB, OptimizerLastEPPipeline))311PB.registerOptimizerLastEPCallback(312[&PB](ModulePassManager &PM, OptimizationLevel) {313ExitOnError Err("Unable to parse OptimizerLastEP pipeline: ");314Err(PB.parsePassPipeline(PM, OptimizerLastEPPipeline));315});316if (tryParsePipelineText<ModulePassManager>(317PB, FullLinkTimeOptimizationEarlyEPPipeline))318PB.registerFullLinkTimeOptimizationEarlyEPCallback(319[&PB](ModulePassManager &PM, OptimizationLevel) {320ExitOnError Err(321"Unable to parse FullLinkTimeOptimizationEarlyEP pipeline: ");322Err(PB.parsePassPipeline(PM,323FullLinkTimeOptimizationEarlyEPPipeline));324});325if (tryParsePipelineText<ModulePassManager>(326PB, FullLinkTimeOptimizationLastEPPipeline))327PB.registerFullLinkTimeOptimizationLastEPCallback(328[&PB](ModulePassManager &PM, OptimizationLevel) {329ExitOnError Err(330"Unable to parse FullLinkTimeOptimizationLastEP pipeline: ");331Err(PB.parsePassPipeline(PM, FullLinkTimeOptimizationLastEPPipeline));332});333}334335#define HANDLE_EXTENSION(Ext) \336llvm::PassPluginLibraryInfo get##Ext##PluginInfo();337#include "llvm/Support/Extension.def"338339bool llvm::runPassPipeline(340StringRef Arg0, Module &M, TargetMachine *TM, TargetLibraryInfoImpl *TLII,341ToolOutputFile *Out, ToolOutputFile *ThinLTOLinkOut,342ToolOutputFile *OptRemarkFile, StringRef PassPipeline,343ArrayRef<PassPlugin> PassPlugins,344ArrayRef<std::function<void(llvm::PassBuilder &)>> PassBuilderCallbacks,345OutputKind OK, VerifierKind VK, bool ShouldPreserveAssemblyUseListOrder,346bool ShouldPreserveBitcodeUseListOrder, bool EmitSummaryIndex,347bool EmitModuleHash, bool EnableDebugify, bool VerifyDIPreserve,348bool UnifiedLTO) {349bool VerifyEachPass = VK == VK_VerifyEachPass;350351auto FS = vfs::getRealFileSystem();352std::optional<PGOOptions> P;353switch (PGOKindFlag) {354case InstrGen:355P = PGOOptions(ProfileFile, "", "", MemoryProfileFile, FS,356PGOOptions::IRInstr, PGOOptions::NoCSAction,357PGOColdFuncAttr);358break;359case InstrUse:360P = PGOOptions(ProfileFile, "", ProfileRemappingFile, MemoryProfileFile, FS,361PGOOptions::IRUse, PGOOptions::NoCSAction, PGOColdFuncAttr);362break;363case SampleUse:364P = PGOOptions(ProfileFile, "", ProfileRemappingFile, MemoryProfileFile, FS,365PGOOptions::SampleUse, PGOOptions::NoCSAction,366PGOColdFuncAttr);367break;368case NoPGO:369if (DebugInfoForProfiling || PseudoProbeForProfiling ||370!MemoryProfileFile.empty())371P = PGOOptions("", "", "", MemoryProfileFile, FS, PGOOptions::NoAction,372PGOOptions::NoCSAction, PGOColdFuncAttr,373DebugInfoForProfiling, PseudoProbeForProfiling);374else375P = std::nullopt;376}377if (CSPGOKindFlag != NoCSPGO) {378if (P && (P->Action == PGOOptions::IRInstr ||379P->Action == PGOOptions::SampleUse)) {380errs() << "CSPGOKind cannot be used with IRInstr or SampleUse";381return false;382}383if (CSPGOKindFlag == CSInstrGen) {384if (CSProfileGenFile.empty()) {385errs() << "CSInstrGen needs to specify CSProfileGenFile";386return false;387}388if (P) {389P->CSAction = PGOOptions::CSIRInstr;390P->CSProfileGenFile = CSProfileGenFile;391} else392P = PGOOptions("", CSProfileGenFile, ProfileRemappingFile,393/*MemoryProfile=*/"", FS, PGOOptions::NoAction,394PGOOptions::CSIRInstr);395} else /* CSPGOKindFlag == CSInstrUse */ {396if (!P) {397errs() << "CSInstrUse needs to be together with InstrUse";398return false;399}400P->CSAction = PGOOptions::CSIRUse;401}402}403if (TM)404TM->setPGOOption(P);405406LoopAnalysisManager LAM;407FunctionAnalysisManager FAM;408CGSCCAnalysisManager CGAM;409ModuleAnalysisManager MAM;410411PassInstrumentationCallbacks PIC;412PrintPassOptions PrintPassOpts;413PrintPassOpts.Verbose = DebugPM == DebugLogging::Verbose;414PrintPassOpts.SkipAnalyses = DebugPM == DebugLogging::Quiet;415StandardInstrumentations SI(M.getContext(), DebugPM != DebugLogging::None,416VerifyEachPass, PrintPassOpts);417SI.registerCallbacks(PIC, &MAM);418DebugifyEachInstrumentation Debugify;419DebugifyStatsMap DIStatsMap;420DebugInfoPerPass DebugInfoBeforePass;421if (DebugifyEach) {422Debugify.setDIStatsMap(DIStatsMap);423Debugify.setDebugifyMode(DebugifyMode::SyntheticDebugInfo);424Debugify.registerCallbacks(PIC, MAM);425} else if (VerifyEachDebugInfoPreserve) {426Debugify.setDebugInfoBeforePass(DebugInfoBeforePass);427Debugify.setDebugifyMode(DebugifyMode::OriginalDebugInfo);428Debugify.setOrigDIVerifyBugsReportFilePath(429VerifyDIPreserveExport);430Debugify.registerCallbacks(PIC, MAM);431}432433PipelineTuningOptions PTO;434// LoopUnrolling defaults on to true and DisableLoopUnrolling is initialized435// to false above so we shouldn't necessarily need to check whether or not the436// option has been enabled.437PTO.LoopUnrolling = !DisableLoopUnrolling;438PTO.UnifiedLTO = UnifiedLTO;439PassBuilder PB(TM, PTO, P, &PIC);440registerEPCallbacks(PB);441442// For any loaded plugins, let them register pass builder callbacks.443for (auto &PassPlugin : PassPlugins)444PassPlugin.registerPassBuilderCallbacks(PB);445446// Load any explicitly specified plugins.447for (auto &PassCallback : PassBuilderCallbacks)448PassCallback(PB);449450#define HANDLE_EXTENSION(Ext) \451get##Ext##PluginInfo().RegisterPassBuilderCallbacks(PB);452#include "llvm/Support/Extension.def"453454// Specially handle the alias analysis manager so that we can register455// a custom pipeline of AA passes with it.456AAManager AA;457if (auto Err = PB.parseAAPipeline(AA, AAPipeline)) {458errs() << Arg0 << ": " << toString(std::move(Err)) << "\n";459return false;460}461462// Register the AA manager first so that our version is the one used.463FAM.registerPass([&] { return std::move(AA); });464// Register our TargetLibraryInfoImpl.465FAM.registerPass([&] { return TargetLibraryAnalysis(*TLII); });466467// Register all the basic analyses with the managers.468PB.registerModuleAnalyses(MAM);469PB.registerCGSCCAnalyses(CGAM);470PB.registerFunctionAnalyses(FAM);471PB.registerLoopAnalyses(LAM);472PB.crossRegisterProxies(LAM, FAM, CGAM, MAM);473474ModulePassManager MPM;475if (EnableDebugify)476MPM.addPass(NewPMDebugifyPass());477if (VerifyDIPreserve)478MPM.addPass(NewPMDebugifyPass(DebugifyMode::OriginalDebugInfo, "",479&DebugInfoBeforePass));480481// Add passes according to the -passes options.482if (!PassPipeline.empty()) {483if (auto Err = PB.parsePassPipeline(MPM, PassPipeline)) {484errs() << Arg0 << ": " << toString(std::move(Err)) << "\n";485return false;486}487}488489if (VK > VK_NoVerifier)490MPM.addPass(VerifierPass());491if (EnableDebugify)492MPM.addPass(NewPMCheckDebugifyPass(false, "", &DIStatsMap));493if (VerifyDIPreserve)494MPM.addPass(NewPMCheckDebugifyPass(495false, "", nullptr, DebugifyMode::OriginalDebugInfo,496&DebugInfoBeforePass, VerifyDIPreserveExport));497498// Add any relevant output pass at the end of the pipeline.499switch (OK) {500case OK_NoOutput:501break; // No output pass needed.502case OK_OutputAssembly:503MPM.addPass(PrintModulePass(504Out->os(), "", ShouldPreserveAssemblyUseListOrder, EmitSummaryIndex));505break;506case OK_OutputBitcode:507MPM.addPass(BitcodeWriterPass(Out->os(), ShouldPreserveBitcodeUseListOrder,508EmitSummaryIndex, EmitModuleHash));509break;510case OK_OutputThinLTOBitcode:511MPM.addPass(ThinLTOBitcodeWriterPass(512Out->os(), ThinLTOLinkOut ? &ThinLTOLinkOut->os() : nullptr));513break;514}515516// Before executing passes, print the final values of the LLVM options.517cl::PrintOptionValues();518519// Print a textual, '-passes=' compatible, representation of pipeline if520// requested.521if (PrintPipelinePasses) {522std::string Pipeline;523raw_string_ostream SOS(Pipeline);524MPM.printPipeline(SOS, [&PIC](StringRef ClassName) {525auto PassName = PIC.getPassNameForClassName(ClassName);526return PassName.empty() ? ClassName : PassName;527});528outs() << Pipeline;529outs() << "\n";530531if (!DisablePipelineVerification) {532// Check that we can parse the returned pipeline string as an actual533// pipeline.534ModulePassManager TempPM;535if (auto Err = PB.parsePassPipeline(TempPM, Pipeline)) {536errs() << "Could not parse dumped pass pipeline: "537<< toString(std::move(Err)) << "\n";538return false;539}540}541542return true;543}544545// Now that we have all of the passes ready, run them.546MPM.run(M, MAM);547548// Declare success.549if (OK != OK_NoOutput) {550Out->keep();551if (OK == OK_OutputThinLTOBitcode && ThinLTOLinkOut)552ThinLTOLinkOut->keep();553}554555if (OptRemarkFile)556OptRemarkFile->keep();557558if (DebugifyEach && !DebugifyExport.empty())559exportDebugifyStats(DebugifyExport, Debugify.getDebugifyStatsMap());560561return true;562}563564void llvm::printPasses(raw_ostream &OS) {565PassBuilder PB;566PB.printPassNames(OS);567}568569570