diff options
author | Chris Lattner <sabre@nondot.org> | 2005-08-25 05:45:31 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2005-08-25 05:45:31 +0000 |
commit | 4e27d3a10ca1094703a3fc979c5417ee4e861d1e (patch) | |
tree | 1a68deb0d794381ab0182aaa98cd08cf49f76988 /include | |
parent | 34e17052a77e1a52cae58b2f6d203c663af97ece (diff) | |
download | external_llvm-4e27d3a10ca1094703a3fc979c5417ee4e861d1e.zip external_llvm-4e27d3a10ca1094703a3fc979c5417ee4e861d1e.tar.gz external_llvm-4e27d3a10ca1094703a3fc979c5417ee4e861d1e.tar.bz2 |
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23043 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/CodeGen/LiveVariables.h | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/include/llvm/CodeGen/LiveVariables.h b/include/llvm/CodeGen/LiveVariables.h index 2c1e065..28cfa2a 100644 --- a/include/llvm/CodeGen/LiveVariables.h +++ b/include/llvm/CodeGen/LiveVariables.h @@ -213,7 +213,16 @@ public: /// 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 @@ public: /// 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 { |