Move use of LV inside condition that guards for null LV.
authorBob Wilson <bob.wilson@apple.com>
Tue, 1 Sep 2009 22:19:00 +0000 (22:19 +0000)
committerBob Wilson <bob.wilson@apple.com>
Tue, 1 Sep 2009 22:19:00 +0000 (22:19 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80731 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/TwoAddressInstructionPass.cpp

index d75396906e10ed2dde0827be3b9e155239cb14cc..b0310048ec1268736398373268ebcf1ecae0079a 100644 (file)
@@ -865,12 +865,12 @@ bool TwoAddressInstructionPass::runOnMachineFunction(MachineFunction &MF) {
                       LV->addVirtualRegisterKilled(Kill, NewKill);
                   }
                 }
                       LV->addVirtualRegisterKilled(Kill, NewKill);
                   }
                 }
-              }
 
 
-              // We're really going to nuke the old inst. If regB was marked
-              // as a kill we need to update its Kills list.
-              if (mi->getOperand(si).isKill())
-                LV->removeVirtualRegisterKilled(regB, mi);
+                // We're really going to nuke the old inst. If regB was marked
+                // as a kill we need to update its Kills list.
+                if (mi->getOperand(si).isKill())
+                  LV->removeVirtualRegisterKilled(regB, mi);
+              }
 
               mbbi->erase(mi); // Nuke the old inst.
               mi = nmi;
 
               mbbi->erase(mi); // Nuke the old inst.
               mi = nmi;