The spill restore needs to be resolved to the SP/FP just like the spill
authorJim Grosbach <grosbach@apple.com>
Wed, 21 Oct 2009 22:59:56 +0000 (22:59 +0000)
committerJim Grosbach <grosbach@apple.com>
Wed, 21 Oct 2009 22:59:56 +0000 (22:59 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84792 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/RegisterScavenging.cpp

index 5fa28d281a50eee847917334fc9529715b915a2a..2518ce152090833b2922e94863748b5fb6f50b5d 100644 (file)
@@ -310,6 +310,8 @@ unsigned RegScavenger::scavengeRegister(const TargetRegisterClass *RC,
 
     // Restore the scavenged register before its use (or first terminator).
     TII->loadRegFromStackSlot(*MBB, UseMI, SReg, ScavengingFrameIndex, RC);
+    II = prior(UseMI);
+    TRI->eliminateFrameIndex(II, SPAdj, NULL, this);
   }
 
   ScavengeRestore = prior(UseMI);