[llvm-commits] CVS: llvm/include/llvm/CodeGen/LiveVariables.h

Chris Lattner lattner at cs.uiuc.edu
Mon Jul 19 00:04:58 PDT 2004



Changes in directory llvm/include/llvm/CodeGen:

LiveVariables.h updated: 1.17 -> 1.18

---
Log message:

There is no need to store the MBB along with the MI any more, we can now
ask instructions for their parent.


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

Index: llvm/include/llvm/CodeGen/LiveVariables.h
diff -u llvm/include/llvm/CodeGen/LiveVariables.h:1.17 llvm/include/llvm/CodeGen/LiveVariables.h:1.18
--- llvm/include/llvm/CodeGen/LiveVariables.h:1.17	Mon Jul 19 01:55:21 2004
+++ llvm/include/llvm/CodeGen/LiveVariables.h	Mon Jul 19 02:04:48 2004
@@ -48,11 +48,10 @@
     ///
     std::vector<bool> AliveBlocks;
 
-    /// Kills - List of MachineBasicblock's which contain the last use of this
-    /// virtual register (kill it).  This also includes the specific instruction
-    /// which kills the value.
+    /// Kills - List of MachineInstruction's which are the last use of this
+    /// virtual register (kill it) in their basic block.
     ///
-    std::vector<std::pair<MachineBasicBlock*, MachineInstr*> > Kills;
+    std::vector<MachineInstr*> Kills;
 
     VarInfo() : DefInst(0) {}
 
@@ -60,13 +59,12 @@
     /// machine instruction. Returns true if there was a kill
     /// corresponding to this instruction, false otherwise.
     bool removeKill(MachineInstr *MI) {
-      for (std::vector<std::pair<MachineBasicBlock*, MachineInstr*> >::iterator
-             i = Kills.begin(); i != Kills.end(); ++i) {
-        if (i->second == MI) {
+      for (std::vector<MachineInstr*>::iterator i = Kills.begin(),
+             e = Kills.end(); i != e; ++i)
+        if (*i == MI) {
           Kills.erase(i);
           return true;
         }
-      }
       return false;
     }
   };
@@ -153,7 +151,7 @@
   ///
   void addVirtualRegisterKilled(unsigned IncomingReg, MachineInstr *MI) {
     RegistersKilled.insert(std::make_pair(MI, IncomingReg));
-    getVarInfo(IncomingReg).Kills.push_back(std::make_pair(MI->getParent(),MI));
+    getVarInfo(IncomingReg).Kills.push_back(MI);
   }
 
   /// removeVirtualRegisterKilled - Remove the specified virtual
@@ -189,7 +187,7 @@
   ///
   void addVirtualRegisterDead(unsigned IncomingReg, MachineInstr *MI) {
     RegistersDead.insert(std::make_pair(MI, IncomingReg));
-    getVarInfo(IncomingReg).Kills.push_back(std::make_pair(MI->getParent(),MI));
+    getVarInfo(IncomingReg).Kills.push_back(MI);
   }
 
   /// removeVirtualRegisterDead - Remove the specified virtual





More information about the llvm-commits mailing list