[llvm-commits] [llvm] r57614 - /llvm/trunk/lib/CodeGen/DeadMachineInstructionElim.cpp

Dan Gohman gohman at apple.com
Wed Oct 15 17:11:23 PDT 2008


Author: djg
Date: Wed Oct 15 19:11:23 2008
New Revision: 57614

URL: http://llvm.org/viewvc/llvm-project?rev=57614&view=rev
Log:
Fix a subtle bug in DeadMachineInstructionElim's liveness
computation. A def of a register doesn't necessarily kill
live super-registers.

Modified:
    llvm/trunk/lib/CodeGen/DeadMachineInstructionElim.cpp

Modified: llvm/trunk/lib/CodeGen/DeadMachineInstructionElim.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/DeadMachineInstructionElim.cpp?rev=57614&r1=57613&r2=57614&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/DeadMachineInstructionElim.cpp (original)
+++ llvm/trunk/lib/CodeGen/DeadMachineInstructionElim.cpp Wed Oct 15 19:11:23 2008
@@ -126,7 +126,10 @@
           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);
           }





More information about the llvm-commits mailing list