[llvm-commits] CVS: llvm/lib/CodeGen/LiveIntervals.cpp LiveVariables.cpp PHIElimination.cpp TwoAddressInstructionPass.cpp

Chris Lattner lattner at cs.uiuc.edu
Sun Jul 18 23:55:27 PDT 2004



Changes in directory llvm/lib/CodeGen:

LiveIntervals.cpp updated: 1.92 -> 1.93
LiveVariables.cpp updated: 1.38 -> 1.39
PHIElimination.cpp updated: 1.28 -> 1.29
TwoAddressInstructionPass.cpp updated: 1.20 -> 1.21

---
Log message:

Simplify the interface to LiveVariables::addVirtualRegister(Killed|Dead)


---
Diffs of the changes:  (+10 -9)

Index: llvm/lib/CodeGen/LiveIntervals.cpp
diff -u llvm/lib/CodeGen/LiveIntervals.cpp:1.92 llvm/lib/CodeGen/LiveIntervals.cpp:1.93
--- llvm/lib/CodeGen/LiveIntervals.cpp:1.92	Mon Jul 19 00:55:50 2004
+++ llvm/lib/CodeGen/LiveIntervals.cpp	Mon Jul 19 01:55:17 2004
@@ -263,7 +263,7 @@
                         nI.addRange(start, end);
                         added.push_back(&nI);
                         // update live variables
-                        lv_->addVirtualRegisterKilled(nReg, mi->getParent(),mi);
+                        lv_->addVirtualRegisterKilled(nReg, mi);
                         DEBUG(std::cerr << "\t\t\t\tadded new interval: "
                               << nI << '\n');
                     }


Index: llvm/lib/CodeGen/LiveVariables.cpp
diff -u llvm/lib/CodeGen/LiveVariables.cpp:1.38 llvm/lib/CodeGen/LiveVariables.cpp:1.39
--- llvm/lib/CodeGen/LiveVariables.cpp:1.38	Mon Jul 19 01:26:50 2004
+++ llvm/lib/CodeGen/LiveVariables.cpp	Mon Jul 19 01:55:17 2004
@@ -99,7 +99,7 @@
          "Should have kill for defblock!");
 
   // Add a new kill entry for this basic block.
-  VRInfo.Kills.push_back(std::make_pair(MBB, MI));
+  VRInfo.Kills.push_back(std::make_pair(MI->getParent(), MI));
 
   // Update all dominating blocks to mark them known live.
   const BasicBlock *BB = MBB->getBasicBlock();
@@ -233,7 +233,8 @@
 
             assert(VRInfo.DefInst == 0 && "Variable multiply defined!");
             VRInfo.DefInst = MI;
-            VRInfo.Kills.push_back(std::make_pair(MBB, MI)); // Defaults to dead
+            // Defaults to dead
+            VRInfo.Kills.push_back(std::make_pair(MI->getParent(), MI));
           } else if (MRegisterInfo::isPhysicalRegister(MO.getReg()) &&
                      AllocatablePhysicalRegisters[MO.getReg()]) {
             HandlePhysRegDef(MO.getReg(), MI);


Index: llvm/lib/CodeGen/PHIElimination.cpp
diff -u llvm/lib/CodeGen/PHIElimination.cpp:1.28 llvm/lib/CodeGen/PHIElimination.cpp:1.29
--- llvm/lib/CodeGen/PHIElimination.cpp:1.28	Wed Jun 30 23:29:47 2004
+++ llvm/lib/CodeGen/PHIElimination.cpp	Mon Jul 19 01:55:17 2004
@@ -122,7 +122,7 @@
       // each for each incoming block), the "def" block and instruction fields
       // for the VarInfo is not filled in.
       //
-      LV->addVirtualRegisterKilled(IncomingReg, &MBB, PHICopy);
+      LV->addVirtualRegisterKilled(IncomingReg, PHICopy);
 
       // Since we are going to be deleting the PHI node, if it is the last use
       // of any registers, or if the value itself is dead, we need to move this
@@ -140,7 +140,7 @@
 
         // Add all of the kills back, which will update the appropriate info...
         for (unsigned i = 0, e = Range.size(); i != e; ++i)
-          LV->addVirtualRegisterKilled(Range[i].second, &MBB, PHICopy);
+          LV->addVirtualRegisterKilled(Range[i].second, PHICopy);
       }
 
       RKs = LV->dead_range(MI);
@@ -149,7 +149,7 @@
         Range.assign(RKs.first, RKs.second);
         LV->removeVirtualRegistersDead(RKs.first, RKs.second);
         for (unsigned i = 0, e = Range.size(); i != e; ++i)
-          LV->addVirtualRegisterDead(Range[i].second, &MBB, PHICopy);
+          LV->addVirtualRegisterDead(Range[i].second, PHICopy);
       }
     }
 
@@ -251,7 +251,7 @@
           //
           if (!ValueIsLive) {
             MachineBasicBlock::iterator Prev = prior(I);
-            LV->addVirtualRegisterKilled(SrcReg, &opBlock, Prev);
+            LV->addVirtualRegisterKilled(SrcReg, Prev);
           }
         }
       }


Index: llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
diff -u llvm/lib/CodeGen/TwoAddressInstructionPass.cpp:1.20 llvm/lib/CodeGen/TwoAddressInstructionPass.cpp:1.21
--- llvm/lib/CodeGen/TwoAddressInstructionPass.cpp:1.20	Thu Jun 24 19:13:11 2004
+++ llvm/lib/CodeGen/TwoAddressInstructionPass.cpp	Mon Jul 19 01:55:17 2004
@@ -151,10 +151,10 @@
 
                     // update live variables for regB
                     if (LV->removeVirtualRegisterKilled(regB, &*mbbi, mi))
-                        LV->addVirtualRegisterKilled(regB, &*mbbi, prevMi);
+                        LV->addVirtualRegisterKilled(regB, prevMi);
 
                     if (LV->removeVirtualRegisterDead(regB, &*mbbi, mi))
-                        LV->addVirtualRegisterDead(regB, &*mbbi, prevMi);
+                        LV->addVirtualRegisterDead(regB, prevMi);
                 }
 
                 // replace all occurences of regB with regA





More information about the llvm-commits mailing list