blob: 211a3b151fe1ee4830a9bb35b67c62a35820ac1b [file] [log] [blame]
Chandler Carruth4e728be2014-01-11 08:16:35 +00001//===- NewPMDriver.cpp - Driver for opt with new PM -----------------------===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9/// \file
10///
11/// This file is just a split of the code that logically belongs in opt.cpp but
12/// that includes the new pass manager headers.
13///
14//===----------------------------------------------------------------------===//
15
16#include "NewPMDriver.h"
Fedor Sergeeva7c23702018-09-24 16:08:15 +000017#include "Debugify.h"
Vedant Kumarb8c067b2018-02-15 21:14:36 +000018#include "PassPrinters.h"
Chandler Carruth4e728be2014-01-11 08:16:35 +000019#include "llvm/ADT/StringRef.h"
Chandler Carruth67a41f02016-02-18 09:45:17 +000020#include "llvm/Analysis/AliasAnalysis.h"
Chandler Carruth57418d82014-04-21 11:12:00 +000021#include "llvm/Analysis/CGSCCPassManager.h"
Chandler Carruthe2dc71d2014-01-13 07:38:24 +000022#include "llvm/Bitcode/BitcodeWriterPass.h"
Nico Weber0f38c602018-04-30 14:59:11 +000023#include "llvm/Config/llvm-config.h"
Chandler Carruth8c3a02f2015-01-14 10:19:28 +000024#include "llvm/IR/Dominators.h"
Chandler Carruth085c07f2014-01-13 05:16:45 +000025#include "llvm/IR/IRPrintingPasses.h"
Chandler Carruth4e728be2014-01-11 08:16:35 +000026#include "llvm/IR/LLVMContext.h"
27#include "llvm/IR/Module.h"
28#include "llvm/IR/PassManager.h"
Chandler Carruth1d9ab252014-01-20 11:34:08 +000029#include "llvm/IR/Verifier.h"
Chandler Carruth23491362015-03-07 09:02:36 +000030#include "llvm/Passes/PassBuilder.h"
Philip Pfaffe53016772018-04-05 15:04:13 +000031#include "llvm/Passes/PassPlugin.h"
Fedor Sergeeva7c23702018-09-24 16:08:15 +000032#include "llvm/Passes/StandardInstrumentations.h"
Chandler Carruth4e728be2014-01-11 08:16:35 +000033#include "llvm/Support/CommandLine.h"
Chandler Carruth085c07f2014-01-13 05:16:45 +000034#include "llvm/Support/ErrorHandling.h"
Chandler Carruth4e728be2014-01-11 08:16:35 +000035#include "llvm/Support/ToolOutputFile.h"
Chandler Carruth7724e8e2015-02-01 10:11:22 +000036#include "llvm/Target/TargetMachine.h"
Tim Shen2e378852017-06-01 01:02:12 +000037#include "llvm/Transforms/IPO/ThinLTOBitcodeWriter.h"
Chandler Carruthc68d25f2017-01-11 09:43:56 +000038#include "llvm/Transforms/Scalar/LoopPassManager.h"
Chandler Carruth4e728be2014-01-11 08:16:35 +000039
40using namespace llvm;
Chandler Carruth4a760322014-01-13 03:08:40 +000041using namespace opt_tool;
Chandler Carruth4e728be2014-01-11 08:16:35 +000042
Chandler Carruth3c95d9c2015-01-13 22:42:38 +000043static cl::opt<bool>
44 DebugPM("debug-pass-manager", cl::Hidden,
45 cl::desc("Print pass management debugging information"));
46
Philip Pfaffe53016772018-04-05 15:04:13 +000047static cl::list<std::string>
48 PassPlugins("load-pass-plugin",
49 cl::desc("Load passes from plugin library"));
50
Chandler Carruth67a41f02016-02-18 09:45:17 +000051// This flag specifies a textual description of the alias analysis pipeline to
52// use when querying for aliasing information. It only works in concert with
53// the "passes" flag above.
54static cl::opt<std::string>
55 AAPipeline("aa-pipeline",
56 cl::desc("A textual description of the alias analysis "
57 "pipeline for handling managed aliasing queries"),
58 cl::Hidden);
59
Philip Pfaffe19045612017-07-10 10:57:55 +000060/// {{@ These options accept textual pipeline descriptions which will be
61/// inserted into default pipelines at the respective extension points
62static cl::opt<std::string> PeepholeEPPipeline(
63 "passes-ep-peephole",
64 cl::desc("A textual description of the function pass pipeline inserted at "
65 "the Peephole extension points into default pipelines"),
66 cl::Hidden);
67static cl::opt<std::string> LateLoopOptimizationsEPPipeline(
68 "passes-ep-late-loop-optimizations",
69 cl::desc(
70 "A textual description of the loop pass pipeline inserted at "
71 "the LateLoopOptimizations extension point into default pipelines"),
72 cl::Hidden);
73static cl::opt<std::string> LoopOptimizerEndEPPipeline(
74 "passes-ep-loop-optimizer-end",
75 cl::desc("A textual description of the loop pass pipeline inserted at "
76 "the LoopOptimizerEnd extension point into default pipelines"),
77 cl::Hidden);
78static cl::opt<std::string> ScalarOptimizerLateEPPipeline(
79 "passes-ep-scalar-optimizer-late",
80 cl::desc("A textual description of the function pass pipeline inserted at "
81 "the ScalarOptimizerLate extension point into default pipelines"),
82 cl::Hidden);
83static cl::opt<std::string> CGSCCOptimizerLateEPPipeline(
84 "passes-ep-cgscc-optimizer-late",
85 cl::desc("A textual description of the cgscc pass pipeline inserted at "
86 "the CGSCCOptimizerLate extension point into default pipelines"),
87 cl::Hidden);
88static cl::opt<std::string> VectorizerStartEPPipeline(
89 "passes-ep-vectorizer-start",
90 cl::desc("A textual description of the function pass pipeline inserted at "
91 "the VectorizerStart extension point into default pipelines"),
92 cl::Hidden);
David Blaikie0ac87472018-01-23 01:25:20 +000093static cl::opt<std::string> PipelineStartEPPipeline(
94 "passes-ep-pipeline-start",
95 cl::desc("A textual description of the function pass pipeline inserted at "
96 "the PipelineStart extension point into default pipelines"),
97 cl::Hidden);
Philip Pfaffe0c20a4d2018-11-12 11:17:07 +000098static cl::opt<std::string> OptimizerLastEPPipeline(
99 "passes-ep-optimizer-last",
100 cl::desc("A textual description of the function pass pipeline inserted at "
101 "the OptimizerLast extension point into default pipelines"),
102 cl::Hidden);
103
Dehao Chenc87493d2017-07-26 02:00:43 +0000104enum PGOKind { NoPGO, InstrGen, InstrUse, SampleUse };
105static cl::opt<PGOKind> PGOKindFlag(
106 "pgo-kind", cl::init(NoPGO), cl::Hidden,
107 cl::desc("The kind of profile guided optimization"),
108 cl::values(clEnumValN(NoPGO, "nopgo", "Do not use PGO."),
109 clEnumValN(InstrGen, "new-pm-pgo-instr-gen-pipeline",
110 "Instrument the IR to generate profile."),
111 clEnumValN(InstrUse, "new-pm-pgo-instr-use-pipeline",
112 "Use instrumented profile to guide PGO."),
113 clEnumValN(SampleUse, "new-pm-pgo-sample-use-pipeline",
114 "Use sampled profile to guide PGO.")));
115static cl::opt<std::string> ProfileFile(
116 "profile-file", cl::desc("Path to the profile."), cl::Hidden);
Richard Smith63ec2562018-10-10 23:13:47 +0000117static cl::opt<std::string>
118 ProfileRemappingFile("profile-remapping-file",
119 cl::desc("Path to the profile remapping file."),
120 cl::Hidden);
Dehao Chend2fb04a2017-07-26 15:01:20 +0000121static cl::opt<bool> DebugInfoForProfiling(
122 "new-pm-debug-info-for-profiling", cl::init(false), cl::Hidden,
123 cl::desc("Emit special debug info to enable PGO profile generation."));
Philip Pfaffe19045612017-07-10 10:57:55 +0000124/// @}}
125
Philip Pfaffeeb75f902017-07-11 11:17:44 +0000126template <typename PassManagerT>
Fedor Sergeevff886492018-10-17 10:36:23 +0000127bool tryParsePipelineText(PassBuilder &PB,
128 const cl::opt<std::string> &PipelineOpt) {
129 if (PipelineOpt.empty())
Philip Pfaffeeb75f902017-07-11 11:17:44 +0000130 return false;
131
132 // Verify the pipeline is parseable:
133 PassManagerT PM;
Fedor Sergeevff886492018-10-17 10:36:23 +0000134 if (auto Err = PB.parsePassPipeline(PM, PipelineOpt)) {
135 errs() << "Could not parse -" << PipelineOpt.ArgStr
136 << " pipeline: " << toString(std::move(Err))
137 << "... I'm going to ignore it.\n";
138 return false;
139 }
140 return true;
Philip Pfaffeeb75f902017-07-11 11:17:44 +0000141}
142
Philip Pfaffe19045612017-07-10 10:57:55 +0000143/// If one of the EPPipeline command line options was given, register callbacks
144/// for parsing and inserting the given pipeline
145static void registerEPCallbacks(PassBuilder &PB, bool VerifyEachPass,
146 bool DebugLogging) {
Philip Pfaffeeb75f902017-07-11 11:17:44 +0000147 if (tryParsePipelineText<FunctionPassManager>(PB, PeepholeEPPipeline))
Fedor Sergeevff886492018-10-17 10:36:23 +0000148 PB.registerPeepholeEPCallback(
149 [&PB, VerifyEachPass, DebugLogging](
150 FunctionPassManager &PM, PassBuilder::OptimizationLevel Level) {
151 ExitOnError Err("Unable to parse PeepholeEP pipeline: ");
152 Err(PB.parsePassPipeline(PM, PeepholeEPPipeline, VerifyEachPass,
153 DebugLogging));
154 });
Philip Pfaffeeb75f902017-07-11 11:17:44 +0000155 if (tryParsePipelineText<LoopPassManager>(PB,
156 LateLoopOptimizationsEPPipeline))
Philip Pfaffe19045612017-07-10 10:57:55 +0000157 PB.registerLateLoopOptimizationsEPCallback(
Philip Pfaffe45074ea2017-07-10 12:48:51 +0000158 [&PB, VerifyEachPass, DebugLogging](
159 LoopPassManager &PM, PassBuilder::OptimizationLevel Level) {
Fedor Sergeevff886492018-10-17 10:36:23 +0000160 ExitOnError Err("Unable to parse LateLoopOptimizationsEP pipeline: ");
161 Err(PB.parsePassPipeline(PM, LateLoopOptimizationsEPPipeline,
162 VerifyEachPass, DebugLogging));
Philip Pfaffe19045612017-07-10 10:57:55 +0000163 });
Philip Pfaffeeb75f902017-07-11 11:17:44 +0000164 if (tryParsePipelineText<LoopPassManager>(PB, LoopOptimizerEndEPPipeline))
Fedor Sergeevff886492018-10-17 10:36:23 +0000165 PB.registerLoopOptimizerEndEPCallback(
166 [&PB, VerifyEachPass, DebugLogging](
167 LoopPassManager &PM, PassBuilder::OptimizationLevel Level) {
168 ExitOnError Err("Unable to parse LoopOptimizerEndEP pipeline: ");
169 Err(PB.parsePassPipeline(PM, LoopOptimizerEndEPPipeline,
170 VerifyEachPass, DebugLogging));
171 });
Philip Pfaffeeb75f902017-07-11 11:17:44 +0000172 if (tryParsePipelineText<FunctionPassManager>(PB,
173 ScalarOptimizerLateEPPipeline))
Philip Pfaffe19045612017-07-10 10:57:55 +0000174 PB.registerScalarOptimizerLateEPCallback(
Philip Pfaffe45074ea2017-07-10 12:48:51 +0000175 [&PB, VerifyEachPass, DebugLogging](
176 FunctionPassManager &PM, PassBuilder::OptimizationLevel Level) {
Fedor Sergeevff886492018-10-17 10:36:23 +0000177 ExitOnError Err("Unable to parse ScalarOptimizerLateEP pipeline: ");
178 Err(PB.parsePassPipeline(PM, ScalarOptimizerLateEPPipeline,
179 VerifyEachPass, DebugLogging));
Philip Pfaffe19045612017-07-10 10:57:55 +0000180 });
Philip Pfaffeeb75f902017-07-11 11:17:44 +0000181 if (tryParsePipelineText<CGSCCPassManager>(PB, CGSCCOptimizerLateEPPipeline))
Fedor Sergeevff886492018-10-17 10:36:23 +0000182 PB.registerCGSCCOptimizerLateEPCallback(
183 [&PB, VerifyEachPass, DebugLogging](
184 CGSCCPassManager &PM, PassBuilder::OptimizationLevel Level) {
185 ExitOnError Err("Unable to parse CGSCCOptimizerLateEP pipeline: ");
186 Err(PB.parsePassPipeline(PM, CGSCCOptimizerLateEPPipeline,
187 VerifyEachPass, DebugLogging));
188 });
Philip Pfaffeeb75f902017-07-11 11:17:44 +0000189 if (tryParsePipelineText<FunctionPassManager>(PB, VectorizerStartEPPipeline))
Fedor Sergeevff886492018-10-17 10:36:23 +0000190 PB.registerVectorizerStartEPCallback(
191 [&PB, VerifyEachPass, DebugLogging](
192 FunctionPassManager &PM, PassBuilder::OptimizationLevel Level) {
193 ExitOnError Err("Unable to parse VectorizerStartEP pipeline: ");
194 Err(PB.parsePassPipeline(PM, VectorizerStartEPPipeline,
195 VerifyEachPass, DebugLogging));
196 });
David Blaikie0ac87472018-01-23 01:25:20 +0000197 if (tryParsePipelineText<ModulePassManager>(PB, PipelineStartEPPipeline))
198 PB.registerPipelineStartEPCallback(
199 [&PB, VerifyEachPass, DebugLogging](ModulePassManager &PM) {
Fedor Sergeevff886492018-10-17 10:36:23 +0000200 ExitOnError Err("Unable to parse PipelineStartEP pipeline: ");
201 Err(PB.parsePassPipeline(PM, PipelineStartEPPipeline, VerifyEachPass,
202 DebugLogging));
David Blaikie0ac87472018-01-23 01:25:20 +0000203 });
Philip Pfaffe0c20a4d2018-11-12 11:17:07 +0000204 if (tryParsePipelineText<FunctionPassManager>(PB, OptimizerLastEPPipeline))
205 PB.registerOptimizerLastEPCallback(
206 [&PB, VerifyEachPass, DebugLogging](FunctionPassManager &PM,
207 PassBuilder::OptimizationLevel) {
Philip Pfaffed3733c22018-11-12 12:27:58 +0000208 ExitOnError Err("Unable to parse OptimizerLastEP pipeline: ");
209 Err(PB.parsePassPipeline(PM, OptimizerLastEPPipeline, VerifyEachPass,
210 DebugLogging));
Philip Pfaffe0c20a4d2018-11-12 11:17:07 +0000211 });
Philip Pfaffe19045612017-07-10 10:57:55 +0000212}
213
Philip Pfaffe38988092017-08-04 09:28:09 +0000214#ifdef LINK_POLLY_INTO_TOOLS
215namespace polly {
216void RegisterPollyPasses(PassBuilder &);
217}
218#endif
219
Tim Shen2e378852017-06-01 01:02:12 +0000220bool llvm::runPassPipeline(StringRef Arg0, Module &M, TargetMachine *TM,
Reid Kleckner97ca9642017-09-23 01:03:17 +0000221 ToolOutputFile *Out, ToolOutputFile *ThinLTOLinkOut,
222 ToolOutputFile *OptRemarkFile,
Chandler Carruth7724e8e2015-02-01 10:11:22 +0000223 StringRef PassPipeline, OutputKind OK,
Duncan P. N. Exon Smithe005d712015-04-15 00:34:24 +0000224 VerifierKind VK,
Duncan P. N. Exon Smith2c7f24d2015-04-15 02:38:06 +0000225 bool ShouldPreserveAssemblyUseListOrder,
Teresa Johnson3143f332016-08-12 13:53:02 +0000226 bool ShouldPreserveBitcodeUseListOrder,
Vedant Kumarb8c067b2018-02-15 21:14:36 +0000227 bool EmitSummaryIndex, bool EmitModuleHash,
228 bool EnableDebugify) {
Philip Pfaffe19045612017-07-10 10:57:55 +0000229 bool VerifyEachPass = VK == VK_VerifyEachPass;
Dehao Chenc87493d2017-07-26 02:00:43 +0000230
231 Optional<PGOOptions> P;
232 switch (PGOKindFlag) {
233 case InstrGen:
Richard Smith63ec2562018-10-10 23:13:47 +0000234 P = PGOOptions(ProfileFile, "", "", "", true);
Dehao Chenc87493d2017-07-26 02:00:43 +0000235 break;
236 case InstrUse:
Richard Smith63ec2562018-10-10 23:13:47 +0000237 P = PGOOptions("", ProfileFile, "", ProfileRemappingFile, false);
Dehao Chenc87493d2017-07-26 02:00:43 +0000238 break;
239 case SampleUse:
Richard Smith63ec2562018-10-10 23:13:47 +0000240 P = PGOOptions("", "", ProfileFile, ProfileRemappingFile, false);
Dehao Chenc87493d2017-07-26 02:00:43 +0000241 break;
242 case NoPGO:
Dehao Chend2fb04a2017-07-26 15:01:20 +0000243 if (DebugInfoForProfiling)
Richard Smith63ec2562018-10-10 23:13:47 +0000244 P = PGOOptions("", "", "", "", false, true);
Dehao Chend2fb04a2017-07-26 15:01:20 +0000245 else
246 P = None;
Dehao Chenc87493d2017-07-26 02:00:43 +0000247 }
Fedor Sergeeva7c23702018-09-24 16:08:15 +0000248 PassInstrumentationCallbacks PIC;
249 StandardInstrumentations SI;
250 SI.registerCallbacks(PIC);
251
252 PassBuilder PB(TM, P, &PIC);
Philip Pfaffe19045612017-07-10 10:57:55 +0000253 registerEPCallbacks(PB, VerifyEachPass, DebugPM);
Chandler Carruth581ef382015-02-01 07:40:05 +0000254
Philip Pfaffe53016772018-04-05 15:04:13 +0000255 // Load requested pass plugins and let them register pass builder callbacks
256 for (auto &PluginFN : PassPlugins) {
257 auto PassPlugin = PassPlugin::Load(PluginFN);
258 if (!PassPlugin) {
259 errs() << "Failed to load passes from '" << PluginFN
260 << "'. Request ignored.\n";
261 continue;
262 }
263
264 PassPlugin->registerPassBuilderCallbacks(PB);
265 }
266
Vedant Kumarb8c067b2018-02-15 21:14:36 +0000267 // Register a callback that creates the debugify passes as needed.
268 PB.registerPipelineParsingCallback(
269 [](StringRef Name, ModulePassManager &MPM,
270 ArrayRef<PassBuilder::PipelineElement>) {
271 if (Name == "debugify") {
272 MPM.addPass(NewPMDebugifyPass());
273 return true;
274 } else if (Name == "check-debugify") {
275 MPM.addPass(NewPMCheckDebugifyPass());
276 return true;
277 }
278 return false;
279 });
280
Philip Pfaffe38988092017-08-04 09:28:09 +0000281#ifdef LINK_POLLY_INTO_TOOLS
282 polly::RegisterPollyPasses(PB);
283#endif
284
Chandler Carruth67a41f02016-02-18 09:45:17 +0000285 // Specially handle the alias analysis manager so that we can register
286 // a custom pipeline of AA passes with it.
287 AAManager AA;
Fedor Sergeevff886492018-10-17 10:36:23 +0000288 if (auto Err = PB.parseAAPipeline(AA, AAPipeline)) {
289 errs() << Arg0 << ": " << toString(std::move(Err)) << "\n";
Chandler Carruth67a41f02016-02-18 09:45:17 +0000290 return false;
291 }
292
Justin Bognerda5e9242016-02-25 07:23:08 +0000293 LoopAnalysisManager LAM(DebugPM);
Chandler Carruth3c95d9c2015-01-13 22:42:38 +0000294 FunctionAnalysisManager FAM(DebugPM);
295 CGSCCAnalysisManager CGAM(DebugPM);
296 ModuleAnalysisManager MAM(DebugPM);
Chandler Carruth1d9ab252014-01-20 11:34:08 +0000297
Chandler Carruth67a41f02016-02-18 09:45:17 +0000298 // Register the AA manager first so that our version is the one used.
299 FAM.registerPass([&] { return std::move(AA); });
300
Chandler Carruth2bbc5ab2015-01-06 02:21:37 +0000301 // Register all the basic analyses with the managers.
Chandler Carruth23491362015-03-07 09:02:36 +0000302 PB.registerModuleAnalyses(MAM);
303 PB.registerCGSCCAnalyses(CGAM);
304 PB.registerFunctionAnalyses(FAM);
Justin Bognerda5e9242016-02-25 07:23:08 +0000305 PB.registerLoopAnalyses(LAM);
Davide Italianod1aa4ea2016-05-14 23:21:50 +0000306 PB.crossRegisterProxies(LAM, FAM, CGAM, MAM);
Chandler Carruthd8e62b62014-02-06 04:25:13 +0000307
Chandler Carruth3c95d9c2015-01-13 22:42:38 +0000308 ModulePassManager MPM(DebugPM);
Chandler Carruth1d9ab252014-01-20 11:34:08 +0000309 if (VK > VK_NoVerifier)
310 MPM.addPass(VerifierPass());
Vedant Kumarb8c067b2018-02-15 21:14:36 +0000311 if (EnableDebugify)
312 MPM.addPass(NewPMDebugifyPass());
Chandler Carruth1d9ab252014-01-20 11:34:08 +0000313
Fedor Sergeevff886492018-10-17 10:36:23 +0000314 if (auto Err =
315 PB.parsePassPipeline(MPM, PassPipeline, VerifyEachPass, DebugPM)) {
316 errs() << Arg0 << ": " << toString(std::move(Err)) << "\n";
Chandler Carruth4e728be2014-01-11 08:16:35 +0000317 return false;
318 }
319
Chandler Carruth1d9ab252014-01-20 11:34:08 +0000320 if (VK > VK_NoVerifier)
321 MPM.addPass(VerifierPass());
Vedant Kumarb8c067b2018-02-15 21:14:36 +0000322 if (EnableDebugify)
323 MPM.addPass(NewPMCheckDebugifyPass());
Chandler Carruth1d9ab252014-01-20 11:34:08 +0000324
Chandler Carruth085c07f2014-01-13 05:16:45 +0000325 // Add any relevant output pass at the end of the pipeline.
326 switch (OK) {
327 case OK_NoOutput:
328 break; // No output pass needed.
329 case OK_OutputAssembly:
Duncan P. N. Exon Smith2c7f24d2015-04-15 02:38:06 +0000330 MPM.addPass(
331 PrintModulePass(Out->os(), "", ShouldPreserveAssemblyUseListOrder));
Chandler Carruth085c07f2014-01-13 05:16:45 +0000332 break;
333 case OK_OutputBitcode:
Teresa Johnson3143f332016-08-12 13:53:02 +0000334 MPM.addPass(BitcodeWriterPass(Out->os(), ShouldPreserveBitcodeUseListOrder,
335 EmitSummaryIndex, EmitModuleHash));
Chandler Carruthe2dc71d2014-01-13 07:38:24 +0000336 break;
Tim Shen2e378852017-06-01 01:02:12 +0000337 case OK_OutputThinLTOBitcode:
338 MPM.addPass(ThinLTOBitcodeWriterPass(
339 Out->os(), ThinLTOLinkOut ? &ThinLTOLinkOut->os() : nullptr));
340 break;
Chandler Carruth085c07f2014-01-13 05:16:45 +0000341 }
342
343 // Before executing passes, print the final values of the LLVM options.
344 cl::PrintOptionValues();
345
Chandler Carruth4e728be2014-01-11 08:16:35 +0000346 // Now that we have all of the passes ready, run them.
Chandler Carruth8e27cb22016-03-11 11:05:24 +0000347 MPM.run(M, MAM);
Chandler Carruth4e728be2014-01-11 08:16:35 +0000348
349 // Declare success.
Tim Shen2e378852017-06-01 01:02:12 +0000350 if (OK != OK_NoOutput) {
Chandler Carruth4e728be2014-01-11 08:16:35 +0000351 Out->keep();
Tim Shen2e378852017-06-01 01:02:12 +0000352 if (OK == OK_OutputThinLTOBitcode && ThinLTOLinkOut)
353 ThinLTOLinkOut->keep();
354 }
Sam Elliott74a34d92017-08-20 01:30:45 +0000355
356 if (OptRemarkFile)
357 OptRemarkFile->keep();
358
Chandler Carruth4e728be2014-01-11 08:16:35 +0000359 return true;
360}