LiveIntervalAnalysis: Mark subregister defs as undef when we determined they are only reading a dead superregister value

This was not necessary before as this case can only be detected when the
liveness analysis is at subregister level.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226733 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Matthias Braun
2015-01-21 22:55:13 +00:00
parent f04568139a
commit 9a43e3d47f
3 changed files with 29 additions and 5 deletions

View File

@ -1889,6 +1889,14 @@ bool MachineInstr::addRegisterDead(unsigned Reg,
return true;
}
void MachineInstr::addRegisterDefReadUndef(unsigned Reg) {
for (MachineOperand &MO : operands()) {
if (!MO.isReg() || !MO.isDef() || MO.getReg() != Reg || MO.getSubReg() == 0)
continue;
MO.setIsUndef();
}
}
void MachineInstr::addRegisterDefined(unsigned Reg,
const TargetRegisterInfo *RegInfo) {
if (TargetRegisterInfo::isPhysicalRegister(Reg)) {