mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-02-18 19:28:16 +00:00
Add mechanism to select register allocator to use
llvm-svn: 5079
This commit is contained in:
parent
d44868a709
commit
4d0ca4b442
@ -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());
|
||||
|
Loading…
x
Reference in New Issue
Block a user