[PeepholeOptimizer] Refactor the advanced copy optimization to take advantage of
[oota-llvm.git] / lib / CodeGen / Passes.cpp
index 6e86c8f21099f7b748aa3b612fcc0ab22dc89d0c..319c2c865039829f05a43a91c9410a6f7f78010a 100644 (file)
@@ -377,6 +377,7 @@ void TargetPassConfig::addIRPasses() {
   // BasicAliasAnalysis wins if they disagree. This is intended to help
   // support "obvious" type-punning idioms.
   addPass(createTypeBasedAliasAnalysisPass());
+  addPass(createScopedNoAliasAAPass());
   addPass(createBasicAliasAnalysisPass());
 
   // Before running any passes, run the verifier to determine if the input
@@ -606,6 +607,9 @@ void TargetPassConfig::addMachineSSAOptimization() {
   printAndVerify("After Machine LICM, CSE and Sinking passes");
 
   addPass(&PeepholeOptimizerID);
+  // Clean-up the dead code that may have been generated by peephole
+  // rewriting.
+  addPass(&DeadMachineInstructionElimID);
   printAndVerify("After codegen peephole optimization pass");
 }