[LivePhysRegs] Remove registers clobbered by regmasks from the live set
Dead defs were being removed from the live set (in stepForward), but
registers clobbered by regmasks weren't (more specifically, they were
actually removed by removeRegsInMask, but then they were added back in).
llvm-svn: 331219
diff --git a/llvm/lib/CodeGen/LivePhysRegs.cpp b/llvm/lib/CodeGen/LivePhysRegs.cpp
index 9c637cf..b0cc62d 100644
--- a/llvm/lib/CodeGen/LivePhysRegs.cpp
+++ b/llvm/lib/CodeGen/LivePhysRegs.cpp
@@ -106,9 +106,13 @@
// Add defs to the set.
for (auto Reg : Clobbers) {
- // Skip dead defs. They shouldn't be added to the set.
+ // Skip dead defs and registers clobbered by regmasks. They shouldn't
+ // be added to the set.
if (Reg.second->isReg() && Reg.second->isDead())
continue;
+ if (Reg.second->isRegMask() &&
+ MachineOperand::clobbersPhysReg(Reg.second->getRegMask(), Reg.first))
+ continue;
addReg(Reg.first);
}
}