Added option -align-loops=<true/false> to disable loop aligner pass.
[oota-llvm.git] / lib / CodeGen / LLVMTargetMachine.cpp
index 5611b03ba764f2bc3aea397f91da7700753e39d2..32fbc15e1315aee039b6b4e02a78e8ee9f8f7632 100644 (file)
@@ -37,6 +37,9 @@ static cl::opt<bool>
 EnableSinking("enable-sinking", cl::init(false), cl::Hidden,
               cl::desc("Perform sinking on machine code"));
 static cl::opt<bool>
+AlignLoops("align-loops", cl::init(true), cl::Hidden,
+              cl::desc("Align loop headers"));
+static cl::opt<bool>
 PerformLICM("machine-licm",
             cl::init(false), cl::Hidden,
             cl::desc("Perform loop-invariant code motion on machine code"));
@@ -132,6 +135,9 @@ LLVMTargetMachine::addPassesToEmitFile(FunctionPassManager &PM,
   if (addPreEmitPass(PM, Fast) && PrintMachineCode)
     PM.add(createMachineFunctionPrinterPass(cerr));
 
+  if (AlignLoops)
+    PM.add(createLoopAlignerPass());
+
   switch (FileType) {
   default:
     break;