diff options
| author | Devang Patel <dpatel@apple.com> | 2010-07-09 21:48:31 +0000 |
|---|---|---|
| committer | Devang Patel <dpatel@apple.com> | 2010-07-09 21:48:31 +0000 |
| commit | 57e72370aeb44b91fcc63dc73006ca51437fac5d (patch) | |
| tree | 28730c59390fa2939affcdeece69c8db13b114d8 | |
| parent | 5e6c2155a315813fc994f3c9048c14ff1f78e9a7 (diff) | |
| download | bcm5719-llvm-57e72370aeb44b91fcc63dc73006ca51437fac5d.tar.gz bcm5719-llvm-57e72370aeb44b91fcc63dc73006ca51437fac5d.zip | |
Update DBG_VALUE to refer appropriate stack slot in case of a spill.
llvm-svn: 108023
| -rw-r--r-- | llvm/lib/CodeGen/RegAllocFast.cpp | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/RegAllocFast.cpp b/llvm/lib/CodeGen/RegAllocFast.cpp index 272eff24e46..f44478e5dd0 100644 --- a/llvm/lib/CodeGen/RegAllocFast.cpp +++ b/llvm/lib/CodeGen/RegAllocFast.cpp @@ -764,8 +764,25 @@ void RAFast::AllocateBasicBlock() { LiveRegMap::iterator LRI = LiveVirtRegs.find(Reg); if (LRI != LiveVirtRegs.end()) setPhysReg(MI, i, LRI->second.PhysReg); - else - MO.setReg(0); // We can't allocate a physreg for a DebugValue, sorry! + else { + int SS = StackSlotForVirtReg[Reg]; + if (SS == -1) + MO.setReg(0); // We can't allocate a physreg for a DebugValue, sorry! + else { + // Modify DBG_VALUE now that the value is in a spill slot. + uint64_t Offset = MI->getOperand(1).getImm(); + const MDNode *MDPtr = + MI->getOperand(MI->getNumOperands()-1).getMetadata(); + DebugLoc DL = MI->getDebugLoc(); + if (MachineInstr *NewDV = + TII->emitFrameIndexDebugValue(*MF, SS, Offset, MDPtr, DL)) { + DEBUG(dbgs() << "Modifying debug info due to spill:" << "\t" << *MI); + MachineBasicBlock *MBB = MI->getParent(); + MBB->insert(MBB->erase(MI), NewDV); + } else + MO.setReg(0); // We can't allocate a physreg for a DebugValue, sorry! + } + } } // Next instruction. continue; |

