summaryrefslogtreecommitdiff
path: root/lib/CodeGen/RegAllocFast.cpp
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2011-06-21 22:36:03 +0000
committerDevang Patel <dpatel@apple.com>2011-06-21 22:36:03 +0000
commit72d9b0e4fce90a635af5c80cb6992ac639279d59 (patch)
tree7045f84ef38a7e199ef20c8429e6793b2238faca /lib/CodeGen/RegAllocFast.cpp
parent8fcd3e620424372af9afeeed7cd941aa8d5435af (diff)
downloadllvm-72d9b0e4fce90a635af5c80cb6992ac639279d59.tar.gz
llvm-72d9b0e4fce90a635af5c80cb6992ac639279d59.tar.bz2
llvm-72d9b0e4fce90a635af5c80cb6992ac639279d59.tar.xz
There could be more than one DBG_VALUE instructions for variables where all of them have offset based on one register.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133560 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/RegAllocFast.cpp')
-rw-r--r--lib/CodeGen/RegAllocFast.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/CodeGen/RegAllocFast.cpp b/lib/CodeGen/RegAllocFast.cpp
index 65ebdf827d..dd5baab8d8 100644
--- a/lib/CodeGen/RegAllocFast.cpp
+++ b/lib/CodeGen/RegAllocFast.cpp
@@ -86,7 +86,7 @@ namespace {
// that is currently available in a physical register.
LiveRegMap LiveVirtRegs;
- DenseMap<unsigned, MachineInstr *> LiveDbgValueMap;
+ DenseMap<unsigned, SmallVector<MachineInstr *, 4> > LiveDbgValueMap;
// RegState - Track the state of a physical register.
enum RegState {
@@ -272,7 +272,9 @@ void RAFast::spillVirtReg(MachineBasicBlock::iterator MI,
// If this register is used by DBG_VALUE then insert new DBG_VALUE to
// identify spilled location as the place to find corresponding variable's
// value.
- if (MachineInstr *DBG = LiveDbgValueMap.lookup(LRI->first)) {
+ SmallVector<MachineInstr *, 4> &LRIDbgValues = LiveDbgValueMap[LRI->first];
+ for (unsigned li = 0, le = LRIDbgValues.size(); li != le; ++li) {
+ MachineInstr *DBG = LRIDbgValues[li];
const MDNode *MDPtr =
DBG->getOperand(DBG->getNumOperands()-1).getMetadata();
int64_t Offset = 0;
@@ -291,7 +293,7 @@ void RAFast::spillVirtReg(MachineBasicBlock::iterator MI,
MachineBasicBlock *MBB = DBG->getParent();
MBB->insert(MI, NewDV);
DEBUG(dbgs() << "Inserting debug info due to spill:" << "\n" << *NewDV);
- LiveDbgValueMap[LRI->first] = NewDV;
+ LRIDbgValues[li] = NewDV;
}
}
if (SpillKill)
@@ -816,7 +818,7 @@ void RAFast::AllocateBasicBlock() {
if (!MO.isReg()) continue;
unsigned Reg = MO.getReg();
if (!TargetRegisterInfo::isVirtualRegister(Reg)) continue;
- LiveDbgValueMap[Reg] = MI;
+ LiveDbgValueMap[Reg].push_back(MI);
LiveRegMap::iterator LRI = LiveVirtRegs.find(Reg);
if (LRI != LiveVirtRegs.end())
setPhysReg(MI, i, LRI->second.PhysReg);