We may have situations in which a superregister is reserved and not
added to liveins, so we have to add the subregisters.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303949
91177308-0d34-0410-b5e6-
96231b3b80d8
// Skip the register if we are about to add one of its super registers.
bool ContainsSuperReg = false;
for (MCSuperRegIterator SReg(Reg, &TRI); SReg.isValid(); ++SReg) {
- if (LiveRegs.contains(*SReg)) {
+ if (LiveRegs.contains(*SReg) && !MRI.isReserved(*SReg)) {
ContainsSuperReg = true;
break;
}