From 23b0d490cdf27b2cba7b497aceeb5c79b0d0c9fe Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Thu, 18 Dec 2008 01:36:42 +0000 Subject: [PATCH] Move post-RA scheduling before branch folding for now, because branch folding's tail merging doesn't currently preserve liveness information which post-RA scheduling requires. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61183 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/LLVMTargetMachine.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/CodeGen/LLVMTargetMachine.cpp b/lib/CodeGen/LLVMTargetMachine.cpp index e6873923bcc..c9ff15d4947 100644 --- a/lib/CodeGen/LLVMTargetMachine.cpp +++ b/lib/CodeGen/LLVMTargetMachine.cpp @@ -222,13 +222,6 @@ bool LLVMTargetMachine::addCommonCodeGenPasses(PassManagerBase &PM, bool Fast) { // Insert prolog/epilog code. Eliminate abstract frame index references... PM.add(createPrologEpilogCodeInserter()); - 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)); @@ -240,6 +233,13 @@ 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())); + + if (PrintMachineCode) + PM.add(createMachineFunctionPrinterPass(cerr)); + PM.add(createGCMachineCodeAnalysisPass()); if (PrintMachineCode) -- 2.34.1