diff options
author | Evan Cheng <evan.cheng@apple.com> | 2007-12-05 09:51:10 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2007-12-05 09:51:10 +0000 |
commit | adf85906906ebf85c57c333e8209f37ef11a6c99 (patch) | |
tree | 55b3befe185f93909e364cb2129927f51f997987 /lib/CodeGen/VirtRegMap.h | |
parent | f38d14f03e495ea98ae16bda6febbde276513294 (diff) |
If a split live interval is spilled again, remove the kill marker on its last use.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44611 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/VirtRegMap.h')
-rw-r--r-- | lib/CodeGen/VirtRegMap.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/lib/CodeGen/VirtRegMap.h b/lib/CodeGen/VirtRegMap.h index df32a6566a..7740740548 100644 --- a/lib/CodeGen/VirtRegMap.h +++ b/lib/CodeGen/VirtRegMap.h @@ -66,6 +66,10 @@ namespace llvm { /// mapping. IndexedMap<unsigned, VirtReg2IndexFunctor> Virt2SplitMap; + /// Virt2SplitKillMap - This is splitted virtual register to its last use + /// (kill) mapping. + IndexedMap<MachineOperand*> Virt2SplitKillMap; + /// ReMatMap - This is virtual register to re-materialized instruction /// mapping. Each virtual register whose definition is going to be /// re-materialized has an entry in it. @@ -210,6 +214,21 @@ namespace llvm { ReMatMap[virtReg] = def; } + /// @brief record the last use (kill) of a split virtual register. + void addKillPoint(unsigned virtReg, MachineOperand *Op) { + Virt2SplitKillMap[virtReg] = Op; + } + + /// @brief reset and 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; + } + } + /// @brief returns true if the specified MachineInstr is a spill point. bool isSpillPt(MachineInstr *Pt) const { return SpillPt2VirtMap.find(Pt) != SpillPt2VirtMap.end(); |