Match MachineFunction::UsedPhysRegs changes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36452 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Target/ARM/ARMRegisterInfo.cpp b/lib/Target/ARM/ARMRegisterInfo.cpp
index 8177c80..96c6d38 100644
--- a/lib/Target/ARM/ARMRegisterInfo.cpp
+++ b/lib/Target/ARM/ARMRegisterInfo.cpp
@@ -350,9 +350,6 @@
   // Some targets reserve R9.
   if (STI.isR9Reserved())
     Reserved.set(ARM::R9);
-  // At PEI time, if LR is used, it will be spilled upon entry.
-  if (MF.getUsedPhysregs() && !MF.isPhysRegUsed((unsigned)ARM::LR))
-    Reserved.set(ARM::LR);
   return Reserved;
 }
 
@@ -1094,7 +1091,7 @@
     // If LR is not spilled, but at least one of R4, R5, R6, and R7 is spilled.
     // Spill LR as well so we can fold BX_RET to the registers restore (LDM).
     if (!LRSpilled && CS1Spilled) {
-      MF.changePhyRegUsed(ARM::LR, true);
+      MF.setPhysRegUsed(ARM::LR);
       AFI->setCSRegisterIsSpilled(ARM::LR);
       NumGPRSpills++;
       UnspilledCS1GPRs.erase(std::find(UnspilledCS1GPRs.begin(),
@@ -1106,7 +1103,7 @@
     // Darwin ABI requires FP to point to the stack slot that contains the
     // previous FP.
     if (STI.isTargetDarwin() || hasFP(MF)) {
-      MF.changePhyRegUsed(FramePtr, true);
+      MF.setPhysRegUsed(FramePtr);
       NumGPRSpills++;
     }
 
@@ -1117,13 +1114,13 @@
     if (TargetAlign == 8 && (NumGPRSpills & 1)) {
       if (CS1Spilled && !UnspilledCS1GPRs.empty()) {
         unsigned Reg = UnspilledCS1GPRs.front();
-        MF.changePhyRegUsed(Reg, true);
+        MF.setPhysRegUsed(Reg);
         AFI->setCSRegisterIsSpilled(Reg);
         if (!isReservedReg(MF, Reg))
           ExtraCSSpill = true;
       } else if (!UnspilledCS2GPRs.empty()) {
         unsigned Reg = UnspilledCS2GPRs.front();
-        MF.changePhyRegUsed(Reg, true);
+        MF.setPhysRegUsed(Reg);
         AFI->setCSRegisterIsSpilled(Reg);
         if (!isReservedReg(MF, Reg))
           ExtraCSSpill = true;
@@ -1178,7 +1175,7 @@
         }
         if (Extras.size() && NumExtras == 0) {
           for (unsigned i = 0, e = Extras.size(); i != e; ++i) {
-            MF.changePhyRegUsed(Extras[i], true);
+            MF.setPhysRegUsed(Extras[i]);
             AFI->setCSRegisterIsSpilled(Extras[i]);
           }
         } else {
@@ -1192,7 +1189,7 @@
   }
 
   if (ForceLRSpill) {
-    MF.changePhyRegUsed(ARM::LR, true);
+    MF.setPhysRegUsed(ARM::LR);
     AFI->setCSRegisterIsSpilled(ARM::LR);
     AFI->setLRIsSpilledForFarJump(true);
   }
diff --git a/lib/Target/PowerPC/PPCRegisterInfo.cpp b/lib/Target/PowerPC/PPCRegisterInfo.cpp
index dbf2cf4..89fa90b 100644
--- a/lib/Target/PowerPC/PPCRegisterInfo.cpp
+++ b/lib/Target/PowerPC/PPCRegisterInfo.cpp
@@ -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;
     }
   }
diff --git a/lib/Target/X86/X86FloatingPoint.cpp b/lib/Target/X86/X86FloatingPoint.cpp
index 7bed303..2439d19 100644
--- a/lib/Target/X86/X86FloatingPoint.cpp
+++ b/lib/Target/X86/X86FloatingPoint.cpp
@@ -161,12 +161,11 @@
 bool FPS::runOnMachineFunction(MachineFunction &MF) {
   // We only need to run this pass if there are any FP registers used in this
   // function.  If it is all integer, there is nothing for us to do!
-  const bool *PhysRegsUsed = MF.getUsedPhysregs();
   bool FPIsUsed = false;
 
   assert(X86::FP6 == X86::FP0+6 && "Register enums aren't sorted right!");
   for (unsigned i = 0; i <= 6; ++i)
-    if (PhysRegsUsed[X86::FP0+i]) {
+    if (MF.isPhysRegUsed(X86::FP0+i)) {
       FPIsUsed = true;
       break;
     }