[llvm-commits] CVS: llvm/lib/Target/PowerPC/PPC32RegisterInfo.cpp PPC64RegisterInfo.cpp

Chris Lattner lattner at cs.uiuc.edu
Sat Aug 21 12:51:29 PDT 2004



Changes in directory llvm/lib/Target/PowerPC:

PPC32RegisterInfo.cpp updated: 1.1 -> 1.2
PPC64RegisterInfo.cpp updated: 1.2 -> 1.3
---
Log message:

Reduce uses of getRegClass


---
Diffs of the changes:  (+6 -8)

Index: llvm/lib/Target/PowerPC/PPC32RegisterInfo.cpp
diff -u llvm/lib/Target/PowerPC/PPC32RegisterInfo.cpp:1.1 llvm/lib/Target/PowerPC/PPC32RegisterInfo.cpp:1.2
--- llvm/lib/Target/PowerPC/PPC32RegisterInfo.cpp:1.1	Mon Aug 16 23:55:41 2004
+++ llvm/lib/Target/PowerPC/PPC32RegisterInfo.cpp	Sat Aug 21 14:51:17 2004
@@ -238,9 +238,8 @@
   // Add the size of R1 to  NumBytes size for the store of R1 to the bottom 
   // of the stack and round the size to a multiple of the alignment.
   unsigned Align = MF.getTarget().getFrameInfo()->getStackAlignment();
-  unsigned R1Size = getRegClass(PPC::R1)->getSize();
-  unsigned R31Size = getRegClass(PPC::R31)->getSize();
-  unsigned Size = (hasFP(MF)) ? R1Size + R31Size : R1Size;
+  unsigned GPRSize = getSpillSize(PPC::R1);
+  unsigned Size = hasFP(MF) ? GPRSize + GPRSize : GPRSize;
   NumBytes = (NumBytes+Size+Align-1)/Align*Align;
 
   // Update frame info to pretend that this is part of the stack...
@@ -262,7 +261,7 @@
   }
   
   if (hasFP(MF)) {
-    MI = BuildMI(PPC::STW, 3).addReg(PPC::R31).addSImm(R1Size).addReg(PPC::R1);
+    MI = BuildMI(PPC::STW, 3).addReg(PPC::R31).addSImm(GPRSize).addReg(PPC::R1);
     MBB.insert(MBBI, MI);
     MI = BuildMI(PPC::OR, 2, PPC::R31).addReg(PPC::R1).addReg(PPC::R1);
     MBB.insert(MBBI, MI);


Index: llvm/lib/Target/PowerPC/PPC64RegisterInfo.cpp
diff -u llvm/lib/Target/PowerPC/PPC64RegisterInfo.cpp:1.2 llvm/lib/Target/PowerPC/PPC64RegisterInfo.cpp:1.3
--- llvm/lib/Target/PowerPC/PPC64RegisterInfo.cpp:1.2	Thu Aug 19 11:28:30 2004
+++ llvm/lib/Target/PowerPC/PPC64RegisterInfo.cpp	Sat Aug 21 14:51:17 2004
@@ -240,9 +240,8 @@
   // Add the size of R1 to  NumBytes size for the store of R1 to the bottom 
   // of the stack and round the size to a multiple of the alignment.
   unsigned Align = MF.getTarget().getFrameInfo()->getStackAlignment();
-  unsigned R1Size = getRegClass(PPC::R1)->getSize();
-  unsigned R31Size = getRegClass(PPC::R31)->getSize();
-  unsigned Size = (hasFP(MF)) ? R1Size + R31Size : R1Size;
+  unsigned GPRSize = getSpillSize(PPC::R1);
+  unsigned Size = hasFP(MF) ? GPRSize + GPRSize : GPRSize;
   NumBytes = (NumBytes+Size+Align-1)/Align*Align;
 
   // Update frame info to pretend that this is part of the stack...
@@ -264,7 +263,7 @@
   }
   
   if (hasFP(MF)) {
-    MI = BuildMI(PPC::STD, 3).addReg(PPC::R31).addSImm(R1Size).addReg(PPC::R1);
+    MI = BuildMI(PPC::STD, 3).addReg(PPC::R31).addSImm(GPRSize).addReg(PPC::R1);
     MBB.insert(MBBI, MI);
     MI = BuildMI(PPC::OR, 2, PPC::R31).addReg(PPC::R1).addReg(PPC::R1);
     MBB.insert(MBBI, MI);






More information about the llvm-commits mailing list