Rafael Espindola | c684e83 | 2011-08-02 21:50:27 +0000 | [diff] [blame] | 1 | //===- 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" |
| 17 | |
Rafael Espindola | 69cb216 | 2011-08-09 22:17:34 +0000 | [diff] [blame] | 18 | #include "llvm-c/Transforms/PassManagerBuilder.h" |
| 19 | |
Rafael Espindola | c684e83 | 2011-08-02 21:50:27 +0000 | [diff] [blame] | 20 | #include "llvm/PassManager.h" |
| 21 | #include "llvm/DefaultPasses.h" |
| 22 | #include "llvm/PassManager.h" |
| 23 | #include "llvm/Analysis/Passes.h" |
Hal Finkel | de5e5ec | 2012-02-01 03:51:43 +0000 | [diff] [blame] | 24 | #include "llvm/Analysis/Verifier.h" |
| 25 | #include "llvm/Support/CommandLine.h" |
Rafael Espindola | c684e83 | 2011-08-02 21:50:27 +0000 | [diff] [blame] | 26 | #include "llvm/Target/TargetLibraryInfo.h" |
| 27 | #include "llvm/Transforms/Scalar.h" |
Hal Finkel | de5e5ec | 2012-02-01 03:51:43 +0000 | [diff] [blame] | 28 | #include "llvm/Transforms/Vectorize.h" |
Rafael Espindola | c684e83 | 2011-08-02 21:50:27 +0000 | [diff] [blame] | 29 | #include "llvm/Transforms/IPO.h" |
David Chisnall | 7a817ea | 2011-08-16 13:58:41 +0000 | [diff] [blame] | 30 | #include "llvm/ADT/SmallVector.h" |
| 31 | #include "llvm/Support/ManagedStatic.h" |
Rafael Espindola | c684e83 | 2011-08-02 21:50:27 +0000 | [diff] [blame] | 32 | |
| 33 | using namespace llvm; |
| 34 | |
Hal Finkel | de5e5ec | 2012-02-01 03:51:43 +0000 | [diff] [blame] | 35 | static cl::opt<bool> |
| 36 | RunVectorization("vectorize", cl::desc("Run vectorization passes")); |
| 37 | |
Hal Finkel | 064551e | 2012-04-13 17:15:33 +0000 | [diff] [blame] | 38 | static cl::opt<bool> |
| 39 | UseGVNAfterVectorization("use-gvn-after-vectorization", |
| 40 | cl::init(false), cl::Hidden, |
| 41 | cl::desc("Run GVN instead of Early CSE after vectorization passes")); |
| 42 | |
Chandler Carruth | 713aa94 | 2012-09-14 09:22:59 +0000 | [diff] [blame] | 43 | static cl::opt<bool> UseNewSROA("use-new-sroa", |
Nick Lewycky | bfc342d | 2012-09-26 22:43:04 +0000 | [diff] [blame] | 44 | cl::init(false), cl::Hidden, |
Chandler Carruth | 713aa94 | 2012-09-14 09:22:59 +0000 | [diff] [blame] | 45 | cl::desc("Enable the new, experimental SROA pass")); |
| 46 | |
Rafael Espindola | c684e83 | 2011-08-02 21:50:27 +0000 | [diff] [blame] | 47 | PassManagerBuilder::PassManagerBuilder() { |
| 48 | OptLevel = 2; |
| 49 | SizeLevel = 0; |
| 50 | LibraryInfo = 0; |
| 51 | Inliner = 0; |
| 52 | DisableSimplifyLibCalls = false; |
| 53 | DisableUnitAtATime = false; |
| 54 | DisableUnrollLoops = false; |
Hal Finkel | de5e5ec | 2012-02-01 03:51:43 +0000 | [diff] [blame] | 55 | Vectorize = RunVectorization; |
Rafael Espindola | c684e83 | 2011-08-02 21:50:27 +0000 | [diff] [blame] | 56 | } |
| 57 | |
| 58 | PassManagerBuilder::~PassManagerBuilder() { |
| 59 | delete LibraryInfo; |
| 60 | delete Inliner; |
| 61 | } |
| 62 | |
David Chisnall | 7a817ea | 2011-08-16 13:58:41 +0000 | [diff] [blame] | 63 | /// Set of global extensions, automatically added as part of the standard set. |
| 64 | static ManagedStatic<SmallVector<std::pair<PassManagerBuilder::ExtensionPointTy, |
| 65 | PassManagerBuilder::ExtensionFn>, 8> > GlobalExtensions; |
| 66 | |
| 67 | void PassManagerBuilder::addGlobalExtension( |
| 68 | PassManagerBuilder::ExtensionPointTy Ty, |
| 69 | PassManagerBuilder::ExtensionFn Fn) { |
| 70 | GlobalExtensions->push_back(std::make_pair(Ty, Fn)); |
| 71 | } |
| 72 | |
Rafael Espindola | c684e83 | 2011-08-02 21:50:27 +0000 | [diff] [blame] | 73 | void PassManagerBuilder::addExtension(ExtensionPointTy Ty, ExtensionFn Fn) { |
| 74 | Extensions.push_back(std::make_pair(Ty, Fn)); |
| 75 | } |
| 76 | |
| 77 | void PassManagerBuilder::addExtensionsToPM(ExtensionPointTy ETy, |
| 78 | PassManagerBase &PM) const { |
David Chisnall | 7a817ea | 2011-08-16 13:58:41 +0000 | [diff] [blame] | 79 | for (unsigned i = 0, e = GlobalExtensions->size(); i != e; ++i) |
| 80 | if ((*GlobalExtensions)[i].first == ETy) |
| 81 | (*GlobalExtensions)[i].second(*this, PM); |
Rafael Espindola | c684e83 | 2011-08-02 21:50:27 +0000 | [diff] [blame] | 82 | for (unsigned i = 0, e = Extensions.size(); i != e; ++i) |
| 83 | if (Extensions[i].first == ETy) |
| 84 | Extensions[i].second(*this, PM); |
| 85 | } |
| 86 | |
| 87 | void |
| 88 | PassManagerBuilder::addInitialAliasAnalysisPasses(PassManagerBase &PM) const { |
| 89 | // Add TypeBasedAliasAnalysis before BasicAliasAnalysis so that |
| 90 | // BasicAliasAnalysis wins if they disagree. This is intended to help |
| 91 | // support "obvious" type-punning idioms. |
| 92 | PM.add(createTypeBasedAliasAnalysisPass()); |
| 93 | PM.add(createBasicAliasAnalysisPass()); |
| 94 | } |
| 95 | |
| 96 | void PassManagerBuilder::populateFunctionPassManager(FunctionPassManager &FPM) { |
| 97 | addExtensionsToPM(EP_EarlyAsPossible, FPM); |
| 98 | |
| 99 | // Add LibraryInfo if we have some. |
| 100 | if (LibraryInfo) FPM.add(new TargetLibraryInfo(*LibraryInfo)); |
| 101 | |
| 102 | if (OptLevel == 0) return; |
| 103 | |
| 104 | addInitialAliasAnalysisPasses(FPM); |
| 105 | |
| 106 | FPM.add(createCFGSimplificationPass()); |
Chandler Carruth | 713aa94 | 2012-09-14 09:22:59 +0000 | [diff] [blame] | 107 | if (UseNewSROA) |
| 108 | FPM.add(createSROAPass()); |
| 109 | else |
| 110 | FPM.add(createScalarReplAggregatesPass()); |
Rafael Espindola | c684e83 | 2011-08-02 21:50:27 +0000 | [diff] [blame] | 111 | FPM.add(createEarlyCSEPass()); |
| 112 | FPM.add(createLowerExpectIntrinsicPass()); |
| 113 | } |
| 114 | |
| 115 | void PassManagerBuilder::populateModulePassManager(PassManagerBase &MPM) { |
| 116 | // If all optimizations are disabled, just run the always-inline pass. |
| 117 | if (OptLevel == 0) { |
| 118 | if (Inliner) { |
| 119 | MPM.add(Inliner); |
| 120 | Inliner = 0; |
| 121 | } |
Kostya Serebryany | af65a8c | 2011-11-30 22:19:26 +0000 | [diff] [blame] | 122 | addExtensionsToPM(EP_EnabledOnOptLevel0, MPM); |
Rafael Espindola | c684e83 | 2011-08-02 21:50:27 +0000 | [diff] [blame] | 123 | return; |
| 124 | } |
| 125 | |
| 126 | // Add LibraryInfo if we have some. |
| 127 | if (LibraryInfo) MPM.add(new TargetLibraryInfo(*LibraryInfo)); |
| 128 | |
| 129 | addInitialAliasAnalysisPasses(MPM); |
| 130 | |
| 131 | if (!DisableUnitAtATime) { |
Dan Gohman | 7d4c87e | 2012-01-17 20:51:32 +0000 | [diff] [blame] | 132 | addExtensionsToPM(EP_ModuleOptimizerEarly, MPM); |
| 133 | |
Rafael Espindola | c684e83 | 2011-08-02 21:50:27 +0000 | [diff] [blame] | 134 | MPM.add(createGlobalOptimizerPass()); // Optimize out global vars |
| 135 | |
| 136 | MPM.add(createIPSCCPPass()); // IP SCCP |
| 137 | MPM.add(createDeadArgEliminationPass()); // Dead argument elimination |
| 138 | |
| 139 | MPM.add(createInstructionCombiningPass());// Clean up after IPCP & DAE |
| 140 | MPM.add(createCFGSimplificationPass()); // Clean up after IPCP & DAE |
| 141 | } |
| 142 | |
| 143 | // Start of CallGraph SCC passes. |
| 144 | if (!DisableUnitAtATime) |
| 145 | MPM.add(createPruneEHPass()); // Remove dead EH info |
| 146 | if (Inliner) { |
| 147 | MPM.add(Inliner); |
| 148 | Inliner = 0; |
| 149 | } |
| 150 | if (!DisableUnitAtATime) |
| 151 | MPM.add(createFunctionAttrsPass()); // Set readonly/readnone attrs |
| 152 | if (OptLevel > 2) |
| 153 | MPM.add(createArgumentPromotionPass()); // Scalarize uninlined fn args |
| 154 | |
| 155 | // Start of function pass. |
| 156 | // Break up aggregate allocas, using SSAUpdater. |
Chandler Carruth | 1c8db50 | 2012-09-15 11:43:14 +0000 | [diff] [blame] | 157 | if (UseNewSROA) |
| 158 | MPM.add(createSROAPass(/*RequiresDomTree*/ false)); |
| 159 | else |
| 160 | MPM.add(createScalarReplAggregatesPass(-1, false)); |
Rafael Espindola | c684e83 | 2011-08-02 21:50:27 +0000 | [diff] [blame] | 161 | MPM.add(createEarlyCSEPass()); // Catch trivial redundancies |
| 162 | if (!DisableSimplifyLibCalls) |
| 163 | MPM.add(createSimplifyLibCallsPass()); // Library Call Optimizations |
| 164 | MPM.add(createJumpThreadingPass()); // Thread jumps. |
| 165 | MPM.add(createCorrelatedValuePropagationPass()); // Propagate conditionals |
| 166 | MPM.add(createCFGSimplificationPass()); // Merge & remove BBs |
| 167 | MPM.add(createInstructionCombiningPass()); // Combine silly seq's |
| 168 | |
| 169 | MPM.add(createTailCallEliminationPass()); // Eliminate tail calls |
| 170 | MPM.add(createCFGSimplificationPass()); // Merge & remove BBs |
| 171 | MPM.add(createReassociatePass()); // Reassociate expressions |
| 172 | MPM.add(createLoopRotatePass()); // Rotate Loop |
| 173 | MPM.add(createLICMPass()); // Hoist loop invariants |
| 174 | MPM.add(createLoopUnswitchPass(SizeLevel || OptLevel < 3)); |
| 175 | MPM.add(createInstructionCombiningPass()); |
| 176 | MPM.add(createIndVarSimplifyPass()); // Canonicalize indvars |
| 177 | MPM.add(createLoopIdiomPass()); // Recognize idioms like memset. |
| 178 | MPM.add(createLoopDeletionPass()); // Delete dead loops |
| 179 | if (!DisableUnrollLoops) |
| 180 | MPM.add(createLoopUnrollPass()); // Unroll small loops |
| 181 | addExtensionsToPM(EP_LoopOptimizerEnd, MPM); |
| 182 | |
| 183 | if (OptLevel > 1) |
| 184 | MPM.add(createGVNPass()); // Remove redundancies |
| 185 | MPM.add(createMemCpyOptPass()); // Remove memcpy / form memset |
| 186 | MPM.add(createSCCPPass()); // Constant prop with SCCP |
| 187 | |
| 188 | // Run instcombine after redundancy elimination to exploit opportunities |
| 189 | // opened up by them. |
| 190 | MPM.add(createInstructionCombiningPass()); |
| 191 | MPM.add(createJumpThreadingPass()); // Thread jumps |
| 192 | MPM.add(createCorrelatedValuePropagationPass()); |
| 193 | MPM.add(createDeadStoreEliminationPass()); // Delete dead stores |
| 194 | |
| 195 | addExtensionsToPM(EP_ScalarOptimizerLate, MPM); |
| 196 | |
Hal Finkel | de5e5ec | 2012-02-01 03:51:43 +0000 | [diff] [blame] | 197 | if (Vectorize) { |
| 198 | MPM.add(createBBVectorizePass()); |
| 199 | MPM.add(createInstructionCombiningPass()); |
Hal Finkel | 064551e | 2012-04-13 17:15:33 +0000 | [diff] [blame] | 200 | if (OptLevel > 1 && UseGVNAfterVectorization) |
| 201 | MPM.add(createGVNPass()); // Remove redundancies |
| 202 | else |
| 203 | MPM.add(createEarlyCSEPass()); // Catch trivial redundancies |
Hal Finkel | de5e5ec | 2012-02-01 03:51:43 +0000 | [diff] [blame] | 204 | } |
| 205 | |
Rafael Espindola | c684e83 | 2011-08-02 21:50:27 +0000 | [diff] [blame] | 206 | MPM.add(createAggressiveDCEPass()); // Delete dead instructions |
| 207 | MPM.add(createCFGSimplificationPass()); // Merge & remove BBs |
| 208 | MPM.add(createInstructionCombiningPass()); // Clean up after everything. |
| 209 | |
| 210 | if (!DisableUnitAtATime) { |
| 211 | // FIXME: We shouldn't bother with this anymore. |
| 212 | MPM.add(createStripDeadPrototypesPass()); // Get rid of dead prototypes |
| 213 | |
Evan Cheng | f5fdc14 | 2012-09-28 21:23:26 +0000 | [diff] [blame^] | 214 | // GlobalOpt already deletes dead functions and globals, at -O2 try a |
Rafael Espindola | c684e83 | 2011-08-02 21:50:27 +0000 | [diff] [blame] | 215 | // late pass of GlobalDCE. It is capable of deleting dead cycles. |
Evan Cheng | f5fdc14 | 2012-09-28 21:23:26 +0000 | [diff] [blame^] | 216 | if (OptLevel > 1) { |
Rafael Espindola | c684e83 | 2011-08-02 21:50:27 +0000 | [diff] [blame] | 217 | MPM.add(createGlobalDCEPass()); // Remove dead fns and globals. |
Rafael Espindola | c684e83 | 2011-08-02 21:50:27 +0000 | [diff] [blame] | 218 | MPM.add(createConstantMergePass()); // Merge dup global constants |
Evan Cheng | f5fdc14 | 2012-09-28 21:23:26 +0000 | [diff] [blame^] | 219 | } |
Rafael Espindola | c684e83 | 2011-08-02 21:50:27 +0000 | [diff] [blame] | 220 | } |
Kostya Serebryany | 1db3949 | 2012-03-23 23:22:59 +0000 | [diff] [blame] | 221 | addExtensionsToPM(EP_OptimizerLast, MPM); |
Rafael Espindola | c684e83 | 2011-08-02 21:50:27 +0000 | [diff] [blame] | 222 | } |
| 223 | |
| 224 | void PassManagerBuilder::populateLTOPassManager(PassManagerBase &PM, |
| 225 | bool Internalize, |
Bill Wendling | 3197b44 | 2012-04-02 22:16:50 +0000 | [diff] [blame] | 226 | bool RunInliner, |
| 227 | bool DisableGVNLoadPRE) { |
Rafael Espindola | c684e83 | 2011-08-02 21:50:27 +0000 | [diff] [blame] | 228 | // Provide AliasAnalysis services for optimizations. |
| 229 | addInitialAliasAnalysisPasses(PM); |
| 230 | |
| 231 | // Now that composite has been compiled, scan through the module, looking |
| 232 | // for a main function. If main is defined, mark all other functions |
| 233 | // internal. |
| 234 | if (Internalize) |
| 235 | PM.add(createInternalizePass(true)); |
| 236 | |
| 237 | // Propagate constants at call sites into the functions they call. This |
| 238 | // opens opportunities for globalopt (and inlining) by substituting function |
| 239 | // pointers passed as arguments to direct uses of functions. |
| 240 | PM.add(createIPSCCPPass()); |
| 241 | |
| 242 | // Now that we internalized some globals, see if we can hack on them! |
| 243 | PM.add(createGlobalOptimizerPass()); |
| 244 | |
| 245 | // Linking modules together can lead to duplicated global constants, only |
| 246 | // keep one copy of each constant. |
| 247 | PM.add(createConstantMergePass()); |
| 248 | |
| 249 | // Remove unused arguments from functions. |
| 250 | PM.add(createDeadArgEliminationPass()); |
| 251 | |
| 252 | // Reduce the code after globalopt and ipsccp. Both can open up significant |
| 253 | // simplification opportunities, and both can propagate functions through |
| 254 | // function pointers. When this happens, we often have to resolve varargs |
| 255 | // calls, etc, so let instcombine do this. |
| 256 | PM.add(createInstructionCombiningPass()); |
| 257 | |
| 258 | // Inline small functions |
| 259 | if (RunInliner) |
| 260 | PM.add(createFunctionInliningPass()); |
| 261 | |
| 262 | PM.add(createPruneEHPass()); // Remove dead EH info. |
| 263 | |
| 264 | // Optimize globals again if we ran the inliner. |
| 265 | if (RunInliner) |
| 266 | PM.add(createGlobalOptimizerPass()); |
| 267 | PM.add(createGlobalDCEPass()); // Remove dead functions. |
| 268 | |
| 269 | // If we didn't decide to inline a function, check to see if we can |
| 270 | // transform it to pass arguments by value instead of by reference. |
| 271 | PM.add(createArgumentPromotionPass()); |
| 272 | |
| 273 | // The IPO passes may leave cruft around. Clean up after them. |
| 274 | PM.add(createInstructionCombiningPass()); |
| 275 | PM.add(createJumpThreadingPass()); |
| 276 | // Break up allocas |
Chandler Carruth | 713aa94 | 2012-09-14 09:22:59 +0000 | [diff] [blame] | 277 | if (UseNewSROA) |
| 278 | PM.add(createSROAPass()); |
| 279 | else |
| 280 | PM.add(createScalarReplAggregatesPass()); |
Rafael Espindola | c684e83 | 2011-08-02 21:50:27 +0000 | [diff] [blame] | 281 | |
| 282 | // Run a few AA driven optimizations here and now, to cleanup the code. |
| 283 | PM.add(createFunctionAttrsPass()); // Add nocapture. |
| 284 | PM.add(createGlobalsModRefPass()); // IP alias analysis. |
| 285 | |
Bill Wendling | 3197b44 | 2012-04-02 22:16:50 +0000 | [diff] [blame] | 286 | PM.add(createLICMPass()); // Hoist loop invariants. |
| 287 | PM.add(createGVNPass(DisableGVNLoadPRE)); // Remove redundancies. |
| 288 | PM.add(createMemCpyOptPass()); // Remove dead memcpys. |
Rafael Espindola | c684e83 | 2011-08-02 21:50:27 +0000 | [diff] [blame] | 289 | // Nuke dead stores. |
| 290 | PM.add(createDeadStoreEliminationPass()); |
| 291 | |
| 292 | // Cleanup and simplify the code after the scalar optimizations. |
| 293 | PM.add(createInstructionCombiningPass()); |
| 294 | |
| 295 | PM.add(createJumpThreadingPass()); |
| 296 | |
| 297 | // Delete basic blocks, which optimization passes may have killed. |
| 298 | PM.add(createCFGSimplificationPass()); |
| 299 | |
| 300 | // Now that we have optimized the program, discard unreachable functions. |
| 301 | PM.add(createGlobalDCEPass()); |
| 302 | } |
Rafael Espindola | 69cb216 | 2011-08-09 22:17:34 +0000 | [diff] [blame] | 303 | |
| 304 | LLVMPassManagerBuilderRef LLVMPassManagerBuilderCreate(void) { |
| 305 | PassManagerBuilder *PMB = new PassManagerBuilder(); |
| 306 | return wrap(PMB); |
| 307 | } |
| 308 | |
| 309 | void LLVMPassManagerBuilderDispose(LLVMPassManagerBuilderRef PMB) { |
| 310 | PassManagerBuilder *Builder = unwrap(PMB); |
| 311 | delete Builder; |
| 312 | } |
| 313 | |
| 314 | void |
| 315 | LLVMPassManagerBuilderSetOptLevel(LLVMPassManagerBuilderRef PMB, |
| 316 | unsigned OptLevel) { |
| 317 | PassManagerBuilder *Builder = unwrap(PMB); |
| 318 | Builder->OptLevel = OptLevel; |
| 319 | } |
| 320 | |
| 321 | void |
| 322 | LLVMPassManagerBuilderSetSizeLevel(LLVMPassManagerBuilderRef PMB, |
| 323 | unsigned SizeLevel) { |
| 324 | PassManagerBuilder *Builder = unwrap(PMB); |
| 325 | Builder->SizeLevel = SizeLevel; |
| 326 | } |
| 327 | |
| 328 | void |
| 329 | LLVMPassManagerBuilderSetDisableUnitAtATime(LLVMPassManagerBuilderRef PMB, |
| 330 | LLVMBool Value) { |
| 331 | PassManagerBuilder *Builder = unwrap(PMB); |
| 332 | Builder->DisableUnitAtATime = Value; |
| 333 | } |
| 334 | |
| 335 | void |
| 336 | LLVMPassManagerBuilderSetDisableUnrollLoops(LLVMPassManagerBuilderRef PMB, |
| 337 | LLVMBool Value) { |
| 338 | PassManagerBuilder *Builder = unwrap(PMB); |
| 339 | Builder->DisableUnrollLoops = Value; |
| 340 | } |
| 341 | |
| 342 | void |
| 343 | LLVMPassManagerBuilderSetDisableSimplifyLibCalls(LLVMPassManagerBuilderRef PMB, |
| 344 | LLVMBool Value) { |
| 345 | PassManagerBuilder *Builder = unwrap(PMB); |
| 346 | Builder->DisableSimplifyLibCalls = Value; |
| 347 | } |
| 348 | |
| 349 | void |
| 350 | LLVMPassManagerBuilderUseInlinerWithThreshold(LLVMPassManagerBuilderRef PMB, |
| 351 | unsigned Threshold) { |
| 352 | PassManagerBuilder *Builder = unwrap(PMB); |
| 353 | Builder->Inliner = createFunctionInliningPass(Threshold); |
| 354 | } |
| 355 | |
| 356 | void |
| 357 | LLVMPassManagerBuilderPopulateFunctionPassManager(LLVMPassManagerBuilderRef PMB, |
| 358 | LLVMPassManagerRef PM) { |
| 359 | PassManagerBuilder *Builder = unwrap(PMB); |
| 360 | FunctionPassManager *FPM = unwrap<FunctionPassManager>(PM); |
| 361 | Builder->populateFunctionPassManager(*FPM); |
| 362 | } |
| 363 | |
| 364 | void |
| 365 | LLVMPassManagerBuilderPopulateModulePassManager(LLVMPassManagerBuilderRef PMB, |
| 366 | LLVMPassManagerRef PM) { |
| 367 | PassManagerBuilder *Builder = unwrap(PMB); |
| 368 | PassManagerBase *MPM = unwrap(PM); |
| 369 | Builder->populateModulePassManager(*MPM); |
| 370 | } |
| 371 | |
| 372 | void LLVMPassManagerBuilderPopulateLTOPassManager(LLVMPassManagerBuilderRef PMB, |
| 373 | LLVMPassManagerRef PM, |
| 374 | bool Internalize, |
| 375 | bool RunInliner) { |
| 376 | PassManagerBuilder *Builder = unwrap(PMB); |
| 377 | PassManagerBase *LPM = unwrap(PM); |
| 378 | Builder->populateLTOPassManager(*LPM, Internalize, RunInliner); |
| 379 | } |