diff options
author | Alkis Evlogimenos <alkis@evlogimenos.com> | 2003-10-02 06:13:19 +0000 |
---|---|---|
committer | Alkis Evlogimenos <alkis@evlogimenos.com> | 2003-10-02 06:13:19 +0000 |
commit | eed462b6857e596d327886acab4ad7e22db953ce (patch) | |
tree | 63df03b03746525db654f3da6115add4139b7ccc /lib | |
parent | 824b9a66090cb82acf0126f10646faba0d982a4a (diff) |
Change llc command line for register allocators
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8815 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Target/X86/X86TargetMachine.cpp | 31 |
1 files changed, 25 insertions, 6 deletions
diff --git a/lib/Target/X86/X86TargetMachine.cpp b/lib/Target/X86/X86TargetMachine.cpp index 60f8bbca19..8f6829f6de 100644 --- a/lib/Target/X86/X86TargetMachine.cpp +++ b/lib/Target/X86/X86TargetMachine.cpp @@ -16,8 +16,15 @@ #include "Support/Statistic.h" namespace { - cl::opt<bool> NoLocalRA("disable-local-ra", - cl::desc("Use Simple RA instead of Local RegAlloc")); + cl::opt<RegAllocName> + RegAlloc("regalloc", + cl::desc("Register allocator to use: (default = simple)"), + cl::Prefix, + cl::values(clEnumVal(simple, " simple register allocator"), + clEnumVal(local, " local register allocator"), + 0), + cl::init(local)); + cl::opt<bool> PrintCode("print-machineinstrs", cl::desc("Print generated machine code")); cl::opt<bool> NoPatternISel("disable-pattern-isel", cl::init(true), @@ -66,10 +73,16 @@ bool X86TargetMachine::addPassesToEmitAssembly(PassManager &PM, PM.add(createMachineFunctionPrinterPass()); // Perform register allocation to convert to a concrete x86 representation - if (NoLocalRA) + switch (RegAlloc) { + case simple: PM.add(createSimpleRegisterAllocator()); - else + break; + case local: PM.add(createLocalRegisterAllocator()); + break; + default: + assert(0 && "no register allocator selected"); + } if (PrintCode) PM.add(createMachineFunctionPrinterPass()); @@ -113,10 +126,16 @@ bool X86TargetMachine::addPassesToJITCompile(FunctionPassManager &PM) { PM.add(createMachineFunctionPrinterPass()); // Perform register allocation to convert to a concrete x86 representation - if (NoLocalRA) + switch (RegAlloc) { + case simple: PM.add(createSimpleRegisterAllocator()); - else + break; + case local: PM.add(createLocalRegisterAllocator()); + break; + default: + assert(0 && "no register allocator selected"); + } if (PrintCode) PM.add(createMachineFunctionPrinterPass()); |