Fix a subtle bug in DeadMachineInstructionElim's liveness

computation. A def of a register doesn't necessarily kill
live super-registers.

llvm-svn: 57614
This commit is contained in:
Dan Gohman 2008-10-16 00:11:23 +00:00
parent 5f68d4571b
commit bf293c48db
1 changed files with 4 additions and 1 deletions

View File

@ -126,7 +126,10 @@ bool DeadMachineInstructionElim::runOnMachineFunction(MachineFunction &MF) {
unsigned Reg = MO.getReg();
if (Reg != 0 && TargetRegisterInfo::isPhysicalRegister(Reg)) {
LivePhysRegs.reset(Reg);
for (const unsigned *AliasSet = TRI->getAliasSet(Reg);
// Check the subreg set, not the alias set, because a def
// of a super-register may still be partially live after
// this def.
for (const unsigned *AliasSet = TRI->getSubRegisters(Reg);
*AliasSet; ++AliasSet)
LivePhysRegs.reset(*AliasSet);
}