diff options
Diffstat (limited to 'lib/CodeGen/LLVMTargetMachine.cpp')
-rw-r--r-- | lib/CodeGen/LLVMTargetMachine.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/CodeGen/LLVMTargetMachine.cpp b/lib/CodeGen/LLVMTargetMachine.cpp index e10be69614..e6873923bc 100644 --- a/lib/CodeGen/LLVMTargetMachine.cpp +++ b/lib/CodeGen/LLVMTargetMachine.cpp @@ -225,6 +225,13 @@ bool LLVMTargetMachine::addCommonCodeGenPasses(PassManagerBase &PM, bool Fast) { if (PrintMachineCode) PM.add(createMachineFunctionPrinterPass(cerr)); + // Branch folding must be run after regalloc and prolog/epilog insertion. + if (!Fast) + PM.add(createBranchFoldingPass(getEnableTailMergeDefault())); + + if (PrintMachineCode) + PM.add(createMachineFunctionPrinterPass(cerr)); + // Second pass scheduler. if (!Fast && !DisablePostRAScheduler) { PM.add(createPostRAScheduler()); @@ -233,10 +240,6 @@ bool LLVMTargetMachine::addCommonCodeGenPasses(PassManagerBase &PM, bool Fast) { PM.add(createMachineFunctionPrinterPass(cerr)); } - // Branch folding must be run after regalloc and prolog/epilog insertion. - if (!Fast) - PM.add(createBranchFoldingPass(getEnableTailMergeDefault())); - PM.add(createGCMachineCodeAnalysisPass()); if (PrintMachineCode) |