Fix to issue 8287.
authorsivarv <sivarv@microsoft.com>
Thu, 8 Dec 2016 23:40:20 +0000 (15:40 -0800)
committersivarv <sivarv@microsoft.com>
Fri, 9 Dec 2016 03:00:02 +0000 (19:00 -0800)
Commit migrated from https://github.com/dotnet/coreclr/commit/d1d06e7241ce9e27067bf6f57d280ad67ca03a74

src/coreclr/src/jit/lsra.cpp

index 6813beb..8dd6f4c 100644 (file)
@@ -4854,11 +4854,11 @@ void LinearScan::setFrameType()
     compiler->rpFrameType = frameType;
 }
 
-// Is the copyReg given by this RefPosition still busy at the
+// Is the copyReg/moveReg given by this RefPosition still busy at the
 // given location?
-bool copyRegInUse(RefPosition* ref, LsraLocation loc)
+bool copyOrMoveRegInUse(RefPosition* ref, LsraLocation loc)
 {
-    assert(ref->copyReg);
+    assert(ref->copyReg || ref->moveReg);
     if (ref->getRefEndLocation() >= loc)
     {
         return true;
@@ -4918,14 +4918,15 @@ bool LinearScan::registerIsAvailable(RegRecord*    physRegRecord,
             return false;
         }
 
-        // Is this a copyReg?  It is if the register assignment doesn't match.
-        // (the recentReference may not be a copyReg, because we could have seen another
-        // reference since the copyReg)
+        // Is this a copyReg/moveReg?  It is if the register assignment doesn't match.
+        // (the recentReference may not be a copyReg/moveReg, because we could have seen another
+        // reference since the copyReg/moveReg)
 
         if (!assignedInterval->isAssignedTo(physRegRecord->regNum))
         {
             // Don't reassign it if it's still in use
-            if (recentReference->copyReg && copyRegInUse(recentReference, currentLoc))
+            if ((recentReference->copyReg || recentReference->moveReg) &&
+                copyOrMoveRegInUse(recentReference, currentLoc))
             {
                 return false;
             }