Adding option to llc for ModuloScheduling. By default it is turned off.
authorTanya Lattner <tonic@nondot.org>
Thu, 18 Nov 2004 18:38:01 +0000 (18:38 +0000)
committerTanya Lattner <tonic@nondot.org>
Thu, 18 Nov 2004 18:38:01 +0000 (18:38 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17959 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/SparcV9/SparcV9TargetMachine.cpp
tools/Makefile.JIT
tools/llc/Makefile

index 3e0e8b931cc8c366c50a3e632be86c3354e425b4..f5e19512ba4a8b77b510c7ea95584708bcf300ba 100644 (file)
@@ -66,6 +66,9 @@ namespace {
   cl::opt<bool> DisableStrip("disable-strip",
                       cl::desc("Do not strip the LLVM bytecode in executable"));
 
+  
+  cl::opt<bool> EnableModSched("enable-ModSched", cl::desc("Enable modulo scheduling pass instead of local scheduling"));
+
   // Register the target.
   RegisterTarget<SparcV9TargetMachine> X("sparcv9", "  SPARC V9");
 }
@@ -192,9 +195,17 @@ SparcV9TargetMachine::addPassesToEmitAssembly(PassManager &PM, std::ostream &Out
   
   PM.add(createSparcV9BurgInstSelector(*this));
 
-  if (!DisableSched)
-    PM.add(createInstructionSchedulingWithSSAPass(*this));
+  if(PrintMachineCode)
+    PM.add(createMachineFunctionPrinterPass(&std::cerr, "Before modulo scheduling:\n"));
 
+  //Use ModuloScheduling if enabled, otherwise use local scheduling if not disabled.
+  if(EnableModSched)
+    PM.add(createModuloSchedulingPass(*this));
+  else {
+    if (!DisableSched)
+      PM.add(createInstructionSchedulingWithSSAPass(*this));
+  }
+  
   if (PrintMachineCode)
     PM.add(createMachineFunctionPrinterPass(&std::cerr, "Before reg alloc:\n"));
 
index e9e64787e267bc199a55d105290d531c4897bdf8..6b2bb56ea7591668a34940a0dd755004230a1e3e 100644 (file)
@@ -44,7 +44,7 @@ endif
 # What the Sparc JIT requires
 ifdef ENABLE_SPARCV9_JIT
   JITLIBS  += LLVMSparcV9
-  ARCHLIBS += LLVMSparcV9InstrSched LLVMSparcV9LiveVar LLVMInstrumentation.a \
+  ARCHLIBS += LLVMSparcV9ModuloSched LLVMSparcV9InstrSched LLVMSparcV9LiveVar LLVMInstrumentation.a \
               LLVMProfilePaths LLVMBCWriter LLVMTransforms.a LLVMipo.a \
               LLVMipa.a LLVMDataStructure.a LLVMSparcV9RegAlloc
 endif
index 553ff952add321787c21fbd294cd82ee77c319b2..5e244cb5960d3fa95ab89a08bcbcc418ba9cf09a 100644 (file)
@@ -10,6 +10,7 @@
 LEVEL = ../..
 TOOLNAME = llc
 USEDLIBS = \
+       LLVMSparcV9ModuloSched \
        LLVMCBackend \
        LLVMPowerPC \
        LLVMSparcV9 \