[llvm-commits] CVS: llvm/lib/Target/X86/X86TargetMachine.cpp

Chris Lattner lattner at cs.uiuc.edu
Mon Dec 16 10:17:01 PST 2002


Changes in directory llvm/lib/Target/X86:

X86TargetMachine.cpp updated: 1.6 -> 1.7

---
Log message:

Add mechanism to select register allocator to use


---
Diffs of the changes:

Index: llvm/lib/Target/X86/X86TargetMachine.cpp
diff -u llvm/lib/Target/X86/X86TargetMachine.cpp:1.6 llvm/lib/Target/X86/X86TargetMachine.cpp:1.7
--- llvm/lib/Target/X86/X86TargetMachine.cpp:1.6	Mon Dec 16 08:38:13 2002
+++ llvm/lib/Target/X86/X86TargetMachine.cpp	Mon Dec 16 10:15:51 2002
@@ -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 @@
   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());





More information about the llvm-commits mailing list