Fix problem fusing spill code into instructions: we didn't update the live
authorChris Lattner <sabre@nondot.org>
Thu, 19 Feb 2004 18:34:02 +0000 (18:34 +0000)
committerChris Lattner <sabre@nondot.org>
Thu, 19 Feb 2004 18:34:02 +0000 (18:34 +0000)
variable information to take into account the change of instruction
address.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11628 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/RegAllocLocal.cpp

index cbbc7c2299744b5ed3602b9977b1a48f1eb63a6c..188b3b341708753a8480abd0c6a36c8e7c6b6785 100644 (file)
@@ -496,6 +496,9 @@ MachineInstr *RA::reloadVirtReg(MachineBasicBlock &MBB, MachineInstr *MI,
     MachineBasicBlock::iterator MII = MI;
     if (RegInfo->foldMemoryOperand(MII, OpNum, FrameIndex)) {
       ++NumFused;
+      // Since we changed the address of MI, make sure to update live variables
+      // to know that the new instruction has the properties of the old one.
+      LV->instructionChanged(MI, MII);
       return MII;
     }