From 21590db8fdedc636700b8c662172f909be13abda Mon Sep 17 00:00:00 2001 From: Tanya Lattner Date: Thu, 18 Nov 2004 18:38:01 +0000 Subject: [PATCH] Adding option to llc for ModuloScheduling. By default it is turned off. llvm-svn: 17959 --- llvm/lib/Target/SparcV9/SparcV9TargetMachine.cpp | 15 +++++++++++++-- llvm/tools/Makefile.JIT | 2 +- llvm/tools/llc/Makefile | 1 + 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/llvm/lib/Target/SparcV9/SparcV9TargetMachine.cpp b/llvm/lib/Target/SparcV9/SparcV9TargetMachine.cpp index 3e0e8b931cc8..f5e19512ba4a 100644 --- a/llvm/lib/Target/SparcV9/SparcV9TargetMachine.cpp +++ b/llvm/lib/Target/SparcV9/SparcV9TargetMachine.cpp @@ -66,6 +66,9 @@ namespace { cl::opt DisableStrip("disable-strip", cl::desc("Do not strip the LLVM bytecode in executable")); + + cl::opt EnableModSched("enable-ModSched", cl::desc("Enable modulo scheduling pass instead of local scheduling")); + // Register the target. RegisterTarget 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")); diff --git a/llvm/tools/Makefile.JIT b/llvm/tools/Makefile.JIT index e9e64787e267..6b2bb56ea759 100644 --- a/llvm/tools/Makefile.JIT +++ b/llvm/tools/Makefile.JIT @@ -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 diff --git a/llvm/tools/llc/Makefile b/llvm/tools/llc/Makefile index 553ff952add3..5e244cb5960d 100644 --- a/llvm/tools/llc/Makefile +++ b/llvm/tools/llc/Makefile @@ -10,6 +10,7 @@ LEVEL = ../.. TOOLNAME = llc USEDLIBS = \ + LLVMSparcV9ModuloSched \ LLVMCBackend \ LLVMPowerPC \ LLVMSparcV9 \