From 8d2584a1d9ab56d35884d035e4da6146b4d7391f Mon Sep 17 00:00:00 2001 From: Jakob Stoklund Olesen Date: Fri, 3 Dec 2010 21:47:08 +0000 Subject: [PATCH] Also update virtRegMap when renaming virtual registers. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120841 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/LiveDebugVariables.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/CodeGen/LiveDebugVariables.cpp b/lib/CodeGen/LiveDebugVariables.cpp index 4b428f65896..73083c77157 100644 --- a/lib/CodeGen/LiveDebugVariables.cpp +++ b/lib/CodeGen/LiveDebugVariables.cpp @@ -583,8 +583,18 @@ renameRegister(unsigned OldReg, unsigned NewReg, unsigned SubIdx, void LDVImpl:: renameRegister(unsigned OldReg, unsigned NewReg, unsigned SubIdx) { - for (UserValue *UV = lookupVirtReg(OldReg); UV; UV = UV->getNext()) + UserValue *UV = lookupVirtReg(OldReg); + if (!UV) + return; + + if (TargetRegisterInfo::isVirtualRegister(NewReg)) + mapVirtReg(NewReg, UV); + virtRegMap.erase(OldReg); + + do { UV->renameRegister(OldReg, NewReg, SubIdx, TRI); + UV = UV->getNext(); + } while (UV); } void LiveDebugVariables::