aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-08-21 19:51:17 +0000
committerChris Lattner <sabre@nondot.org>2004-08-21 19:51:17 +0000
commit8edcd8465361f3aa29082e1b1f2a1c88afc0836a (patch)
treec20a4cc51d222fb008b4c323c260859717de235c
parentfa1face30a1943aa17560f6f6e10bb667b257065 (diff)
Reduce uses of getRegClass
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15968 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Target/PowerPC/PPC64RegisterInfo.cpp7
-rw-r--r--lib/Target/PowerPC/PPCRegisterInfo.cpp7
2 files changed, 6 insertions, 8 deletions
diff --git a/lib/Target/PowerPC/PPC64RegisterInfo.cpp b/lib/Target/PowerPC/PPC64RegisterInfo.cpp
index b394568acd..304f28c1bd 100644
--- a/lib/Target/PowerPC/PPC64RegisterInfo.cpp
+++ b/lib/Target/PowerPC/PPC64RegisterInfo.cpp
@@ -240,9 +240,8 @@ void PPC64RegisterInfo::emitPrologue(MachineFunction &MF) const {
// 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 @@ void PPC64RegisterInfo::emitPrologue(MachineFunction &MF) const {
}
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);
diff --git a/lib/Target/PowerPC/PPCRegisterInfo.cpp b/lib/Target/PowerPC/PPCRegisterInfo.cpp
index 6033f53aaa..c881c8281e 100644
--- a/lib/Target/PowerPC/PPCRegisterInfo.cpp
+++ b/lib/Target/PowerPC/PPCRegisterInfo.cpp
@@ -238,9 +238,8 @@ void PPC32RegisterInfo::emitPrologue(MachineFunction &MF) const {
// 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 @@ void PPC32RegisterInfo::emitPrologue(MachineFunction &MF) const {
}
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);