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

Chris Lattner lattner at cs.uiuc.edu
Sat Sep 2 17:05:25 PDT 2006



Changes in directory llvm/lib/CodeGen:

LiveVariables.cpp updated: 1.57 -> 1.58
---
Log message:

Move two methods out of line, make them work when the record for a machine
instruction includes physregs.


---
Diffs of the changes:  (+36 -0)

 LiveVariables.cpp |   36 ++++++++++++++++++++++++++++++++++++
 1 files changed, 36 insertions(+)


Index: llvm/lib/CodeGen/LiveVariables.cpp
diff -u llvm/lib/CodeGen/LiveVariables.cpp:1.57 llvm/lib/CodeGen/LiveVariables.cpp:1.58
--- llvm/lib/CodeGen/LiveVariables.cpp:1.57	Sun Aug 27 17:30:17 2006
+++ llvm/lib/CodeGen/LiveVariables.cpp	Sat Sep  2 19:05:09 2006
@@ -415,3 +415,39 @@
     RegistersDead.erase(OldMI);
   }
 }
+
+/// removeVirtualRegistersKilled - Remove all killed info for the specified
+/// instruction.
+void LiveVariables::removeVirtualRegistersKilled(MachineInstr *MI) {
+  std::map<MachineInstr*, std::vector<unsigned> >::iterator I = 
+    RegistersKilled.find(MI);
+  if (I == RegistersKilled.end()) return;
+
+  std::vector<unsigned> &Regs = I->second;
+  for (unsigned i = 0, e = Regs.size(); i != e; ++i) {
+    if (MRegisterInfo::isVirtualRegister(Regs[i])) {
+      bool removed = getVarInfo(Regs[i]).removeKill(MI);
+      assert(removed && "kill not in register's VarInfo?");
+    }
+  }
+  RegistersKilled.erase(I);
+}
+
+/// removeVirtualRegistersDead - Remove all of the dead registers for the
+/// specified instruction from the live variable information.
+void LiveVariables::removeVirtualRegistersDead(MachineInstr *MI) {
+  std::map<MachineInstr*, std::vector<unsigned> >::iterator I = 
+    RegistersDead.find(MI);
+  if (I == RegistersDead.end()) return;
+  
+  std::vector<unsigned> &Regs = I->second;
+  for (unsigned i = 0, e = Regs.size(); i != e; ++i) {
+    if (MRegisterInfo::isVirtualRegister(Regs[i])) {
+      bool removed = getVarInfo(Regs[i]).removeKill(MI);
+      assert(removed && "kill not in register's VarInfo?");
+    }
+  }
+  RegistersDead.erase(I);
+}
+
+






More information about the llvm-commits mailing list