Lines Matching refs:PM
126 bool LLVMTargetMachine::addPassesToEmitFile(PassManagerBase &PM, in addPassesToEmitFile() argument
133 if (addCommonCodeGenPasses(PM, OptLevel, DisableVerify, Context)) in addPassesToEmitFile()
203 PM.add(Printer); in addPassesToEmitFile()
205 PM.add(createGCInfoDeleter()); in addPassesToEmitFile()
215 bool LLVMTargetMachine::addPassesToEmitMachineCode(PassManagerBase &PM, in addPassesToEmitMachineCode() argument
221 if (addCommonCodeGenPasses(PM, OptLevel, DisableVerify, Ctx)) in addPassesToEmitMachineCode()
224 addCodeEmitter(PM, OptLevel, JCE); in addPassesToEmitMachineCode()
225 PM.add(createGCInfoDeleter()); in addPassesToEmitMachineCode()
235 bool LLVMTargetMachine::addPassesToEmitMC(PassManagerBase &PM, in addPassesToEmitMC() argument
241 if (addCommonCodeGenPasses(PM, OptLevel, DisableVerify, Ctx)) in addPassesToEmitMC()
270 PM.add(Printer); in addPassesToEmitMC()
275 static void printNoVerify(PassManagerBase &PM, const char *Banner) { in printNoVerify() argument
277 PM.add(createMachineFunctionPrinterPass(dbgs(), Banner)); in printNoVerify()
280 static void printAndVerify(PassManagerBase &PM, in printAndVerify() argument
283 PM.add(createMachineFunctionPrinterPass(dbgs(), Banner)); in printAndVerify()
286 PM.add(createMachineVerifierPass(Banner)); in printAndVerify()
292 bool LLVMTargetMachine::addCommonCodeGenPasses(PassManagerBase &PM, in addCommonCodeGenPasses() argument
302 PM.add(createTypeBasedAliasAnalysisPass()); in addCommonCodeGenPasses()
303 PM.add(createBasicAliasAnalysisPass()); in addCommonCodeGenPasses()
308 PM.add(createVerifierPass()); in addCommonCodeGenPasses()
312 PM.add(createLoopStrengthReducePass(getTargetLowering())); in addCommonCodeGenPasses()
314 PM.add(createPrintFunctionPass("\n\n*** Code after LSR ***\n", &dbgs())); in addCommonCodeGenPasses()
317 PM.add(createGCLoweringPass()); in addCommonCodeGenPasses()
320 PM.add(createUnreachableBlockEliminationPass()); in addCommonCodeGenPasses()
332 PM.add(createSjLjEHPass(getTargetLowering())); in addCommonCodeGenPasses()
337 PM.add(createDwarfEHPass(this)); in addCommonCodeGenPasses()
340 PM.add(createLowerInvokePass(getTargetLowering())); in addCommonCodeGenPasses()
343 PM.add(createUnreachableBlockEliminationPass()); in addCommonCodeGenPasses()
348 PM.add(createCodeGenPreparePass(getTargetLowering())); in addCommonCodeGenPasses()
350 PM.add(createStackProtectorPass(getTargetLowering())); in addCommonCodeGenPasses()
352 addPreISel(PM, OptLevel); in addCommonCodeGenPasses()
355 PM.add(createPrintFunctionPass("\n\n" in addCommonCodeGenPasses()
362 PM.add(createVerifierPass()); in addCommonCodeGenPasses()
371 PM.add(MMI); in addCommonCodeGenPasses()
375 PM.add(new MachineFunctionAnalysis(*this, OptLevel)); in addCommonCodeGenPasses()
383 if (addInstSelector(PM, OptLevel)) in addCommonCodeGenPasses()
387 printAndVerify(PM, "After Instruction Selection"); in addCommonCodeGenPasses()
390 PM.add(createExpandISelPseudosPass()); in addCommonCodeGenPasses()
394 PM.add(createTailDuplicatePass(true)); in addCommonCodeGenPasses()
395 printAndVerify(PM, "After Pre-RegAlloc TailDuplicate"); in addCommonCodeGenPasses()
401 PM.add(createOptimizePHIsPass()); in addCommonCodeGenPasses()
405 PM.add(createLocalStackSlotAllocationPass()); in addCommonCodeGenPasses()
413 PM.add(createDeadMachineInstructionElimPass()); in addCommonCodeGenPasses()
414 printAndVerify(PM, "After codegen DCE pass"); in addCommonCodeGenPasses()
417 PM.add(createMachineLICMPass()); in addCommonCodeGenPasses()
419 PM.add(createMachineCSEPass()); in addCommonCodeGenPasses()
421 PM.add(createMachineSinkingPass()); in addCommonCodeGenPasses()
422 printAndVerify(PM, "After Machine LICM, CSE and Sinking passes"); in addCommonCodeGenPasses()
424 PM.add(createPeepholeOptimizerPass()); in addCommonCodeGenPasses()
425 printAndVerify(PM, "After codegen peephole optimization pass"); in addCommonCodeGenPasses()
429 if (addPreRegAlloc(PM, OptLevel)) in addCommonCodeGenPasses()
430 printAndVerify(PM, "After PreRegAlloc passes"); in addCommonCodeGenPasses()
433 PM.add(createRegisterAllocator(OptLevel)); in addCommonCodeGenPasses()
434 printAndVerify(PM, "After Register Allocation"); in addCommonCodeGenPasses()
441 PM.add(createStackSlotColoringPass(false)); in addCommonCodeGenPasses()
445 PM.add(createMachineLICMPass(false)); in addCommonCodeGenPasses()
447 printAndVerify(PM, "After StackSlotColoring and postra Machine LICM"); in addCommonCodeGenPasses()
451 if (addPostRegAlloc(PM, OptLevel)) in addCommonCodeGenPasses()
452 printAndVerify(PM, "After PostRegAlloc passes"); in addCommonCodeGenPasses()
454 PM.add(createExpandPostRAPseudosPass()); in addCommonCodeGenPasses()
455 printAndVerify(PM, "After ExpandPostRAPseudos"); in addCommonCodeGenPasses()
458 PM.add(createPrologEpilogCodeInserter()); in addCommonCodeGenPasses()
459 printAndVerify(PM, "After PrologEpilogCodeInserter"); in addCommonCodeGenPasses()
462 if (addPreSched2(PM, OptLevel)) in addCommonCodeGenPasses()
463 printAndVerify(PM, "After PreSched2 passes"); in addCommonCodeGenPasses()
467 PM.add(createPostRAScheduler(OptLevel)); in addCommonCodeGenPasses()
468 printAndVerify(PM, "After PostRAScheduler"); in addCommonCodeGenPasses()
473 PM.add(createBranchFoldingPass(getEnableTailMergeDefault())); in addCommonCodeGenPasses()
474 printNoVerify(PM, "After BranchFolding"); in addCommonCodeGenPasses()
479 PM.add(createTailDuplicatePass(false)); in addCommonCodeGenPasses()
480 printNoVerify(PM, "After TailDuplicate"); in addCommonCodeGenPasses()
483 PM.add(createGCMachineCodeAnalysisPass()); in addCommonCodeGenPasses()
486 PM.add(createGCInfoPrinter(dbgs())); in addCommonCodeGenPasses()
489 PM.add(createCodePlacementOptPass()); in addCommonCodeGenPasses()
490 printNoVerify(PM, "After CodePlacementOpt"); in addCommonCodeGenPasses()
493 if (addPreEmitPass(PM, OptLevel)) in addCommonCodeGenPasses()
494 printNoVerify(PM, "After PreEmit passes"); in addCommonCodeGenPasses()