LiveRegUnits: Break register loop when a clobber is encountered

This commit is contained in:
Matt Arsenault 2022-09-13 09:57:22 -04:00
parent 5c6d8a74e1
commit 740f920a1f
1 changed files with 6 additions and 2 deletions

View File

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