MachineRegisterInfo: Remove unused arg from isConstantPhysReg(); NFC

llvm-svn: 285423
This commit is contained in:
Matthias Braun 2016-10-28 18:05:09 +00:00
parent 35a024fe0f
commit de8c1b3433
7 changed files with 7 additions and 8 deletions

View File

@ -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

View File

@ -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;
} }

View File

@ -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);
} }

View File

@ -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;

View File

@ -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, bool MachineRegisterInfo::isConstantPhysReg(unsigned PhysReg) const {
const MachineFunction &MF) const {
assert(TargetRegisterInfo::isPhysicalRegister(PhysReg)); assert(TargetRegisterInfo::isPhysicalRegister(PhysReg));
const TargetRegisterInfo *TRI = getTargetRegisterInfo(); const TargetRegisterInfo *TRI = getTargetRegisterInfo();

View File

@ -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.

View File

@ -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.