diff options
author | Evan Cheng <evan.cheng@apple.com> | 2007-12-05 10:24:35 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2007-12-05 10:24:35 +0000 |
commit | d120ffd26f2715c600b028d4eac9a3c41a9f4653 (patch) | |
tree | 4f7b2a64495bbf17efd489ab883626e989d8282e /lib/CodeGen/VirtRegMap.h | |
parent | adf85906906ebf85c57c333e8209f37ef11a6c99 (diff) |
MachineInstr can change. Store indexes instead.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44612 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/VirtRegMap.h')
-rw-r--r-- | lib/CodeGen/VirtRegMap.h | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/lib/CodeGen/VirtRegMap.h b/lib/CodeGen/VirtRegMap.h index 7740740548..192d64a30e 100644 --- a/lib/CodeGen/VirtRegMap.h +++ b/lib/CodeGen/VirtRegMap.h @@ -67,8 +67,8 @@ namespace llvm { IndexedMap<unsigned, VirtReg2IndexFunctor> Virt2SplitMap; /// Virt2SplitKillMap - This is splitted virtual register to its last use - /// (kill) mapping. - IndexedMap<MachineOperand*> Virt2SplitKillMap; + /// (kill) index mapping. + IndexedMap<unsigned> Virt2SplitKillMap; /// ReMatMap - This is virtual register to re-materialized instruction /// mapping. Each virtual register whose definition is going to be @@ -215,18 +215,17 @@ namespace llvm { } /// @brief record the last use (kill) of a split virtual register. - void addKillPoint(unsigned virtReg, MachineOperand *Op) { - Virt2SplitKillMap[virtReg] = Op; + void addKillPoint(unsigned virtReg, unsigned index) { + Virt2SplitKillMap[virtReg] = index; } - /// @brief reset and remove the last use (kill) of a split virtual register. + unsigned getKillPoint(unsigned virtReg) const { + return Virt2SplitKillMap[virtReg]; + } + + /// @brief remove the last use (kill) of a split virtual register. void removeKillPoint(unsigned virtReg) { - MachineOperand *MO = Virt2SplitKillMap[virtReg]; - if (MO) { - assert(MO->isKill() && "Split last use is not marked kill?"); - MO->unsetIsKill(); - Virt2SplitKillMap[virtReg] = NULL; - } + Virt2SplitKillMap[virtReg] = 0; } /// @brief returns true if the specified MachineInstr is a spill point. |