summaryrefslogtreecommitdiffstats
path: root/lib/CodeGen/DeadMachineInstructionElim.cpp
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2008-10-16 00:11:23 +0000
committerDan Gohman <gohman@apple.com>2008-10-16 00:11:23 +0000
commitb382c4dc235b78b606b305f1913fafc20eca472c (patch)
treee090ab899bc222811bf6bfd17c01ea3cebf601b0 /lib/CodeGen/DeadMachineInstructionElim.cpp
parenta7250ddc2848bc15f96abd15a4dd872abdc2d08b (diff)
downloadexternal_llvm-b382c4dc235b78b606b305f1913fafc20eca472c.zip
external_llvm-b382c4dc235b78b606b305f1913fafc20eca472c.tar.gz
external_llvm-b382c4dc235b78b606b305f1913fafc20eca472c.tar.bz2
Fix a subtle bug in DeadMachineInstructionElim's liveness
computation. A def of a register doesn't necessarily kill live super-registers. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57614 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/DeadMachineInstructionElim.cpp')
-rw-r--r--lib/CodeGen/DeadMachineInstructionElim.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/CodeGen/DeadMachineInstructionElim.cpp b/lib/CodeGen/DeadMachineInstructionElim.cpp
index 305ec0e..0d043f7 100644
--- a/lib/CodeGen/DeadMachineInstructionElim.cpp
+++ b/lib/CodeGen/DeadMachineInstructionElim.cpp
@@ -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);
}