LiveVariables should not clobber MachineOperand::IsDead, ::IsKill on reserved physical registers

Patch by Nick Johnson <Nicholas.Paul.Johnson@deshawresearch.com>

Differential Revision: http://reviews.llvm.org/D14875

llvm-svn: 254012
This commit is contained in:
Matthias Braun 2015-11-24 20:06:56 +00:00
parent 130de7af7f
commit 147110da84
1 changed files with 6 additions and 2 deletions

View File

@ -522,11 +522,15 @@ void LiveVariables::runOnInstr(MachineInstr *MI,
continue;
unsigned MOReg = MO.getReg();
if (MO.isUse()) {
MO.setIsKill(false);
if (!(TargetRegisterInfo::isPhysicalRegister(MOReg) &&
MRI->isReserved(MOReg)))
MO.setIsKill(false);
if (MO.readsReg())
UseRegs.push_back(MOReg);
} else /*MO.isDef()*/ {
MO.setIsDead(false);
if (!(TargetRegisterInfo::isPhysicalRegister(MOReg) &&
MRI->isReserved(MOReg)))
MO.setIsDead(false);
DefRegs.push_back(MOReg);
}
}