NewPMDriver.cpp 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495
  1. //===- NewPMDriver.cpp - Driver for opt with new PM -----------------------===//
  2. //
  3. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  4. // See https://llvm.org/LICENSE.txt for license information.
  5. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  6. //
  7. //===----------------------------------------------------------------------===//
  8. /// \file
  9. ///
  10. /// This file is just a split of the code that logically belongs in opt.cpp but
  11. /// that includes the new pass manager headers.
  12. ///
  13. //===----------------------------------------------------------------------===//
  14. #include "NewPMDriver.h"
  15. #include "PassPrinters.h"
  16. #include "llvm/ADT/SmallVector.h"
  17. #include "llvm/ADT/StringRef.h"
  18. #include "llvm/Analysis/AliasAnalysis.h"
  19. #include "llvm/Analysis/CGSCCPassManager.h"
  20. #include "llvm/Analysis/TargetLibraryInfo.h"
  21. #include "llvm/Bitcode/BitcodeWriterPass.h"
  22. #include "llvm/Config/llvm-config.h"
  23. #include "llvm/IR/Dominators.h"
  24. #include "llvm/IR/IRPrintingPasses.h"
  25. #include "llvm/IR/LLVMContext.h"
  26. #include "llvm/IR/Module.h"
  27. #include "llvm/IR/PassManager.h"
  28. #include "llvm/IR/Verifier.h"
  29. #include "llvm/Passes/PassBuilder.h"
  30. #include "llvm/Passes/PassPlugin.h"
  31. #include "llvm/Passes/StandardInstrumentations.h"
  32. #include "llvm/Support/ErrorHandling.h"
  33. #include "llvm/Support/ToolOutputFile.h"
  34. #include "llvm/Target/TargetMachine.h"
  35. #include "llvm/Transforms/IPO/ThinLTOBitcodeWriter.h"
  36. #include "llvm/Transforms/Instrumentation/AddressSanitizer.h"
  37. #include "llvm/Transforms/Scalar/LoopPassManager.h"
  38. #include "llvm/Transforms/Utils/Debugify.h"
  39. using namespace llvm;
  40. using namespace opt_tool;
  41. namespace llvm {
  42. cl::opt<bool> DebugifyEach(
  43. "debugify-each",
  44. cl::desc("Start each pass with debugify and end it with check-debugify"));
  45. cl::opt<std::string>
  46. DebugifyExport("debugify-export",
  47. cl::desc("Export per-pass debugify statistics to this file"),
  48. cl::value_desc("filename"));
  49. } // namespace llvm
  50. enum class DebugLogging { None, Normal, Verbose, Quiet };
  51. static cl::opt<DebugLogging> DebugPM(
  52. "debug-pass-manager", cl::Hidden, cl::ValueOptional,
  53. cl::desc("Print pass management debugging information"),
  54. cl::init(DebugLogging::None),
  55. cl::values(
  56. clEnumValN(DebugLogging::Normal, "", ""),
  57. clEnumValN(DebugLogging::Quiet, "quiet",
  58. "Skip printing info about analyses"),
  59. clEnumValN(
  60. DebugLogging::Verbose, "verbose",
  61. "Print extra information about adaptors and pass managers")));
  62. static cl::list<std::string>
  63. PassPlugins("load-pass-plugin",
  64. cl::desc("Load passes from plugin library"));
  65. // This flag specifies a textual description of the alias analysis pipeline to
  66. // use when querying for aliasing information. It only works in concert with
  67. // the "passes" flag above.
  68. static cl::opt<std::string>
  69. AAPipeline("aa-pipeline",
  70. cl::desc("A textual description of the alias analysis "
  71. "pipeline for handling managed aliasing queries"),
  72. cl::Hidden, cl::init("default"));
  73. /// {{@ These options accept textual pipeline descriptions which will be
  74. /// inserted into default pipelines at the respective extension points
  75. static cl::opt<std::string> PeepholeEPPipeline(
  76. "passes-ep-peephole",
  77. cl::desc("A textual description of the function pass pipeline inserted at "
  78. "the Peephole extension points into default pipelines"),
  79. cl::Hidden);
  80. static cl::opt<std::string> LateLoopOptimizationsEPPipeline(
  81. "passes-ep-late-loop-optimizations",
  82. cl::desc(
  83. "A textual description of the loop pass pipeline inserted at "
  84. "the LateLoopOptimizations extension point into default pipelines"),
  85. cl::Hidden);
  86. static cl::opt<std::string> LoopOptimizerEndEPPipeline(
  87. "passes-ep-loop-optimizer-end",
  88. cl::desc("A textual description of the loop pass pipeline inserted at "
  89. "the LoopOptimizerEnd extension point into default pipelines"),
  90. cl::Hidden);
  91. static cl::opt<std::string> ScalarOptimizerLateEPPipeline(
  92. "passes-ep-scalar-optimizer-late",
  93. cl::desc("A textual description of the function pass pipeline inserted at "
  94. "the ScalarOptimizerLate extension point into default pipelines"),
  95. cl::Hidden);
  96. static cl::opt<std::string> CGSCCOptimizerLateEPPipeline(
  97. "passes-ep-cgscc-optimizer-late",
  98. cl::desc("A textual description of the cgscc pass pipeline inserted at "
  99. "the CGSCCOptimizerLate extension point into default pipelines"),
  100. cl::Hidden);
  101. static cl::opt<std::string> VectorizerStartEPPipeline(
  102. "passes-ep-vectorizer-start",
  103. cl::desc("A textual description of the function pass pipeline inserted at "
  104. "the VectorizerStart extension point into default pipelines"),
  105. cl::Hidden);
  106. static cl::opt<std::string> PipelineStartEPPipeline(
  107. "passes-ep-pipeline-start",
  108. cl::desc("A textual description of the module pass pipeline inserted at "
  109. "the PipelineStart extension point into default pipelines"),
  110. cl::Hidden);
  111. static cl::opt<std::string> PipelineEarlySimplificationEPPipeline(
  112. "passes-ep-pipeline-early-simplification",
  113. cl::desc("A textual description of the module pass pipeline inserted at "
  114. "the EarlySimplification extension point into default pipelines"),
  115. cl::Hidden);
  116. static cl::opt<std::string> OptimizerLastEPPipeline(
  117. "passes-ep-optimizer-last",
  118. cl::desc("A textual description of the module pass pipeline inserted at "
  119. "the OptimizerLast extension point into default pipelines"),
  120. cl::Hidden);
  121. // Individual pipeline tuning options.
  122. extern cl::opt<bool> DisableLoopUnrolling;
  123. namespace llvm {
  124. extern cl::opt<PGOKind> PGOKindFlag;
  125. extern cl::opt<std::string> ProfileFile;
  126. extern cl::opt<CSPGOKind> CSPGOKindFlag;
  127. extern cl::opt<std::string> CSProfileGenFile;
  128. extern cl::opt<bool> DisableBasicAA;
  129. extern cl::opt<bool> PrintPipelinePasses;
  130. } // namespace llvm
  131. static cl::opt<std::string>
  132. ProfileRemappingFile("profile-remapping-file",
  133. cl::desc("Path to the profile remapping file."),
  134. cl::Hidden);
  135. static cl::opt<bool> DebugInfoForProfiling(
  136. "new-pm-debug-info-for-profiling", cl::init(false), cl::Hidden,
  137. cl::desc("Emit special debug info to enable PGO profile generation."));
  138. static cl::opt<bool> PseudoProbeForProfiling(
  139. "new-pm-pseudo-probe-for-profiling", cl::init(false), cl::Hidden,
  140. cl::desc("Emit pseudo probes to enable PGO profile generation."));
  141. /// @}}
  142. template <typename PassManagerT>
  143. bool tryParsePipelineText(PassBuilder &PB,
  144. const cl::opt<std::string> &PipelineOpt) {
  145. if (PipelineOpt.empty())
  146. return false;
  147. // Verify the pipeline is parseable:
  148. PassManagerT PM;
  149. if (auto Err = PB.parsePassPipeline(PM, PipelineOpt)) {
  150. errs() << "Could not parse -" << PipelineOpt.ArgStr
  151. << " pipeline: " << toString(std::move(Err))
  152. << "... I'm going to ignore it.\n";
  153. return false;
  154. }
  155. return true;
  156. }
  157. /// If one of the EPPipeline command line options was given, register callbacks
  158. /// for parsing and inserting the given pipeline
  159. static void registerEPCallbacks(PassBuilder &PB) {
  160. if (tryParsePipelineText<FunctionPassManager>(PB, PeepholeEPPipeline))
  161. PB.registerPeepholeEPCallback(
  162. [&PB](FunctionPassManager &PM, OptimizationLevel Level) {
  163. ExitOnError Err("Unable to parse PeepholeEP pipeline: ");
  164. Err(PB.parsePassPipeline(PM, PeepholeEPPipeline));
  165. });
  166. if (tryParsePipelineText<LoopPassManager>(PB,
  167. LateLoopOptimizationsEPPipeline))
  168. PB.registerLateLoopOptimizationsEPCallback(
  169. [&PB](LoopPassManager &PM, OptimizationLevel Level) {
  170. ExitOnError Err("Unable to parse LateLoopOptimizationsEP pipeline: ");
  171. Err(PB.parsePassPipeline(PM, LateLoopOptimizationsEPPipeline));
  172. });
  173. if (tryParsePipelineText<LoopPassManager>(PB, LoopOptimizerEndEPPipeline))
  174. PB.registerLoopOptimizerEndEPCallback(
  175. [&PB](LoopPassManager &PM, OptimizationLevel Level) {
  176. ExitOnError Err("Unable to parse LoopOptimizerEndEP pipeline: ");
  177. Err(PB.parsePassPipeline(PM, LoopOptimizerEndEPPipeline));
  178. });
  179. if (tryParsePipelineText<FunctionPassManager>(PB,
  180. ScalarOptimizerLateEPPipeline))
  181. PB.registerScalarOptimizerLateEPCallback(
  182. [&PB](FunctionPassManager &PM, OptimizationLevel Level) {
  183. ExitOnError Err("Unable to parse ScalarOptimizerLateEP pipeline: ");
  184. Err(PB.parsePassPipeline(PM, ScalarOptimizerLateEPPipeline));
  185. });
  186. if (tryParsePipelineText<CGSCCPassManager>(PB, CGSCCOptimizerLateEPPipeline))
  187. PB.registerCGSCCOptimizerLateEPCallback(
  188. [&PB](CGSCCPassManager &PM, OptimizationLevel Level) {
  189. ExitOnError Err("Unable to parse CGSCCOptimizerLateEP pipeline: ");
  190. Err(PB.parsePassPipeline(PM, CGSCCOptimizerLateEPPipeline));
  191. });
  192. if (tryParsePipelineText<FunctionPassManager>(PB, VectorizerStartEPPipeline))
  193. PB.registerVectorizerStartEPCallback(
  194. [&PB](FunctionPassManager &PM, OptimizationLevel Level) {
  195. ExitOnError Err("Unable to parse VectorizerStartEP pipeline: ");
  196. Err(PB.parsePassPipeline(PM, VectorizerStartEPPipeline));
  197. });
  198. if (tryParsePipelineText<ModulePassManager>(PB, PipelineStartEPPipeline))
  199. PB.registerPipelineStartEPCallback(
  200. [&PB](ModulePassManager &PM, OptimizationLevel) {
  201. ExitOnError Err("Unable to parse PipelineStartEP pipeline: ");
  202. Err(PB.parsePassPipeline(PM, PipelineStartEPPipeline));
  203. });
  204. if (tryParsePipelineText<ModulePassManager>(
  205. PB, PipelineEarlySimplificationEPPipeline))
  206. PB.registerPipelineEarlySimplificationEPCallback(
  207. [&PB](ModulePassManager &PM, OptimizationLevel) {
  208. ExitOnError Err("Unable to parse EarlySimplification pipeline: ");
  209. Err(PB.parsePassPipeline(PM, PipelineEarlySimplificationEPPipeline));
  210. });
  211. if (tryParsePipelineText<FunctionPassManager>(PB, OptimizerLastEPPipeline))
  212. PB.registerOptimizerLastEPCallback(
  213. [&PB](ModulePassManager &PM, OptimizationLevel) {
  214. ExitOnError Err("Unable to parse OptimizerLastEP pipeline: ");
  215. Err(PB.parsePassPipeline(PM, OptimizerLastEPPipeline));
  216. });
  217. }
  218. #define HANDLE_EXTENSION(Ext) \
  219. llvm::PassPluginLibraryInfo get##Ext##PluginInfo();
  220. #include "llvm/Support/Extension.def"
  221. bool llvm::runPassPipeline(StringRef Arg0, Module &M, TargetMachine *TM,
  222. TargetLibraryInfoImpl *TLII, ToolOutputFile *Out,
  223. ToolOutputFile *ThinLTOLinkOut,
  224. ToolOutputFile *OptRemarkFile,
  225. StringRef PassPipeline, ArrayRef<StringRef> Passes,
  226. OutputKind OK, VerifierKind VK,
  227. bool ShouldPreserveAssemblyUseListOrder,
  228. bool ShouldPreserveBitcodeUseListOrder,
  229. bool EmitSummaryIndex, bool EmitModuleHash,
  230. bool EnableDebugify) {
  231. bool VerifyEachPass = VK == VK_VerifyEachPass;
  232. Optional<PGOOptions> P;
  233. switch (PGOKindFlag) {
  234. case InstrGen:
  235. P = PGOOptions(ProfileFile, "", "", PGOOptions::IRInstr);
  236. break;
  237. case InstrUse:
  238. P = PGOOptions(ProfileFile, "", ProfileRemappingFile, PGOOptions::IRUse);
  239. break;
  240. case SampleUse:
  241. P = PGOOptions(ProfileFile, "", ProfileRemappingFile,
  242. PGOOptions::SampleUse);
  243. break;
  244. case NoPGO:
  245. if (DebugInfoForProfiling || PseudoProbeForProfiling)
  246. P = PGOOptions("", "", "", PGOOptions::NoAction, PGOOptions::NoCSAction,
  247. DebugInfoForProfiling, PseudoProbeForProfiling);
  248. else
  249. P = None;
  250. }
  251. if (CSPGOKindFlag != NoCSPGO) {
  252. if (P && (P->Action == PGOOptions::IRInstr ||
  253. P->Action == PGOOptions::SampleUse))
  254. errs() << "CSPGOKind cannot be used with IRInstr or SampleUse";
  255. if (CSPGOKindFlag == CSInstrGen) {
  256. if (CSProfileGenFile.empty())
  257. errs() << "CSInstrGen needs to specify CSProfileGenFile";
  258. if (P) {
  259. P->CSAction = PGOOptions::CSIRInstr;
  260. P->CSProfileGenFile = CSProfileGenFile;
  261. } else
  262. P = PGOOptions("", CSProfileGenFile, ProfileRemappingFile,
  263. PGOOptions::NoAction, PGOOptions::CSIRInstr);
  264. } else /* CSPGOKindFlag == CSInstrUse */ {
  265. if (!P)
  266. errs() << "CSInstrUse needs to be together with InstrUse";
  267. P->CSAction = PGOOptions::CSIRUse;
  268. }
  269. }
  270. if (TM)
  271. TM->setPGOOption(P);
  272. LoopAnalysisManager LAM;
  273. FunctionAnalysisManager FAM;
  274. CGSCCAnalysisManager CGAM;
  275. ModuleAnalysisManager MAM;
  276. PassInstrumentationCallbacks PIC;
  277. PrintPassOptions PrintPassOpts;
  278. PrintPassOpts.Verbose = DebugPM == DebugLogging::Verbose;
  279. PrintPassOpts.SkipAnalyses = DebugPM == DebugLogging::Quiet;
  280. StandardInstrumentations SI(DebugPM != DebugLogging::None, VerifyEachPass,
  281. PrintPassOpts);
  282. SI.registerCallbacks(PIC, &FAM);
  283. DebugifyEachInstrumentation Debugify;
  284. if (DebugifyEach)
  285. Debugify.registerCallbacks(PIC);
  286. PipelineTuningOptions PTO;
  287. // LoopUnrolling defaults on to true and DisableLoopUnrolling is initialized
  288. // to false above so we shouldn't necessarily need to check whether or not the
  289. // option has been enabled.
  290. PTO.LoopUnrolling = !DisableLoopUnrolling;
  291. PassBuilder PB(TM, PTO, P, &PIC);
  292. registerEPCallbacks(PB);
  293. // Load requested pass plugins and let them register pass builder callbacks
  294. for (auto &PluginFN : PassPlugins) {
  295. auto PassPlugin = PassPlugin::Load(PluginFN);
  296. if (!PassPlugin) {
  297. errs() << "Failed to load passes from '" << PluginFN
  298. << "'. Request ignored.\n";
  299. continue;
  300. }
  301. PassPlugin->registerPassBuilderCallbacks(PB);
  302. }
  303. PB.registerPipelineParsingCallback(
  304. [](StringRef Name, ModulePassManager &MPM,
  305. ArrayRef<PassBuilder::PipelineElement>) {
  306. AddressSanitizerOptions Opts;
  307. if (Name == "asan-pipeline") {
  308. MPM.addPass(
  309. RequireAnalysisPass<ASanGlobalsMetadataAnalysis, Module>());
  310. MPM.addPass(ModuleAddressSanitizerPass(Opts));
  311. return true;
  312. } else if (Name == "asan-function-pipeline") {
  313. MPM.addPass(
  314. RequireAnalysisPass<ASanGlobalsMetadataAnalysis, Module>());
  315. MPM.addPass(
  316. createModuleToFunctionPassAdaptor(AddressSanitizerPass(Opts)));
  317. return true;
  318. }
  319. return false;
  320. });
  321. #define HANDLE_EXTENSION(Ext) \
  322. get##Ext##PluginInfo().RegisterPassBuilderCallbacks(PB);
  323. #include "llvm/Support/Extension.def"
  324. // Specially handle the alias analysis manager so that we can register
  325. // a custom pipeline of AA passes with it.
  326. AAManager AA;
  327. if (Passes.empty()) {
  328. if (auto Err = PB.parseAAPipeline(AA, AAPipeline)) {
  329. errs() << Arg0 << ": " << toString(std::move(Err)) << "\n";
  330. return false;
  331. }
  332. }
  333. // For compatibility with the legacy PM AA pipeline.
  334. // AAResultsWrapperPass by default provides basic-aa in the legacy PM
  335. // unless -disable-basic-aa is specified.
  336. // TODO: remove this once tests implicitly requiring basic-aa use -passes= and
  337. // -aa-pipeline=basic-aa.
  338. if (!Passes.empty() && !DisableBasicAA) {
  339. if (auto Err = PB.parseAAPipeline(AA, "basic-aa")) {
  340. errs() << Arg0 << ": " << toString(std::move(Err)) << "\n";
  341. return false;
  342. }
  343. }
  344. // For compatibility with legacy pass manager.
  345. // Alias analyses are not specially specified when using the legacy PM.
  346. for (auto PassName : Passes) {
  347. if (PB.isAAPassName(PassName)) {
  348. if (auto Err = PB.parseAAPipeline(AA, PassName)) {
  349. errs() << Arg0 << ": " << toString(std::move(Err)) << "\n";
  350. return false;
  351. }
  352. }
  353. }
  354. // Register the AA manager first so that our version is the one used.
  355. FAM.registerPass([&] { return std::move(AA); });
  356. // Register our TargetLibraryInfoImpl.
  357. FAM.registerPass([&] { return TargetLibraryAnalysis(*TLII); });
  358. // Register all the basic analyses with the managers.
  359. PB.registerModuleAnalyses(MAM);
  360. PB.registerCGSCCAnalyses(CGAM);
  361. PB.registerFunctionAnalyses(FAM);
  362. PB.registerLoopAnalyses(LAM);
  363. PB.crossRegisterProxies(LAM, FAM, CGAM, MAM);
  364. ModulePassManager MPM;
  365. if (VK > VK_NoVerifier)
  366. MPM.addPass(VerifierPass());
  367. if (EnableDebugify)
  368. MPM.addPass(NewPMDebugifyPass());
  369. // Add passes according to the -passes options.
  370. if (!PassPipeline.empty()) {
  371. assert(Passes.empty() &&
  372. "PassPipeline and Passes should not both contain passes");
  373. if (auto Err = PB.parsePassPipeline(MPM, PassPipeline)) {
  374. errs() << Arg0 << ": " << toString(std::move(Err)) << "\n";
  375. return false;
  376. }
  377. }
  378. // Add passes specified using the legacy PM syntax (i.e. not using
  379. // -passes). This should be removed later when such support has been
  380. // deprecated, i.e. when all lit tests running opt (and not using
  381. // -enable-new-pm=0) have been updated to use -passes.
  382. for (auto PassName : Passes) {
  383. std::string ModifiedPassName(PassName.begin(), PassName.end());
  384. if (PB.isAnalysisPassName(PassName))
  385. ModifiedPassName = "require<" + ModifiedPassName + ">";
  386. // FIXME: These translations are supposed to be removed when lit tests that
  387. // use these names have been updated to use the -passes syntax (and when the
  388. // support for using the old syntax to specify passes is considered as
  389. // deprecated for the new PM).
  390. if (ModifiedPassName == "early-cse-memssa")
  391. ModifiedPassName = "early-cse<memssa>";
  392. else if (ModifiedPassName == "post-inline-ee-instrument")
  393. ModifiedPassName = "ee-instrument<post-inline>";
  394. else if (ModifiedPassName == "loop-extract-single")
  395. ModifiedPassName = "loop-extract<single>";
  396. else if (ModifiedPassName == "lower-matrix-intrinsics-minimal")
  397. ModifiedPassName = "lower-matrix-intrinsics<minimal>";
  398. if (auto Err = PB.parsePassPipeline(MPM, ModifiedPassName)) {
  399. errs() << Arg0 << ": " << toString(std::move(Err)) << "\n";
  400. return false;
  401. }
  402. }
  403. if (VK > VK_NoVerifier)
  404. MPM.addPass(VerifierPass());
  405. if (EnableDebugify)
  406. MPM.addPass(NewPMCheckDebugifyPass());
  407. // Add any relevant output pass at the end of the pipeline.
  408. switch (OK) {
  409. case OK_NoOutput:
  410. break; // No output pass needed.
  411. case OK_OutputAssembly:
  412. MPM.addPass(
  413. PrintModulePass(Out->os(), "", ShouldPreserveAssemblyUseListOrder));
  414. break;
  415. case OK_OutputBitcode:
  416. MPM.addPass(BitcodeWriterPass(Out->os(), ShouldPreserveBitcodeUseListOrder,
  417. EmitSummaryIndex, EmitModuleHash));
  418. break;
  419. case OK_OutputThinLTOBitcode:
  420. MPM.addPass(ThinLTOBitcodeWriterPass(
  421. Out->os(), ThinLTOLinkOut ? &ThinLTOLinkOut->os() : nullptr));
  422. break;
  423. }
  424. // Before executing passes, print the final values of the LLVM options.
  425. cl::PrintOptionValues();
  426. // Print a textual, '-passes=' compatible, representation of pipeline if
  427. // requested.
  428. if (PrintPipelinePasses) {
  429. MPM.printPipeline(outs(), [&PIC](StringRef ClassName) {
  430. auto PassName = PIC.getPassNameForClassName(ClassName);
  431. return PassName.empty() ? ClassName : PassName;
  432. });
  433. outs() << "\n";
  434. return true;
  435. }
  436. // Now that we have all of the passes ready, run them.
  437. MPM.run(M, MAM);
  438. // Declare success.
  439. if (OK != OK_NoOutput) {
  440. Out->keep();
  441. if (OK == OK_OutputThinLTOBitcode && ThinLTOLinkOut)
  442. ThinLTOLinkOut->keep();
  443. }
  444. if (OptRemarkFile)
  445. OptRemarkFile->keep();
  446. if (DebugifyEach && !DebugifyExport.empty())
  447. exportDebugifyStats(DebugifyExport, Debugify.StatsMap);
  448. return true;
  449. }
  450. void llvm::printPasses(raw_ostream &OS) {
  451. PassBuilder PB;
  452. PB.printPassNames(OS);
  453. }