summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/PowerPC/PPC64RegisterInfo.cpp
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
commitc1ba9fb6e1ae702e82aa780f5ad171c74dbe5b7b (patch)
tree55edb917ffd2312e9b94143a6b4968143a1717a6 /llvm/lib/Target/PowerPC/PPC64RegisterInfo.cpp
parentf76ccd43b8be79e43a8ffb66811b7e6236faa057 (diff)
downloadbcm5719-llvm-c1ba9fb6e1ae702e82aa780f5ad171c74dbe5b7b.tar.gz
bcm5719-llvm-c1ba9fb6e1ae702e82aa780f5ad171c74dbe5b7b.zip
Reduce uses of getRegClass
llvm-svn: 15968
Diffstat (limited to 'llvm/lib/Target/PowerPC/PPC64RegisterInfo.cpp')
-rw-r--r--llvm/lib/Target/PowerPC/PPC64RegisterInfo.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/llvm/lib/Target/PowerPC/PPC64RegisterInfo.cpp b/llvm/lib/Target/PowerPC/PPC64RegisterInfo.cpp
index b394568acd9..304f28c1bdd 100644
--- a/llvm/lib/Target/PowerPC/PPC64RegisterInfo.cpp
+++ b/llvm/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);
OpenPOWER on IntegriCloud