[llvm-commits] [llvm] r48653 - in /llvm/trunk/lib/CodeGen: SimpleRegisterCoalescing.cpp VirtRegMap.cpp

Evan Cheng evan.cheng at apple.com
Fri Mar 21 12:09:30 PDT 2008


Author: evancheng
Date: Fri Mar 21 14:09:30 2008
New Revision: 48653

URL: http://llvm.org/viewvc/llvm-project?rev=48653&view=rev
Log:
A couple of kill marker maintainence bug.

Modified:
    llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp
    llvm/trunk/lib/CodeGen/VirtRegMap.cpp

Modified: llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp?rev=48653&r1=48652&r2=48653&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp (original)
+++ llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp Fri Mar 21 14:09:30 2008
@@ -432,6 +432,7 @@
   for (MachineRegisterInfo::reg_iterator I = mri_->reg_begin(SrcReg),
          E = mri_->reg_end(); I != E; ) {
     MachineOperand &O = I.getOperand();
+    MachineInstr *UseMI = &*I;
     ++I;
     if (DstIsPhys) {
       unsigned UseSubIdx = O.getSubReg();
@@ -451,6 +452,9 @@
         assert(OldSubIdx < SubIdx && "Conflicting sub-register index!");
       else if (SubIdx)
         O.setSubReg(SubIdx);
+      // Remove would-be duplicated kill marker.
+      if (O.isKill() && UseMI->killsRegister(DstReg))
+        O.setIsKill(false);
       O.setReg(DstReg);
     }
   }

Modified: llvm/trunk/lib/CodeGen/VirtRegMap.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/VirtRegMap.cpp?rev=48653&r1=48652&r2=48653&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/VirtRegMap.cpp (original)
+++ llvm/trunk/lib/CodeGen/VirtRegMap.cpp Fri Mar 21 14:09:30 2008
@@ -610,7 +610,7 @@
     if (Reg == 0)
       continue;
     
-    if (RegKills[Reg]) {
+    if (RegKills[Reg] && KillOps[Reg]->getParent() != &MI) {
       // That can't be right. Register is killed but not re-defined and it's
       // being reused. Let's fix that.
       KillOps[Reg]->setIsKill(false);





More information about the llvm-commits mailing list