Skip dbg_value instructions when scanning instructions in register scavenging.
authorJim Grosbach <grosbach@apple.com>
Fri, 4 Jun 2010 20:18:30 +0000 (20:18 +0000)
committerJim Grosbach <grosbach@apple.com>
Fri, 4 Jun 2010 20:18:30 +0000 (20:18 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@105481 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/RegisterScavenging.cpp

index 690e59f96ebc73e73096dee85dc5703b360a0c31..b3e79756b62cf9aba362a261556605e70ade8b15 100644 (file)
@@ -258,6 +258,10 @@ unsigned RegScavenger::findSurvivorReg(MachineBasicBlock::iterator StartMI,
 
   bool inVirtLiveRange = false;
   for (++MI; InstrLimit > 0 && MI != ME; ++MI, --InstrLimit) {
+    if (MI->isDebugValue()) {
+      ++InstrLimit; // Don't count debug instructions
+      continue;
+    }
     bool isVirtKillInsn = false;
     bool isVirtDefInsn = false;
     // Remove any candidates touched by instruction.