[llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp
Evan Cheng
evan.cheng at apple.com
Wed Apr 25 15:13:53 PDT 2007
Changes in directory llvm/lib/Target/PowerPC:
PPCRegisterInfo.cpp updated: 1.121 -> 1.122
---
Log message:
Match MachineFunction::UsedPhysRegs changes.
---
Diffs of the changes: (+6 -7)
PPCRegisterInfo.cpp | 13 ++++++-------
1 files changed, 6 insertions(+), 7 deletions(-)
Index: llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp
diff -u llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp:1.121 llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp:1.122
--- llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp:1.121 Tue Apr 3 07:35:28 2007
+++ llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp Wed Apr 25 17:13:27 2007
@@ -739,16 +739,16 @@
// HandleVRSaveUpdate - MI is the UPDATE_VRSAVE instruction introduced by the
// instruction selector. Based on the vector registers that have been used,
// transform this into the appropriate ORI instruction.
-static void HandleVRSaveUpdate(MachineInstr *MI, const bool *UsedRegs,
- const TargetInstrInfo &TII) {
+static void HandleVRSaveUpdate(MachineInstr *MI, const TargetInstrInfo &TII) {
+ MachineFunction *MF = MI->getParent()->getParent();
+
unsigned UsedRegMask = 0;
for (unsigned i = 0; i != 32; ++i)
- if (UsedRegs[VRRegNo[i]])
+ if (MF->isPhysRegUsed(VRRegNo[i]))
UsedRegMask |= 1 << (31-i);
// Live in and live out values already must be in the mask, so don't bother
// marking them.
- MachineFunction *MF = MI->getParent()->getParent();
for (MachineFunction::livein_iterator I =
MF->livein_begin(), E = MF->livein_end(); I != E; ++I) {
unsigned RegNo = PPCRegisterInfo::getRegisterNumbering(I->first);
@@ -846,8 +846,7 @@
PPCFunctionInfo *FI = MF.getInfo<PPCFunctionInfo>();
unsigned LR = getRARegister();
FI->setUsesLR(MF.isPhysRegUsed(LR));
- MF.changePhyRegUsed(LR, false);
-
+ MF.setPhysRegUnused(LR);
// Save R31 if necessary
int FPSI = FI->getFramePointerSaveIndex();
@@ -883,7 +882,7 @@
// process it.
for (unsigned i = 0; MBBI != MBB.end(); ++i, ++MBBI) {
if (MBBI->getOpcode() == PPC::UPDATE_VRSAVE) {
- HandleVRSaveUpdate(MBBI, MF.getUsedPhysregs(), TII);
+ HandleVRSaveUpdate(MBBI, TII);
break;
}
}
More information about the llvm-commits
mailing list