Kaynağa Gözat

MachineRegisterInfo: Remove unused arg from isConstantPhysReg(); NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285423 91177308-0d34-0410-b5e6-96231b3b80d8
Matthias Braun 8 yıl önce
ebeveyn
işleme
15cdf2c20b

+ 1 - 1
include/llvm/CodeGen/MachineRegisterInfo.h

@@ -553,7 +553,7 @@ public:
   /// isConstantPhysReg - Returns true if PhysReg is unallocatable and constant
   /// isConstantPhysReg - Returns true if PhysReg is unallocatable and constant
   /// throughout the function.  It is safe to move instructions that read such
   /// throughout the function.  It is safe to move instructions that read such
   /// a physreg.
   /// a physreg.
-  bool isConstantPhysReg(unsigned PhysReg, const MachineFunction &MF) const;
+  bool isConstantPhysReg(unsigned PhysReg) const;
 
 
   /// Get an iterator over the pressure sets affected by the given physical or
   /// Get an iterator over the pressure sets affected by the given physical or
   /// virtual register. If RegUnit is physical, it must be a register unit (from
   /// virtual register. If RegUnit is physical, it must be a register unit (from

+ 1 - 1
lib/CodeGen/LiveRangeEdit.cpp

@@ -103,7 +103,7 @@ bool LiveRangeEdit::allUsesAvailableAt(const MachineInstr *OrigMI,
 
 
     // We can't remat physreg uses, unless it is a constant.
     // We can't remat physreg uses, unless it is a constant.
     if (TargetRegisterInfo::isPhysicalRegister(MO.getReg())) {
     if (TargetRegisterInfo::isPhysicalRegister(MO.getReg())) {
-      if (MRI.isConstantPhysReg(MO.getReg(), *OrigMI->getParent()->getParent()))
+      if (MRI.isConstantPhysReg(MO.getReg()))
         continue;
         continue;
       return false;
       return false;
     }
     }

+ 1 - 1
lib/CodeGen/MachineCSE.cpp

@@ -227,7 +227,7 @@ bool MachineCSE::hasLivePhysRegDefUses(const MachineInstr *MI,
     if (TargetRegisterInfo::isVirtualRegister(Reg))
     if (TargetRegisterInfo::isVirtualRegister(Reg))
       continue;
       continue;
     // Reading constant physregs is ok.
     // Reading constant physregs is ok.
-    if (!MRI->isConstantPhysReg(Reg, *MBB->getParent()))
+    if (!MRI->isConstantPhysReg(Reg))
       for (MCRegAliasIterator AI(Reg, TRI, true); AI.isValid(); ++AI)
       for (MCRegAliasIterator AI(Reg, TRI, true); AI.isValid(); ++AI)
         PhysRefs.insert(*AI);
         PhysRefs.insert(*AI);
   }
   }

+ 1 - 1
lib/CodeGen/MachineLICM.cpp

@@ -895,7 +895,7 @@ bool MachineLICM::IsLoopInvariantInst(MachineInstr &I) {
         // If the physreg has no defs anywhere, it's just an ambient register
         // If the physreg has no defs anywhere, it's just an ambient register
         // and we can freely move its uses. Alternatively, if it's allocatable,
         // and we can freely move its uses. Alternatively, if it's allocatable,
         // it could get allocated to something with a def during allocation.
         // it could get allocated to something with a def during allocation.
-        if (!MRI->isConstantPhysReg(Reg, *I.getParent()->getParent()))
+        if (!MRI->isConstantPhysReg(Reg))
           return false;
           return false;
         // Otherwise it's safe to move.
         // Otherwise it's safe to move.
         continue;
         continue;

+ 1 - 2
lib/CodeGen/MachineRegisterInfo.cpp

@@ -468,8 +468,7 @@ void MachineRegisterInfo::freezeReservedRegs(const MachineFunction &MF) {
          "Invalid ReservedRegs vector from target");
          "Invalid ReservedRegs vector from target");
 }
 }
 
 
-bool MachineRegisterInfo::isConstantPhysReg(unsigned PhysReg,
-                                            const MachineFunction &MF) const {
+bool MachineRegisterInfo::isConstantPhysReg(unsigned PhysReg) const {
   assert(TargetRegisterInfo::isPhysicalRegister(PhysReg));
   assert(TargetRegisterInfo::isPhysicalRegister(PhysReg));
 
 
   const TargetRegisterInfo *TRI = getTargetRegisterInfo();
   const TargetRegisterInfo *TRI = getTargetRegisterInfo();

+ 1 - 1
lib/CodeGen/MachineSink.cpp

@@ -636,7 +636,7 @@ MachineSinking::FindSuccToSinkTo(MachineInstr &MI, MachineBasicBlock *MBB,
         // If the physreg has no defs anywhere, it's just an ambient register
         // If the physreg has no defs anywhere, it's just an ambient register
         // and we can freely move its uses. Alternatively, if it's allocatable,
         // and we can freely move its uses. Alternatively, if it's allocatable,
         // it could get allocated to something with a def during allocation.
         // it could get allocated to something with a def during allocation.
-        if (!MRI->isConstantPhysReg(Reg, *MBB->getParent()))
+        if (!MRI->isConstantPhysReg(Reg))
           return nullptr;
           return nullptr;
       } else if (!MO.isDead()) {
       } else if (!MO.isDead()) {
         // A def that isn't dead. We can't move it.
         // A def that isn't dead. We can't move it.

+ 1 - 1
lib/CodeGen/TargetInstrInfo.cpp

@@ -884,7 +884,7 @@ bool TargetInstrInfo::isReallyTriviallyReMaterializableGeneric(
         // If the physreg has no defs anywhere, it's just an ambient register
         // If the physreg has no defs anywhere, it's just an ambient register
         // and we can freely move its uses. Alternatively, if it's allocatable,
         // and we can freely move its uses. Alternatively, if it's allocatable,
         // it could get allocated to something with a def during allocation.
         // it could get allocated to something with a def during allocation.
-        if (!MRI.isConstantPhysReg(Reg, MF))
+        if (!MRI.isConstantPhysReg(Reg))
           return false;
           return false;
       } else {
       } else {
         // A physreg def. We can't remat it.
         // A physreg def. We can't remat it.