MachineCSE: Hoist isConstantPhysReg out of the loop, it checks for overlaps already.

llvm-svn: 161729
This commit is contained in:
Benjamin Kramer 2012-08-11 20:42:59 +00:00
parent b338b22e72
commit 28e133c8f2

View File

@ -215,11 +215,10 @@ bool MachineCSE::hasLivePhysRegDefUses(const MachineInstr *MI,
if (MO.isDef() &&
(MO.isDead() || isPhysDefTriviallyDead(Reg, I, MBB->end())))
continue;
for (MCRegAliasIterator AI(Reg, TRI, true); AI.isValid(); ++AI) {
// Reading constant physregs is ok.
if (!MRI->isConstantPhysReg(*AI, *MBB->getParent()))
// Reading constant physregs is ok.
if (!MRI->isConstantPhysReg(Reg, *MBB->getParent()))
for (MCRegAliasIterator AI(Reg, TRI, true); AI.isValid(); ++AI)
PhysRefs.insert(*AI);
}
if (MO.isDef())
PhysDefs.push_back(Reg);
}