cleanup the cfg after lsr
authorChris Lattner <sabre@nondot.org>
Wed, 2 Mar 2005 21:56:00 +0000 (21:56 +0000)
committerChris Lattner <sabre@nondot.org>
Wed, 2 Mar 2005 21:56:00 +0000 (21:56 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20410 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/PowerPC/PPCTargetMachine.cpp

index 4bc5c50211e4fa6cd62ec2f3e0f8a76f6e111a2d..dd40e1333c7b1f5c2641ffdfb2f0d0c0646efb0c 100644 (file)
@@ -75,8 +75,10 @@ bool PowerPCTargetMachine::addPassesToEmitAssembly(PassManager &PM,
                                                    std::ostream &Out) {
   bool LP64 = (0 != dynamic_cast<PPC64TargetMachine *>(this));
 
-  if (EnablePPCLSR)
+  if (EnablePPCLSR) {
     PM.add(createLoopStrengthReducePass());
+    PM.add(createCFGSimplificationPass());
+  }
   
   // FIXME: Implement efficient support for garbage collection intrinsics.
   PM.add(createLowerGCPass());
@@ -120,8 +122,10 @@ bool PowerPCTargetMachine::addPassesToEmitAssembly(PassManager &PM,
 }
 
 void PowerPCJITInfo::addPassesToJITCompile(FunctionPassManager &PM) {
-  if (EnablePPCLSR)
+  if (EnablePPCLSR) {
     PM.add(createLoopStrengthReducePass());
+    PM.add(createCFGSimplificationPass());
+  }
 
   // FIXME: Implement efficient support for garbage collection intrinsics.
   PM.add(createLowerGCPass());