It is possible that subprgoram definition is only encoding return value directly...
[oota-llvm.git] / lib / CodeGen / LLVMTargetMachine.cpp
index fee70b00154baf1b77f32c281e0fa5bb4e3cee5a..f29944c7c90b5d8f500eb91c31e0a521bc4051ab 100644 (file)
@@ -38,15 +38,6 @@ static cl::opt<bool> PrintEmittedAsm("print-emitted-asm", cl::Hidden,
 static cl::opt<bool> PrintGCInfo("print-gc", cl::Hidden,
     cl::desc("Dump garbage collector data"));
 
-// Hidden options to help debugging
-static cl::opt<bool>
-EnableSinking("enable-sinking", cl::init(false), cl::Hidden,
-              cl::desc("Perform sinking on machine code"));
-static cl::opt<bool>
-EnableLICM("machine-licm",
-           cl::init(false), cl::Hidden,
-           cl::desc("Perform loop-invariant code motion on machine code"));
-
 // When this works it will be on by default.
 static cl::opt<bool>
 DisablePostRAScheduler("disable-post-RA-scheduler",
@@ -60,19 +51,6 @@ static cl::opt<cl::boolOrDefault>
 EnableFastISelOption("fast-isel", cl::Hidden,
   cl::desc("Enable the experimental \"fast\" instruction selector"));
 
-// Enable stack protectors.
-static cl::opt<SSP::StackProtectorLevel>
-EnableStackProtector("enable-stack-protector",
-                     cl::desc("Stack canary protection level: (default: off)"),
-                     cl::init(SSP::OFF),
-                     cl::values(clEnumValN(SSP::ALL,  "all",
-                                         "All functions get stack protectors."),
-                                clEnumValN(SSP::SOME, "some",
-                         "Only functions requiring stack protectors get them."),
-                                clEnumValN(SSP::OFF,  "off",
-                                          "No functions get stack protectors."),
-                                clEnumValEnd));
-
 FileModel::Model
 LLVMTargetMachine::addPassesToEmitFile(PassManagerBase &PM,
                                        raw_ostream &Out,
@@ -178,8 +156,7 @@ bool LLVMTargetMachine::addCommonCodeGenPasses(PassManagerBase &PM, bool Fast) {
   if (!Fast)
     PM.add(createCodeGenPreparePass(getTargetLowering()));
 
-  if (EnableStackProtector != SSP::OFF)
-    PM.add(createStackProtectorPass(EnableStackProtector, getTargetLowering()));
+  PM.add(createStackProtectorPass(getTargetLowering()));
 
   if (PrintISelInput)
     PM.add(createPrintFunctionPass("\n\n"
@@ -201,11 +178,10 @@ bool LLVMTargetMachine::addCommonCodeGenPasses(PassManagerBase &PM, bool Fast) {
   if (PrintMachineCode)
     PM.add(createMachineFunctionPrinterPass(cerr));
 
-  if (EnableLICM)
+  if (!Fast) {
     PM.add(createMachineLICMPass());
-
-  if (EnableSinking)
     PM.add(createMachineSinkingPass());
+  }
 
   // Run pre-ra passes.
   if (addPreRegAlloc(PM, Fast) && PrintMachineCode)
@@ -240,13 +216,20 @@ bool LLVMTargetMachine::addCommonCodeGenPasses(PassManagerBase &PM, bool Fast) {
     PM.add(createMachineFunctionPrinterPass(cerr));
 
   // Second pass scheduler.
-  if (!Fast && !DisablePostRAScheduler)
+  if (!Fast && !DisablePostRAScheduler) {
     PM.add(createPostRAScheduler());
 
+    if (PrintMachineCode)
+      PM.add(createMachineFunctionPrinterPass(cerr));
+  }
+
   // Branch folding must be run after regalloc and prolog/epilog insertion.
   if (!Fast)
     PM.add(createBranchFoldingPass(getEnableTailMergeDefault()));
 
+  if (PrintMachineCode)
+    PM.add(createMachineFunctionPrinterPass(cerr));
+
   PM.add(createGCMachineCodeAnalysisPass());
 
   if (PrintMachineCode)