Allocate fewer registers and tighten up alignment restrictions.
authorBrian Gaeke <gaeke@uiuc.edu>
Thu, 18 Nov 2004 00:25:20 +0000 (00:25 +0000)
committerBrian Gaeke <gaeke@uiuc.edu>
Thu, 18 Nov 2004 00:25:20 +0000 (00:25 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17929 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/Sparc/SparcRegisterInfo.td
lib/Target/Sparc/SparcTargetMachine.cpp
lib/Target/SparcV8/SparcV8RegisterInfo.td
lib/Target/SparcV8/SparcV8TargetMachine.cpp

index b3d202bf26fec15a704642273cedf46124afb574..6e0806a3a9d7636e05501b38c76e123d580bd751 100644 (file)
@@ -25,13 +25,20 @@ include "../SparcRegisterInfo.td"
 //
 def IntRegs : RegisterClass<i32, 32, [L0, L1, L2, L3, L4, L5, L6, L7,
                                      I0, I1, I2, I3, I4, I5,
-                                     G1, G2, G3, G4, G5, G6, G7,
+                                     G1,
                                      O0, O1, O2, O3, O4, O5, O7,
-                                     // Non-allocatable regs
-                                     O6, I6, I7, G0]> {
+                                     // Non-allocatable regs:
+                                     G2, G3, G4, // FIXME: OK for use only in
+                                                 // applications, not libraries.
+                                     O6, // stack ptr
+                                     I6, // frame ptr
+                                     I7, // return address
+                                     G0, // constant zero
+                                     G5, G6, G7 // reserved for kernel
+                                     ]> {
   let Methods = [{
     iterator allocation_order_end(MachineFunction &MF) const {
-      return end()-4;  // Don't allocate special registers
+      return end()-10;  // Don't allocate special registers
     }
   }];
 }
index a6b69d62633c2479830d9e6cb6fc84a8684c4031..604f683499f760d98002f2f36a164f9ed642650f 100644 (file)
@@ -31,7 +31,7 @@ namespace {
 ///
 SparcV8TargetMachine::SparcV8TargetMachine(const Module &M,
                                            IntrinsicLowering *IL)
-  : TargetMachine("SparcV8", IL, false, 4, 4, 8, 4, 8),
+  : TargetMachine("SparcV8", IL, false, 4, 4, 8, 4, 8, 4, 4, 4, 4),
     FrameInfo(TargetFrameInfo::StackGrowsDown, 8, 0), JITInfo(*this) {
 }
 
index b3d202bf26fec15a704642273cedf46124afb574..6e0806a3a9d7636e05501b38c76e123d580bd751 100644 (file)
@@ -25,13 +25,20 @@ include "../SparcRegisterInfo.td"
 //
 def IntRegs : RegisterClass<i32, 32, [L0, L1, L2, L3, L4, L5, L6, L7,
                                      I0, I1, I2, I3, I4, I5,
-                                     G1, G2, G3, G4, G5, G6, G7,
+                                     G1,
                                      O0, O1, O2, O3, O4, O5, O7,
-                                     // Non-allocatable regs
-                                     O6, I6, I7, G0]> {
+                                     // Non-allocatable regs:
+                                     G2, G3, G4, // FIXME: OK for use only in
+                                                 // applications, not libraries.
+                                     O6, // stack ptr
+                                     I6, // frame ptr
+                                     I7, // return address
+                                     G0, // constant zero
+                                     G5, G6, G7 // reserved for kernel
+                                     ]> {
   let Methods = [{
     iterator allocation_order_end(MachineFunction &MF) const {
-      return end()-4;  // Don't allocate special registers
+      return end()-10;  // Don't allocate special registers
     }
   }];
 }
index a6b69d62633c2479830d9e6cb6fc84a8684c4031..604f683499f760d98002f2f36a164f9ed642650f 100644 (file)
@@ -31,7 +31,7 @@ namespace {
 ///
 SparcV8TargetMachine::SparcV8TargetMachine(const Module &M,
                                            IntrinsicLowering *IL)
-  : TargetMachine("SparcV8", IL, false, 4, 4, 8, 4, 8),
+  : TargetMachine("SparcV8", IL, false, 4, 4, 8, 4, 8, 4, 4, 4, 4),
     FrameInfo(TargetFrameInfo::StackGrowsDown, 8, 0), JITInfo(*this) {
 }