From 55ad08a59b588c4846ea56bb8f4093012cb9e8fe Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Fri, 13 Oct 2006 20:45:56 +0000 Subject: [PATCH] add the branch folding pass as a late cleanup pass for all targets. For now it just deletes empty MBB's. Soon it will do more :) llvm-svn: 30941 --- llvm/lib/CodeGen/LLVMTargetMachine.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/llvm/lib/CodeGen/LLVMTargetMachine.cpp b/llvm/lib/CodeGen/LLVMTargetMachine.cpp index 6c4544a11732..18ab21845684 100644 --- a/llvm/lib/CodeGen/LLVMTargetMachine.cpp +++ b/llvm/lib/CodeGen/LLVMTargetMachine.cpp @@ -63,6 +63,9 @@ bool LLVMTargetMachine::addPassesToEmitFile(FunctionPassManager &PM, // Insert prolog/epilog code. Eliminate abstract frame index references... PM.add(createPrologEpilogCodeInserter()); + // Branch folding must be run after regalloc and prolog/epilog insertion. + PM.add(createBranchFoldingPass()); + if (PrintMachineCode) // Print the register-allocated code PM.add(createMachineFunctionPrinterPass(&std::cerr));