Add an option to disable buggy copy propagation pass
[oota-llvm.git] / lib / CodeGen / LLVMTargetMachine.cpp
index a04f3ed3de0d0bcb446b902acc509e0fa2f92d89..3a9f0f013b12f97951527a7a7a409fb087c1c60c 100644 (file)
@@ -72,6 +72,8 @@ static cl::opt<bool> DisableLSR("disable-lsr", cl::Hidden,
     cl::desc("Disable Loop Strength Reduction Pass"));
 static cl::opt<bool> DisableCGP("disable-cgp", cl::Hidden,
     cl::desc("Disable Codegen Prepare"));
+static cl::opt<bool> DisableCopyProp("disable-copyprop", cl::Hidden,
+    cl::desc("Disable Copy Propagation pass"));
 static cl::opt<bool> PrintLSR("print-lsr-output", cl::Hidden,
     cl::desc("Print LLVM IR produced by the loop-reduce pass"));
 static cl::opt<bool> PrintISelInput("print-isel-input", cl::Hidden,
@@ -463,7 +465,7 @@ bool LLVMTargetMachine::addCommonCodeGenPasses(PassManagerBase &PM,
   }
 
   // Copy propagation.
-  if (getOptLevel() != CodeGenOpt::None) {
+  if (getOptLevel() != CodeGenOpt::None && !DisableCopyProp) {
     PM.add(createMachineCopyPropagationPass());
     printNoVerify(PM, "After copy propagation pass");
   }