[llvm-commits] CVS: llvm/include/llvm/CodeGen/LiveVariables.h
Chris Lattner
lattner at cs.uiuc.edu
Wed Aug 24 22:45:42 PDT 2005
Changes in directory llvm/include/llvm/CodeGen:
LiveVariables.h updated: 1.25 -> 1.26
---
Log message:
Fix a problem Duraid noticed, where we weren't removing values from the kills
list when doing two-address and phi node lowering during register allocation.
---
Diffs of the changes: (+20 -2)
LiveVariables.h | 22 ++++++++++++++++++++--
1 files changed, 20 insertions(+), 2 deletions(-)
Index: llvm/include/llvm/CodeGen/LiveVariables.h
diff -u llvm/include/llvm/CodeGen/LiveVariables.h:1.25 llvm/include/llvm/CodeGen/LiveVariables.h:1.26
--- llvm/include/llvm/CodeGen/LiveVariables.h:1.25 Tue Aug 23 19:09:02 2005
+++ llvm/include/llvm/CodeGen/LiveVariables.h Thu Aug 25 00:45:31 2005
@@ -213,7 +213,16 @@
/// removeVirtualRegistersKilled - Remove all killed info for the specified
/// instruction.
void removeVirtualRegistersKilled(MachineInstr *MI) {
- RegistersKilled.erase(MI);
+ std::map<MachineInstr*, std::vector<unsigned> >::iterator I =
+ RegistersKilled.find(MI);
+ if (I != RegistersKilled.end()) {
+ std::vector<unsigned> &Regs = I->second;
+ for (unsigned i = 0, e = Regs.size(); i != e; ++i) {
+ bool removed = getVarInfo(Regs[i]).removeKill(MI);
+ assert(removed && "kill not in register's VarInfo?");
+ }
+ RegistersKilled.erase(I);
+ }
}
/// addVirtualRegisterDead - Add information about the fact that the specified
@@ -256,7 +265,16 @@
/// removeVirtualRegistersDead - Remove all of the specified dead
/// registers from the live variable information.
void removeVirtualRegistersDead(MachineInstr *MI) {
- RegistersDead.erase(MI);
+ std::map<MachineInstr*, std::vector<unsigned> >::iterator I =
+ RegistersDead.find(MI);
+ if (I != RegistersDead.end()) {
+ std::vector<unsigned> &Regs = I->second;
+ for (unsigned i = 0, e = Regs.size(); i != e; ++i) {
+ bool removed = getVarInfo(Regs[i]).removeKill(MI);
+ assert(removed && "kill not in register's VarInfo?");
+ }
+ RegistersDead.erase(I);
+ }
}
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
More information about the llvm-commits
mailing list