blob: 2008c5d65ee98d558fcc49bf5f6f8ab2421f8fbb [file] [log] [blame]
Rafael Espindolac684e832011-08-02 21:50:27 +00001//===- PassManagerBuilder.cpp - Build Standard Pass -----------------------===//
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//
10// This file defines the PassManagerBuilder class, which is used to set up a
11// "standard" optimization sequence suitable for languages like C and C++.
12//
13//===----------------------------------------------------------------------===//
14
15
16#include "llvm/Transforms/IPO/PassManagerBuilder.h"
Rafael Espindola69cb2162011-08-09 22:17:34 +000017#include "llvm-c/Transforms/PassManagerBuilder.h"
Chandler Carruthd04a8d42012-12-03 16:50:05 +000018#include "llvm/ADT/SmallVector.h"
Rafael Espindolac684e832011-08-02 21:50:27 +000019#include "llvm/Analysis/Passes.h"
Hal Finkelde5e5ec2012-02-01 03:51:43 +000020#include "llvm/Analysis/Verifier.h"
Chandler Carruthd04a8d42012-12-03 16:50:05 +000021#include "llvm/PassManager.h"
Hal Finkelde5e5ec2012-02-01 03:51:43 +000022#include "llvm/Support/CommandLine.h"
Chandler Carruthd04a8d42012-12-03 16:50:05 +000023#include "llvm/Support/ManagedStatic.h"
Rafael Espindolac684e832011-08-02 21:50:27 +000024#include "llvm/Target/TargetLibraryInfo.h"
Chandler Carruthd04a8d42012-12-03 16:50:05 +000025#include "llvm/Transforms/IPO.h"
Rafael Espindolac684e832011-08-02 21:50:27 +000026#include "llvm/Transforms/Scalar.h"
Hal Finkelde5e5ec2012-02-01 03:51:43 +000027#include "llvm/Transforms/Vectorize.h"
Rafael Espindolac684e832011-08-02 21:50:27 +000028
29using namespace llvm;
30
Hal Finkelde5e5ec2012-02-01 03:51:43 +000031static cl::opt<bool>
Andrew Trick76c25dc2013-03-06 19:04:56 +000032RunLoopVectorization("vectorize-loops",
Nadav Rotem9210cc32012-10-30 18:37:43 +000033 cl::desc("Run the Loop vectorization passes"));
Nadav Rotemd233b782012-10-29 16:36:25 +000034
35static cl::opt<bool>
Nadav Rotem7b15c0a2013-09-03 21:33:17 +000036LateVectorization("late-vectorize", cl::init(true), cl::Hidden,
Chandler Carruth6bf3a052013-06-24 07:21:47 +000037 cl::desc("Run the vectorization pasess late in the pass "
38 "pipeline (after the inliner)"));
39
40static cl::opt<bool>
Nadav Rotem1129a832013-04-15 05:39:58 +000041RunSLPVectorization("vectorize-slp",
42 cl::desc("Run the SLP vectorization passes"));
43
44static cl::opt<bool>
45RunBBVectorization("vectorize-slp-aggressive",
46 cl::desc("Run the BB vectorization passes"));
Hal Finkelde5e5ec2012-02-01 03:51:43 +000047
Hal Finkel064551e2012-04-13 17:15:33 +000048static cl::opt<bool>
49UseGVNAfterVectorization("use-gvn-after-vectorization",
50 cl::init(false), cl::Hidden,
51 cl::desc("Run GVN instead of Early CSE after vectorization passes"));
52
Chandler Carruth713aa942012-09-14 09:22:59 +000053static cl::opt<bool> UseNewSROA("use-new-sroa",
Chandler Carruth1fe4fae2012-10-02 04:24:01 +000054 cl::init(true), cl::Hidden,
Chandler Carruth713aa942012-09-14 09:22:59 +000055 cl::desc("Enable the new, experimental SROA pass"));
56
Rafael Espindolac684e832011-08-02 21:50:27 +000057PassManagerBuilder::PassManagerBuilder() {
58 OptLevel = 2;
59 SizeLevel = 0;
60 LibraryInfo = 0;
61 Inliner = 0;
Rafael Espindolac684e832011-08-02 21:50:27 +000062 DisableUnitAtATime = false;
63 DisableUnrollLoops = false;
Nadav Rotem1129a832013-04-15 05:39:58 +000064 BBVectorize = RunBBVectorization;
Nadav Rotem88498382013-04-15 04:54:42 +000065 SLPVectorize = RunSLPVectorization;
Nadav Rotemd233b782012-10-29 16:36:25 +000066 LoopVectorize = RunLoopVectorization;
Chandler Carruth6bf3a052013-06-24 07:21:47 +000067 LateVectorize = LateVectorization;
Rafael Espindolac684e832011-08-02 21:50:27 +000068}
69
70PassManagerBuilder::~PassManagerBuilder() {
71 delete LibraryInfo;
72 delete Inliner;
73}
74
David Chisnall7a817ea2011-08-16 13:58:41 +000075/// Set of global extensions, automatically added as part of the standard set.
76static ManagedStatic<SmallVector<std::pair<PassManagerBuilder::ExtensionPointTy,
77 PassManagerBuilder::ExtensionFn>, 8> > GlobalExtensions;
78
79void PassManagerBuilder::addGlobalExtension(
80 PassManagerBuilder::ExtensionPointTy Ty,
81 PassManagerBuilder::ExtensionFn Fn) {
82 GlobalExtensions->push_back(std::make_pair(Ty, Fn));
83}
84
Rafael Espindolac684e832011-08-02 21:50:27 +000085void PassManagerBuilder::addExtension(ExtensionPointTy Ty, ExtensionFn Fn) {
86 Extensions.push_back(std::make_pair(Ty, Fn));
87}
88
89void PassManagerBuilder::addExtensionsToPM(ExtensionPointTy ETy,
90 PassManagerBase &PM) const {
David Chisnall7a817ea2011-08-16 13:58:41 +000091 for (unsigned i = 0, e = GlobalExtensions->size(); i != e; ++i)
92 if ((*GlobalExtensions)[i].first == ETy)
93 (*GlobalExtensions)[i].second(*this, PM);
Rafael Espindolac684e832011-08-02 21:50:27 +000094 for (unsigned i = 0, e = Extensions.size(); i != e; ++i)
95 if (Extensions[i].first == ETy)
96 Extensions[i].second(*this, PM);
97}
98
99void
100PassManagerBuilder::addInitialAliasAnalysisPasses(PassManagerBase &PM) const {
101 // Add TypeBasedAliasAnalysis before BasicAliasAnalysis so that
102 // BasicAliasAnalysis wins if they disagree. This is intended to help
103 // support "obvious" type-punning idioms.
104 PM.add(createTypeBasedAliasAnalysisPass());
105 PM.add(createBasicAliasAnalysisPass());
106}
107
108void PassManagerBuilder::populateFunctionPassManager(FunctionPassManager &FPM) {
109 addExtensionsToPM(EP_EarlyAsPossible, FPM);
110
111 // Add LibraryInfo if we have some.
112 if (LibraryInfo) FPM.add(new TargetLibraryInfo(*LibraryInfo));
113
114 if (OptLevel == 0) return;
115
116 addInitialAliasAnalysisPasses(FPM);
117
118 FPM.add(createCFGSimplificationPass());
Chandler Carruth713aa942012-09-14 09:22:59 +0000119 if (UseNewSROA)
120 FPM.add(createSROAPass());
121 else
122 FPM.add(createScalarReplAggregatesPass());
Rafael Espindolac684e832011-08-02 21:50:27 +0000123 FPM.add(createEarlyCSEPass());
124 FPM.add(createLowerExpectIntrinsicPass());
125}
126
127void PassManagerBuilder::populateModulePassManager(PassManagerBase &MPM) {
128 // If all optimizations are disabled, just run the always-inline pass.
129 if (OptLevel == 0) {
130 if (Inliner) {
131 MPM.add(Inliner);
132 Inliner = 0;
133 }
Chandler Carruth63a1eb62012-10-18 08:05:46 +0000134
135 // FIXME: This is a HACK! The inliner pass above implicitly creates a CGSCC
136 // pass manager, but we don't want to add extensions into that pass manager.
137 // To prevent this we must insert a no-op module pass to reset the pass
138 // manager to get the same behavior as EP_OptimizerLast in non-O0 builds.
139 if (!GlobalExtensions->empty() || !Extensions.empty())
140 MPM.add(createBarrierNoopPass());
141
Kostya Serebryanyaf65a8c2011-11-30 22:19:26 +0000142 addExtensionsToPM(EP_EnabledOnOptLevel0, MPM);
Rafael Espindolac684e832011-08-02 21:50:27 +0000143 return;
144 }
145
146 // Add LibraryInfo if we have some.
147 if (LibraryInfo) MPM.add(new TargetLibraryInfo(*LibraryInfo));
148
149 addInitialAliasAnalysisPasses(MPM);
150
151 if (!DisableUnitAtATime) {
Dan Gohman7d4c87e2012-01-17 20:51:32 +0000152 addExtensionsToPM(EP_ModuleOptimizerEarly, MPM);
153
Rafael Espindolac684e832011-08-02 21:50:27 +0000154 MPM.add(createGlobalOptimizerPass()); // Optimize out global vars
155
156 MPM.add(createIPSCCPPass()); // IP SCCP
157 MPM.add(createDeadArgEliminationPass()); // Dead argument elimination
158
159 MPM.add(createInstructionCombiningPass());// Clean up after IPCP & DAE
160 MPM.add(createCFGSimplificationPass()); // Clean up after IPCP & DAE
161 }
162
163 // Start of CallGraph SCC passes.
164 if (!DisableUnitAtATime)
165 MPM.add(createPruneEHPass()); // Remove dead EH info
166 if (Inliner) {
167 MPM.add(Inliner);
168 Inliner = 0;
169 }
170 if (!DisableUnitAtATime)
171 MPM.add(createFunctionAttrsPass()); // Set readonly/readnone attrs
172 if (OptLevel > 2)
173 MPM.add(createArgumentPromotionPass()); // Scalarize uninlined fn args
174
175 // Start of function pass.
176 // Break up aggregate allocas, using SSAUpdater.
Chandler Carruth1c8db502012-09-15 11:43:14 +0000177 if (UseNewSROA)
178 MPM.add(createSROAPass(/*RequiresDomTree*/ false));
179 else
180 MPM.add(createScalarReplAggregatesPass(-1, false));
Rafael Espindolac684e832011-08-02 21:50:27 +0000181 MPM.add(createEarlyCSEPass()); // Catch trivial redundancies
Rafael Espindolac684e832011-08-02 21:50:27 +0000182 MPM.add(createJumpThreadingPass()); // Thread jumps.
183 MPM.add(createCorrelatedValuePropagationPass()); // Propagate conditionals
184 MPM.add(createCFGSimplificationPass()); // Merge & remove BBs
185 MPM.add(createInstructionCombiningPass()); // Combine silly seq's
186
187 MPM.add(createTailCallEliminationPass()); // Eliminate tail calls
188 MPM.add(createCFGSimplificationPass()); // Merge & remove BBs
189 MPM.add(createReassociatePass()); // Reassociate expressions
190 MPM.add(createLoopRotatePass()); // Rotate Loop
191 MPM.add(createLICMPass()); // Hoist loop invariants
192 MPM.add(createLoopUnswitchPass(SizeLevel || OptLevel < 3));
193 MPM.add(createInstructionCombiningPass());
194 MPM.add(createIndVarSimplifyPass()); // Canonicalize indvars
195 MPM.add(createLoopIdiomPass()); // Recognize idioms like memset.
196 MPM.add(createLoopDeletionPass()); // Delete dead loops
Nadav Rotemd15c0c72012-10-17 18:25:06 +0000197
Arnold Schwaighoferb6171c52013-08-13 15:51:25 +0000198 if (!LateVectorize && LoopVectorize)
Hal Finkel435798e2013-08-28 18:33:10 +0000199 MPM.add(createLoopVectorizePass(DisableUnrollLoops));
Nadav Rotemd15c0c72012-10-17 18:25:06 +0000200
Rafael Espindolac684e832011-08-02 21:50:27 +0000201 if (!DisableUnrollLoops)
202 MPM.add(createLoopUnrollPass()); // Unroll small loops
203 addExtensionsToPM(EP_LoopOptimizerEnd, MPM);
204
205 if (OptLevel > 1)
206 MPM.add(createGVNPass()); // Remove redundancies
207 MPM.add(createMemCpyOptPass()); // Remove memcpy / form memset
208 MPM.add(createSCCPPass()); // Constant prop with SCCP
209
210 // Run instcombine after redundancy elimination to exploit opportunities
211 // opened up by them.
212 MPM.add(createInstructionCombiningPass());
213 MPM.add(createJumpThreadingPass()); // Thread jumps
214 MPM.add(createCorrelatedValuePropagationPass());
215 MPM.add(createDeadStoreEliminationPass()); // Delete dead stores
216
217 addExtensionsToPM(EP_ScalarOptimizerLate, MPM);
218
Nadav Rotemf1cd7982013-08-28 23:40:29 +0000219 if (SLPVectorize)
220 MPM.add(createSLPVectorizerPass()); // Vectorize parallel scalar chains.
Nadav Rotem1129a832013-04-15 05:39:58 +0000221
Nadav Rotemf1cd7982013-08-28 23:40:29 +0000222 if (BBVectorize) {
223 MPM.add(createBBVectorizePass());
224 MPM.add(createInstructionCombiningPass());
225 if (OptLevel > 1 && UseGVNAfterVectorization)
226 MPM.add(createGVNPass()); // Remove redundancies
227 else
228 MPM.add(createEarlyCSEPass()); // Catch trivial redundancies
Hal Finkelc0b3d4c2013-01-29 00:22:49 +0000229
Nadav Rotemf1cd7982013-08-28 23:40:29 +0000230 // BBVectorize may have significantly shortened a loop body; unroll again.
231 if (!DisableUnrollLoops)
232 MPM.add(createLoopUnrollPass());
Hal Finkelde5e5ec2012-02-01 03:51:43 +0000233 }
234
Rafael Espindolac684e832011-08-02 21:50:27 +0000235 MPM.add(createAggressiveDCEPass()); // Delete dead instructions
Tom Stellard01d72032013-08-06 02:43:45 +0000236 MPM.add(createCFGSimplificationPass()); // Merge & remove BBs
Rafael Espindolac684e832011-08-02 21:50:27 +0000237 MPM.add(createInstructionCombiningPass()); // Clean up after everything.
238
Chandler Carruth6bf3a052013-06-24 07:21:47 +0000239 // As an experimental mode, run any vectorization passes in a separate
240 // pipeline from the CGSCC pass manager that runs iteratively with the
241 // inliner.
Nadav Rotemf1cd7982013-08-28 23:40:29 +0000242 if (LateVectorize && LoopVectorize) {
Chandler Carruth6bf3a052013-06-24 07:21:47 +0000243 // FIXME: This is a HACK! The inliner pass above implicitly creates a CGSCC
244 // pass manager that we are specifically trying to avoid. To prevent this
245 // we must insert a no-op module pass to reset the pass manager.
246 MPM.add(createBarrierNoopPass());
247
248 // Add the various vectorization passes and relevant cleanup passes for
249 // them since we are no longer in the middle of the main scalar pipeline.
Nadav Rotemf1cd7982013-08-28 23:40:29 +0000250 MPM.add(createLoopVectorizePass(DisableUnrollLoops));
251 MPM.add(createInstructionCombiningPass());
252 MPM.add(createCFGSimplificationPass());
Chandler Carruth6bf3a052013-06-24 07:21:47 +0000253 }
254
Rafael Espindolac684e832011-08-02 21:50:27 +0000255 if (!DisableUnitAtATime) {
256 // FIXME: We shouldn't bother with this anymore.
257 MPM.add(createStripDeadPrototypesPass()); // Get rid of dead prototypes
258
Evan Chengf5fdc142012-09-28 21:23:26 +0000259 // GlobalOpt already deletes dead functions and globals, at -O2 try a
Rafael Espindolac684e832011-08-02 21:50:27 +0000260 // late pass of GlobalDCE. It is capable of deleting dead cycles.
Evan Chengf5fdc142012-09-28 21:23:26 +0000261 if (OptLevel > 1) {
Rafael Espindolac684e832011-08-02 21:50:27 +0000262 MPM.add(createGlobalDCEPass()); // Remove dead fns and globals.
Rafael Espindolac684e832011-08-02 21:50:27 +0000263 MPM.add(createConstantMergePass()); // Merge dup global constants
Evan Chengf5fdc142012-09-28 21:23:26 +0000264 }
Rafael Espindolac684e832011-08-02 21:50:27 +0000265 }
Kostya Serebryany1db39492012-03-23 23:22:59 +0000266 addExtensionsToPM(EP_OptimizerLast, MPM);
Rafael Espindolac684e832011-08-02 21:50:27 +0000267}
268
269void PassManagerBuilder::populateLTOPassManager(PassManagerBase &PM,
270 bool Internalize,
Bill Wendling3197b442012-04-02 22:16:50 +0000271 bool RunInliner,
272 bool DisableGVNLoadPRE) {
Rafael Espindolac684e832011-08-02 21:50:27 +0000273 // Provide AliasAnalysis services for optimizations.
274 addInitialAliasAnalysisPasses(PM);
275
276 // Now that composite has been compiled, scan through the module, looking
277 // for a main function. If main is defined, mark all other functions
278 // internal.
Bill Wendling6e4d93b2013-08-30 00:48:37 +0000279 if (Internalize)
280 PM.add(createInternalizePass("main"));
Rafael Espindolac684e832011-08-02 21:50:27 +0000281
282 // Propagate constants at call sites into the functions they call. This
283 // opens opportunities for globalopt (and inlining) by substituting function
284 // pointers passed as arguments to direct uses of functions.
285 PM.add(createIPSCCPPass());
286
287 // Now that we internalized some globals, see if we can hack on them!
288 PM.add(createGlobalOptimizerPass());
289
290 // Linking modules together can lead to duplicated global constants, only
291 // keep one copy of each constant.
292 PM.add(createConstantMergePass());
293
294 // Remove unused arguments from functions.
295 PM.add(createDeadArgEliminationPass());
296
297 // Reduce the code after globalopt and ipsccp. Both can open up significant
298 // simplification opportunities, and both can propagate functions through
299 // function pointers. When this happens, we often have to resolve varargs
300 // calls, etc, so let instcombine do this.
301 PM.add(createInstructionCombiningPass());
302
303 // Inline small functions
304 if (RunInliner)
305 PM.add(createFunctionInliningPass());
306
307 PM.add(createPruneEHPass()); // Remove dead EH info.
308
309 // Optimize globals again if we ran the inliner.
310 if (RunInliner)
311 PM.add(createGlobalOptimizerPass());
312 PM.add(createGlobalDCEPass()); // Remove dead functions.
313
314 // If we didn't decide to inline a function, check to see if we can
315 // transform it to pass arguments by value instead of by reference.
316 PM.add(createArgumentPromotionPass());
317
318 // The IPO passes may leave cruft around. Clean up after them.
319 PM.add(createInstructionCombiningPass());
320 PM.add(createJumpThreadingPass());
Bill Wendling6e4d93b2013-08-30 00:48:37 +0000321
Rafael Espindolac684e832011-08-02 21:50:27 +0000322 // Break up allocas
Chandler Carruth713aa942012-09-14 09:22:59 +0000323 if (UseNewSROA)
324 PM.add(createSROAPass());
325 else
326 PM.add(createScalarReplAggregatesPass());
Rafael Espindolac684e832011-08-02 21:50:27 +0000327
328 // Run a few AA driven optimizations here and now, to cleanup the code.
329 PM.add(createFunctionAttrsPass()); // Add nocapture.
330 PM.add(createGlobalsModRefPass()); // IP alias analysis.
331
Bill Wendling3197b442012-04-02 22:16:50 +0000332 PM.add(createLICMPass()); // Hoist loop invariants.
333 PM.add(createGVNPass(DisableGVNLoadPRE)); // Remove redundancies.
334 PM.add(createMemCpyOptPass()); // Remove dead memcpys.
Bill Wendling6e4d93b2013-08-30 00:48:37 +0000335
Rafael Espindolac684e832011-08-02 21:50:27 +0000336 // Nuke dead stores.
337 PM.add(createDeadStoreEliminationPass());
338
339 // Cleanup and simplify the code after the scalar optimizations.
340 PM.add(createInstructionCombiningPass());
341
342 PM.add(createJumpThreadingPass());
343
344 // Delete basic blocks, which optimization passes may have killed.
Tom Stellard01d72032013-08-06 02:43:45 +0000345 PM.add(createCFGSimplificationPass());
Rafael Espindolac684e832011-08-02 21:50:27 +0000346
347 // Now that we have optimized the program, discard unreachable functions.
348 PM.add(createGlobalDCEPass());
349}
Rafael Espindola69cb2162011-08-09 22:17:34 +0000350
Eric Christopher3e397312013-04-22 22:47:22 +0000351inline PassManagerBuilder *unwrap(LLVMPassManagerBuilderRef P) {
352 return reinterpret_cast<PassManagerBuilder*>(P);
353}
354
355inline LLVMPassManagerBuilderRef wrap(PassManagerBuilder *P) {
356 return reinterpret_cast<LLVMPassManagerBuilderRef>(P);
357}
358
Dmitri Gribenko79c07d22012-11-15 16:51:49 +0000359LLVMPassManagerBuilderRef LLVMPassManagerBuilderCreate() {
Rafael Espindola69cb2162011-08-09 22:17:34 +0000360 PassManagerBuilder *PMB = new PassManagerBuilder();
361 return wrap(PMB);
362}
363
364void LLVMPassManagerBuilderDispose(LLVMPassManagerBuilderRef PMB) {
365 PassManagerBuilder *Builder = unwrap(PMB);
366 delete Builder;
367}
368
369void
370LLVMPassManagerBuilderSetOptLevel(LLVMPassManagerBuilderRef PMB,
371 unsigned OptLevel) {
372 PassManagerBuilder *Builder = unwrap(PMB);
373 Builder->OptLevel = OptLevel;
374}
375
376void
377LLVMPassManagerBuilderSetSizeLevel(LLVMPassManagerBuilderRef PMB,
378 unsigned SizeLevel) {
379 PassManagerBuilder *Builder = unwrap(PMB);
380 Builder->SizeLevel = SizeLevel;
381}
382
383void
384LLVMPassManagerBuilderSetDisableUnitAtATime(LLVMPassManagerBuilderRef PMB,
385 LLVMBool Value) {
386 PassManagerBuilder *Builder = unwrap(PMB);
387 Builder->DisableUnitAtATime = Value;
388}
389
390void
391LLVMPassManagerBuilderSetDisableUnrollLoops(LLVMPassManagerBuilderRef PMB,
392 LLVMBool Value) {
393 PassManagerBuilder *Builder = unwrap(PMB);
394 Builder->DisableUnrollLoops = Value;
395}
396
397void
398LLVMPassManagerBuilderSetDisableSimplifyLibCalls(LLVMPassManagerBuilderRef PMB,
399 LLVMBool Value) {
Meador Ingebe87bce2013-06-20 19:48:07 +0000400 // NOTE: The simplify-libcalls pass has been removed.
Rafael Espindola69cb2162011-08-09 22:17:34 +0000401}
402
403void
404LLVMPassManagerBuilderUseInlinerWithThreshold(LLVMPassManagerBuilderRef PMB,
405 unsigned Threshold) {
406 PassManagerBuilder *Builder = unwrap(PMB);
407 Builder->Inliner = createFunctionInliningPass(Threshold);
408}
409
410void
411LLVMPassManagerBuilderPopulateFunctionPassManager(LLVMPassManagerBuilderRef PMB,
412 LLVMPassManagerRef PM) {
413 PassManagerBuilder *Builder = unwrap(PMB);
414 FunctionPassManager *FPM = unwrap<FunctionPassManager>(PM);
415 Builder->populateFunctionPassManager(*FPM);
416}
417
418void
419LLVMPassManagerBuilderPopulateModulePassManager(LLVMPassManagerBuilderRef PMB,
420 LLVMPassManagerRef PM) {
421 PassManagerBuilder *Builder = unwrap(PMB);
422 PassManagerBase *MPM = unwrap(PM);
423 Builder->populateModulePassManager(*MPM);
424}
425
426void LLVMPassManagerBuilderPopulateLTOPassManager(LLVMPassManagerBuilderRef PMB,
427 LLVMPassManagerRef PM,
Nick Lewycky0ebc0842013-03-10 21:58:22 +0000428 LLVMBool Internalize,
429 LLVMBool RunInliner) {
Rafael Espindola69cb2162011-08-09 22:17:34 +0000430 PassManagerBuilder *Builder = unwrap(PMB);
431 PassManagerBase *LPM = unwrap(PM);
Nick Lewycky0ebc0842013-03-10 21:58:22 +0000432 Builder->populateLTOPassManager(*LPM, Internalize != 0, RunInliner != 0);
Rafael Espindola69cb2162011-08-09 22:17:34 +0000433}