add the branch folding pass as a late cleanup pass for all targets. For now
authorChris Lattner <sabre@nondot.org>
Fri, 13 Oct 2006 20:45:56 +0000 (20:45 +0000)
committerChris Lattner <sabre@nondot.org>
Fri, 13 Oct 2006 20:45:56 +0000 (20:45 +0000)
it just deletes empty MBB's.  Soon it will do more :)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30941 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/LLVMTargetMachine.cpp

index 6c4544a11732ddd18bb83ee424de37ad74ecb53c..18ab21845684df386b1c42e9acdaf6ac804ddfa7 100644 (file)
@@ -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));