forked from OSchip/llvm-project
MachineCSE: Hoist isConstantPhysReg out of the loop, it checks for overlaps already.
llvm-svn: 161729
This commit is contained in:
parent
ef6494f24d
commit
59c8b411e0
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue