mirror of
https://github.com/RPCS3/llvm.git
synced 2025-05-14 09:26:22 +00:00
Change llc command line for register allocators
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8815 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
824b9a6609
commit
eed462b685
@ -95,11 +95,6 @@ OPTIONS
|
|||||||
Disable frame pointer elimination optimization.
|
Disable frame pointer elimination optimization.
|
||||||
<p>
|
<p>
|
||||||
|
|
||||||
<li>-disable-local-ra
|
|
||||||
<br>
|
|
||||||
Use Simple RA instead of Local RegAlloc.
|
|
||||||
<p>
|
|
||||||
|
|
||||||
<li>-disable-pattern-isel
|
<li>-disable-pattern-isel
|
||||||
<br>
|
<br>
|
||||||
Use the 'simple' X86 instruction selector.
|
Use the 'simple' X86 instruction selector.
|
||||||
@ -147,12 +142,10 @@ OPTIONS
|
|||||||
|
|
||||||
<dl compact>
|
<dl compact>
|
||||||
<di> x86
|
<di> x86
|
||||||
<dd>
|
<dd>IA-32 (Pentium and above)</dd>
|
||||||
IA-32 (Pentium and above)
|
|
||||||
<p>
|
|
||||||
|
|
||||||
<di> sparc
|
<di> sparc
|
||||||
<dd>SPARC V9
|
<dd>SPARC V9</dd>
|
||||||
</dl>
|
</dl>
|
||||||
<p>
|
<p>
|
||||||
|
|
||||||
@ -166,6 +159,19 @@ OPTIONS
|
|||||||
Print generated machine code.
|
Print generated machine code.
|
||||||
<p>
|
<p>
|
||||||
|
|
||||||
|
<li>-regalloc=<ra>
|
||||||
|
<br>
|
||||||
|
Specify the register allocator to use. The default is <i>simple<i>.
|
||||||
|
Valid register allocators are:
|
||||||
|
<dl compact>
|
||||||
|
<di> simple
|
||||||
|
<dd>Very simple register allocator</dd>
|
||||||
|
|
||||||
|
<di> local
|
||||||
|
<dd>Local register allocator</dd>
|
||||||
|
</dl>
|
||||||
|
<p>
|
||||||
|
|
||||||
<li> -help
|
<li> -help
|
||||||
<br>
|
<br>
|
||||||
Print a summary of command line options.
|
Print a summary of command line options.
|
||||||
|
@ -19,6 +19,8 @@ class TargetMachine;
|
|||||||
//
|
//
|
||||||
extern const PassInfo *PHIEliminationID;
|
extern const PassInfo *PHIEliminationID;
|
||||||
|
|
||||||
|
enum RegAllocName { simple, local };
|
||||||
|
|
||||||
/// SimpleRegisterAllocation Pass - This pass converts the input machine code
|
/// SimpleRegisterAllocation Pass - This pass converts the input machine code
|
||||||
/// from SSA form to use explicit registers by spilling every register. Wow,
|
/// from SSA form to use explicit registers by spilling every register. Wow,
|
||||||
/// great policy huh?
|
/// great policy huh?
|
||||||
|
@ -16,8 +16,15 @@
|
|||||||
#include "Support/Statistic.h"
|
#include "Support/Statistic.h"
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
cl::opt<bool> NoLocalRA("disable-local-ra",
|
cl::opt<RegAllocName>
|
||||||
cl::desc("Use Simple RA instead of Local RegAlloc"));
|
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::opt<bool> PrintCode("print-machineinstrs",
|
||||||
cl::desc("Print generated machine code"));
|
cl::desc("Print generated machine code"));
|
||||||
cl::opt<bool> NoPatternISel("disable-pattern-isel", cl::init(true),
|
cl::opt<bool> NoPatternISel("disable-pattern-isel", cl::init(true),
|
||||||
@ -66,10 +73,16 @@ bool X86TargetMachine::addPassesToEmitAssembly(PassManager &PM,
|
|||||||
PM.add(createMachineFunctionPrinterPass());
|
PM.add(createMachineFunctionPrinterPass());
|
||||||
|
|
||||||
// Perform register allocation to convert to a concrete x86 representation
|
// Perform register allocation to convert to a concrete x86 representation
|
||||||
if (NoLocalRA)
|
switch (RegAlloc) {
|
||||||
|
case simple:
|
||||||
PM.add(createSimpleRegisterAllocator());
|
PM.add(createSimpleRegisterAllocator());
|
||||||
else
|
break;
|
||||||
|
case local:
|
||||||
PM.add(createLocalRegisterAllocator());
|
PM.add(createLocalRegisterAllocator());
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
assert(0 && "no register allocator selected");
|
||||||
|
}
|
||||||
|
|
||||||
if (PrintCode)
|
if (PrintCode)
|
||||||
PM.add(createMachineFunctionPrinterPass());
|
PM.add(createMachineFunctionPrinterPass());
|
||||||
@ -113,10 +126,16 @@ bool X86TargetMachine::addPassesToJITCompile(FunctionPassManager &PM) {
|
|||||||
PM.add(createMachineFunctionPrinterPass());
|
PM.add(createMachineFunctionPrinterPass());
|
||||||
|
|
||||||
// Perform register allocation to convert to a concrete x86 representation
|
// Perform register allocation to convert to a concrete x86 representation
|
||||||
if (NoLocalRA)
|
switch (RegAlloc) {
|
||||||
|
case simple:
|
||||||
PM.add(createSimpleRegisterAllocator());
|
PM.add(createSimpleRegisterAllocator());
|
||||||
else
|
break;
|
||||||
|
case local:
|
||||||
PM.add(createLocalRegisterAllocator());
|
PM.add(createLocalRegisterAllocator());
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
assert(0 && "no register allocator selected");
|
||||||
|
}
|
||||||
|
|
||||||
if (PrintCode)
|
if (PrintCode)
|
||||||
PM.add(createMachineFunctionPrinterPass());
|
PM.add(createMachineFunctionPrinterPass());
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
; RUN: llvm-as < %s | lli -force-interpreter=false -disable-local-ra=false
|
; RUN: llvm-as < %s | lli -force-interpreter=false -regalloc=simple
|
||||||
;-print-machineinstrs
|
;-print-machineinstrs
|
||||||
|
|
||||||
int %main() {
|
int %main() {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
; RUN: llvm-as < %s | lli -force-interpreter=false -disable-local-ra
|
; RUN: llvm-as < %s | lli -force-interpreter=false -regalloc=simple
|
||||||
|
|
||||||
int %main(int %B) {
|
int %main(int %B) {
|
||||||
;%B = add int 0, 1
|
;%B = add int 0, 1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user