aboutsummaryrefslogtreecommitdiff
path: root/lib/Target/X86/X86TargetMachine.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2002-12-16 16:15:51 +0000
committerChris Lattner <sabre@nondot.org>2002-12-16 16:15:51 +0000
commit439a27ac425cb9e3f3947268e268c22b78b7e7cd (patch)
treeedb611d1ff941b7d0cd04cbf659a3c1bfdb22310 /lib/Target/X86/X86TargetMachine.cpp
parentb74e83c89872a80f505bd7a83d1a21d159889c79 (diff)
Add mechanism to select register allocator to use
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5079 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/X86/X86TargetMachine.cpp')
-rw-r--r--lib/Target/X86/X86TargetMachine.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/lib/Target/X86/X86TargetMachine.cpp b/lib/Target/X86/X86TargetMachine.cpp
index d710eb473d..cdb7dea415 100644
--- a/lib/Target/X86/X86TargetMachine.cpp
+++ b/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());