forked from OSchip/llvm-project
LiveRegUnits: Break register loop when a clobber is encountered
This commit is contained in:
parent
5c6d8a74e1
commit
740f920a1f
|
@ -22,8 +22,10 @@ using namespace llvm;
|
|||
void LiveRegUnits::removeRegsNotPreserved(const uint32_t *RegMask) {
|
||||
for (unsigned U = 0, E = TRI->getNumRegUnits(); U != E; ++U) {
|
||||
for (MCRegUnitRootIterator RootReg(U, TRI); RootReg.isValid(); ++RootReg) {
|
||||
if (MachineOperand::clobbersPhysReg(RegMask, *RootReg))
|
||||
if (MachineOperand::clobbersPhysReg(RegMask, *RootReg)) {
|
||||
Units.reset(U);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -31,8 +33,10 @@ void LiveRegUnits::removeRegsNotPreserved(const uint32_t *RegMask) {
|
|||
void LiveRegUnits::addRegsInMask(const uint32_t *RegMask) {
|
||||
for (unsigned U = 0, E = TRI->getNumRegUnits(); U != E; ++U) {
|
||||
for (MCRegUnitRootIterator RootReg(U, TRI); RootReg.isValid(); ++RootReg) {
|
||||
if (MachineOperand::clobbersPhysReg(RegMask, *RootReg))
|
||||
if (MachineOperand::clobbersPhysReg(RegMask, *RootReg)) {
|
||||
Units.set(U);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue