diff options
author | Chris Lattner <sabre@nondot.org> | 2002-12-16 16:15:51 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2002-12-16 16:15:51 +0000 |
commit | e0c25aaf9950241406f0923cf532daa881fe3550 (patch) | |
tree | d001f6200d805b2094d17e7c7e3ad9ff1105fa09 | |
parent | 101b8cd9b67b548e75c5a05fc10e59be3ebf7588 (diff) | |
download | bcm5719-llvm-e0c25aaf9950241406f0923cf532daa881fe3550.tar.gz bcm5719-llvm-e0c25aaf9950241406f0923cf532daa881fe3550.zip |
Add mechanism to select register allocator to use
llvm-svn: 5079
-rw-r--r-- | llvm/lib/Target/X86/X86TargetMachine.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/llvm/lib/Target/X86/X86TargetMachine.cpp b/llvm/lib/Target/X86/X86TargetMachine.cpp index d710eb473d3..cdb7dea4155 100644 --- a/llvm/lib/Target/X86/X86TargetMachine.cpp +++ b/llvm/lib/Target/X86/X86TargetMachine.cpp @@ -8,11 +8,17 @@ #include "llvm/Transforms/Scalar.h" #include "llvm/Target/TargetMachineImpls.h" #include "llvm/CodeGen/MachineFunction.h" -#include "Support/Statistic.h" #include "llvm/PassManager.h" #include "X86.h" +#include "Support/CommandLine.h" +#include "Support/Statistic.h" #include <iostream> +namespace { + cl::opt<bool> UseLocalRA("local-ra", + cl::desc("Use Local RegAlloc instead of Simple RA")); +} + // allocateX86TargetMachine - Allocate and return a subclass of TargetMachine // that implements the X86 backend. // @@ -43,7 +49,10 @@ bool X86TargetMachine::addPassesToJITCompile(PassManager &PM) { DEBUG(PM.add(createMachineFunctionPrinterPass())); // Perform register allocation to convert to a concrete x86 representation - PM.add(createSimpleRegisterAllocator(*this)); + if (UseLocalRA) + PM.add(createLocalRegisterAllocator(*this)); + else + PM.add(createSimpleRegisterAllocator(*this)); // Print the instruction selected machine code... // PM.add(createMachineFunctionPrinterPass()); |