Don't emit a DBG_VALUE for a spill slot that the rewriter decided not to use after...
authorJakob Stoklund Olesen <stoklund@2pi.dk>
Wed, 12 Jan 2011 23:14:07 +0000 (23:14 +0000)
committerJakob Stoklund Olesen <stoklund@2pi.dk>
Wed, 12 Jan 2011 23:14:07 +0000 (23:14 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123339 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/LiveDebugVariables.cpp

index fc6275fa5e64412f5fd0fafcb662b4da9c9e1cd2..b2aaa8e46a498d4075c610b7420aa0630c318e81 100644 (file)
@@ -568,7 +568,8 @@ UserValue::rewriteLocations(VirtRegMap &VRM, const TargetRegisterInfo &TRI) {
     if (VRM.isAssignedReg(VirtReg) &&
         TargetRegisterInfo::isPhysicalRegister(VRM.getPhys(VirtReg))) {
       Loc.substPhysReg(VRM.getPhys(VirtReg), TRI);
-    } else if (VRM.getStackSlot(VirtReg) != VirtRegMap::NO_STACK_SLOT) {
+    } else if (VRM.getStackSlot(VirtReg) != VirtRegMap::NO_STACK_SLOT &&
+               VRM.isSpillSlotUsed(VRM.getStackSlot(VirtReg))) {
       // FIXME: Translate SubIdx to a stackslot offset.
       Loc = MachineOperand::CreateFI(VRM.getStackSlot(VirtReg));
     } else {