LSRA: fix multi-reg ops under FIELD_LIST
authorCarol Eidt <carol.eidt@microsoft.com>
Thu, 28 Jun 2018 23:38:37 +0000 (16:38 -0700)
committerCarol Eidt <carol.eidt@microsoft.com>
Thu, 28 Jun 2018 23:38:37 +0000 (16:38 -0700)
Need to build a use for each reg.
Also, dump the defList if it's not empty at end of block.

Commit migrated from https://github.com/dotnet/coreclr/commit/965c96e5971e47a256bbd57ad27b75e6d71843cf

src/coreclr/src/jit/lsra.cpp
src/coreclr/src/jit/lsraarmarch.cpp
src/coreclr/src/jit/lsrabuild.cpp

index 27d29df..537aa06 100644 (file)
@@ -8728,6 +8728,10 @@ void LinearScan::dumpNodeInfo(GenTree* node, regMaskTP dstCandidates, int srcCou
 
 void LinearScan::dumpDefList()
 {
+    if (!VERBOSE)
+    {
+        return;
+    }
     JITDUMP("DefList: { ");
     bool first = true;
     for (RefInfoListNode *listNode = defList.Begin(), *end = defList.End(); listNode != end;
index 1804d4c..dad8a75 100644 (file)
@@ -512,16 +512,18 @@ int LinearScan::BuildPutArgSplit(GenTreePutArgSplit* argNode)
                 assert(!node->IsMultiRegNode());
                 currentRegCount = 1;
             }
-            regMaskTP sourceMask = RBM_NONE;
-            if (sourceRegCount < argNode->gtNumRegs)
+            // Consume all the registers, setting the appropriate register mask for the ones that
+            // go into registers.
+            for (unsigned regIndex = 0; regIndex < currentRegCount; regIndex++)
             {
-                for (unsigned regIndex = 0; regIndex < currentRegCount; regIndex++)
+                regMaskTP sourceMask = RBM_NONE;
+                if (sourceRegCount < argNode->gtNumRegs)
                 {
-                    sourceMask |= genRegMask((regNumber)((unsigned)argReg + sourceRegCount + regIndex));
+                    sourceMask = genRegMask((regNumber)((unsigned)argReg + sourceRegCount));
                 }
+                sourceRegCount++;
+                BuildUse(node, sourceMask, regIndex);
             }
-            sourceRegCount += currentRegCount;
-            BuildUse(node, sourceMask);
         }
         srcCount += sourceRegCount;
         assert(putArgChild->isContained());
index 14a8ab7..0d0efa9 100644 (file)
@@ -2091,7 +2091,11 @@ void LinearScan::buildIntervals()
 
         // Note: the visited set is cleared in LinearScan::doLinearScan()
         markBlockVisited(block);
-        assert(defList.IsEmpty());
+        if (!defList.IsEmpty())
+        {
+            INDEBUG(dumpDefList());
+            assert(!"Expected empty defList at end of block");
+        }
 
         if (enregisterLocalVars)
         {