[RyuJIT/ARM32] Applying review feedback
authorHyung-Kyu Choi <hk0110.choi@samsung.com>
Wed, 31 May 2017 03:24:19 +0000 (12:24 +0900)
committerHyung-Kyu Choi <hk0110.choi@samsung.com>
Wed, 31 May 2017 03:28:32 +0000 (12:28 +0900)
- Use canRestorePreviousInterval() for all target
- Update condition for restoring TYP_DOUBLE interval

Signed-off-by: Hyung-Kyu Choi <hk0110.choi@samsung.com>
Commit migrated from https://github.com/dotnet/coreclr/commit/f72202cfbb6414f1767f973797c167e77cb82923

src/coreclr/src/jit/lsra.cpp
src/coreclr/src/jit/lsra.h

index 52680cf..c2a5fcf 100644 (file)
@@ -6448,13 +6448,7 @@ void LinearScan::unassignPhysReg(RegRecord* regRec, RefPosition* spillRefPositio
     {
         assignedInterval->assignedReg = regRec;
     }
-#ifdef _TARGET_ARM_
     else if (canRestorePreviousInterval(regRec, assignedInterval))
-#else
-    else if (regRec->previousInterval != nullptr && regRec->previousInterval != assignedInterval &&
-             regRec->previousInterval->assignedReg == regRec &&
-             regRec->previousInterval->getNextRefPosition() != nullptr)
-#endif
     {
         regRec->assignedInterval = regRec->previousInterval;
         regRec->previousInterval = nullptr;
@@ -6657,6 +6651,7 @@ bool LinearScan::isSecondHalfReg(RegRecord* regRec, Interval* interval)
 
     return false;
 }
+#endif
 
 //--------------------------------------------------------------------------------------
 // canRestorePreviousInterval: Test if we can restore previous interval
@@ -6677,17 +6672,18 @@ bool LinearScan::canRestorePreviousInterval(RegRecord* regRec, Interval* assigne
         (regRec->previousInterval != nullptr && regRec->previousInterval != assignedInterval &&
          regRec->previousInterval->assignedReg == regRec && regRec->previousInterval->getNextRefPosition() != nullptr);
 
+#ifdef _TARGET_ARM_
     if (retVal && regRec->previousInterval->registerType == TYP_DOUBLE)
     {
         regNumber  nextRegNum = REG_NEXT(regRec->regNum);
         RegRecord* nextRegRec = getRegisterRecord(nextRegNum);
 
-        retVal = retVal &&
-                 (nextRegRec->assignedInterval == nullptr && regRec->previousInterval == nextRegRec->previousInterval);
+        retVal = retVal && nextRegRec->assignedInterval == nullptr;
     }
+#endif
+
     return retVal;
 }
-#endif
 
 //------------------------------------------------------------------------
 // processBlockStartLocations: Update var locations on entry to 'currentBlock'
index 68d9eb1..aab034b 100644 (file)
@@ -696,8 +696,8 @@ private:
 
 #ifdef _TARGET_ARM_
     bool isSecondHalfReg(RegRecord* regRec, Interval* interval);
-    bool LinearScan::canRestorePreviousInterval(RegRecord* regRec, Interval* assignedInterval);
 #endif
+    bool canRestorePreviousInterval(RegRecord* regRec, Interval* assignedInterval);
 
     RefType CheckBlockType(BasicBlock* block, BasicBlock* prevBlock);