Move option to enable machine LICM into LLVMTargetMachine.cpp.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45572 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/LLVMTargetMachine.cpp b/lib/CodeGen/LLVMTargetMachine.cpp
index 6a8e775..15c1d67 100644
--- a/lib/CodeGen/LLVMTargetMachine.cpp
+++ b/lib/CodeGen/LLVMTargetMachine.cpp
@@ -33,7 +33,10 @@
 static cl::opt<bool>
 EnableSinking("enable-sinking", cl::init(false), cl::Hidden,
               cl::desc("Perform sinking on machine code"));
-
+static cl::opt<bool>
+PerformLICM("machine-licm",
+            cl::init(false), cl::Hidden,
+            cl::desc("Perform loop-invariant code motion on machine code"));
 
 FileModel::Model
 LLVMTargetMachine::addPassesToEmitFile(FunctionPassManager &PM,
@@ -73,7 +76,8 @@
   if (PrintMachineCode)
     PM.add(createMachineFunctionPrinterPass(cerr));
 
-  PM.add(createMachineLICMPass());
+  if (PerformLICM)
+    PM.add(createMachineLICMPass());
   
   if (EnableSinking)
     PM.add(createMachineSinkingPass());
@@ -187,7 +191,8 @@
   if (PrintMachineCode)
     PM.add(createMachineFunctionPrinterPass(cerr));
 
-  PM.add(createMachineLICMPass());
+  if (PerformLICM)
+    PM.add(createMachineLICMPass());
 
   // Perform register allocation to convert to a concrete x86 representation
   PM.add(createRegisterAllocator());