Disable frame pointer elimination optimization.
<p>
- <li>-disable-local-ra
- <br>
- Use Simple RA instead of Local RegAlloc.
- <p>
-
<li>-disable-pattern-isel
<br>
Use the 'simple' X86 instruction selector.
architectures are:
<dl compact>
- <di> x86
- <dd>
- IA-32 (Pentium and above)
- <p>
+ <di> x86
+ <dd>IA-32 (Pentium and above)</dd>
- <di> sparc
- <dd>SPARC V9
+ <di> sparc
+ <dd>SPARC V9</dd>
</dl>
<p>
Print generated machine code.
<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
<br>
Print a summary of command line options.
//
extern const PassInfo *PHIEliminationID;
+enum RegAllocName { simple, local };
+
/// SimpleRegisterAllocation Pass - This pass converts the input machine code
/// from SSA form to use explicit registers by spilling every register. Wow,
/// great policy huh?
#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),
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());
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());