While unassigning a phyReg, establish association with a previous interval
authorsivarv <sivarv@microsoft.com>
Sat, 5 Nov 2016 00:13:57 +0000 (17:13 -0700)
committersivarv <sivarv@microsoft.com>
Sat, 5 Nov 2016 00:52:06 +0000 (17:52 -0700)
only if it is different from the one it is unassigned.

src/jit/lsra.cpp

index d2fbd387f9cb58317023e3f80d1151ab744bcf24..3b22f1d8b610f4bf39816af54223b1ee2b682a1b 100644 (file)
@@ -6184,7 +6184,8 @@ void LinearScan::unassignPhysReg(RegRecord* regRec, RefPosition* spillRefPositio
     {
         assignedInterval->assignedReg = regRec;
     }
-    else if (regRec->previousInterval != nullptr && regRec->previousInterval->assignedReg == regRec &&
+    else if (regRec->previousInterval != nullptr && regRec->previousInterval != assignedInterval &&
+             regRec->previousInterval->assignedReg == regRec &&
              regRec->previousInterval->getNextRefPosition() != nullptr)
     {
         regRec->assignedInterval = regRec->previousInterval;